From 5be2265e30566bf2f5a44f5861595bf02cb9a4d7 Mon Sep 17 00:00:00 2001 From: John Grossman Date: Mon, 22 Aug 2011 13:25:06 -0700 Subject: Add a bridge implementation of get_master_volume. Add an implementation of the new get_master_volume method to bridge from the new C only audio HAL to the old C++ legacy audio HAL. Change-Id: Ib66bdcd3bee50949047e7ad51388e15491a71724 --- audio/AudioHardwareInterface.cpp | 5 +++++ audio/audio_hw_hal.cpp | 7 +++++++ include/hardware_legacy/AudioHardwareBase.h | 1 + include/hardware_legacy/AudioHardwareInterface.h | 8 ++++++++ 4 files changed, 21 insertions(+) diff --git a/audio/AudioHardwareInterface.cpp b/audio/AudioHardwareInterface.cpp index 9cec267..4997a6a 100644 --- a/audio/AudioHardwareInterface.cpp +++ b/audio/AudioHardwareInterface.cpp @@ -125,6 +125,11 @@ size_t AudioHardwareBase::getInputBufferSize(uint32_t sampleRate, int format, in return 320; } +status_t AudioHardwareBase::getMasterVolume(float *volume) +{ + return INVALID_OPERATION; +} + status_t AudioHardwareBase::dumpState(int fd, const Vector& args) { const size_t SIZE = 256; diff --git a/audio/audio_hw_hal.cpp b/audio/audio_hw_hal.cpp index e6805c5..f249f88 100644 --- a/audio/audio_hw_hal.cpp +++ b/audio/audio_hw_hal.cpp @@ -346,6 +346,12 @@ static int adev_set_master_volume(struct audio_hw_device *dev, float volume) return ladev->hwif->setMasterVolume(volume); } +static int adev_get_master_volume(struct audio_hw_device *dev, float* volume) +{ + struct legacy_audio_device *ladev = to_ladev(dev); + return ladev->hwif->getMasterVolume(volume); +} + static int adev_set_mode(struct audio_hw_device *dev, int mode) { struct legacy_audio_device *ladev = to_ladev(dev); @@ -553,6 +559,7 @@ static int legacy_adev_open(const hw_module_t* module, const char* name, ladev->device.init_check = adev_init_check; ladev->device.set_voice_volume = adev_set_voice_volume; ladev->device.set_master_volume = adev_set_master_volume; + ladev->device.get_master_volume = adev_get_master_volume; ladev->device.set_mode = adev_set_mode; ladev->device.set_mic_mute = adev_set_mic_mute; ladev->device.get_mic_mute = adev_get_mic_mute; diff --git a/include/hardware_legacy/AudioHardwareBase.h b/include/hardware_legacy/AudioHardwareBase.h index 3dec357..eac40dc 100644 --- a/include/hardware_legacy/AudioHardwareBase.h +++ b/include/hardware_legacy/AudioHardwareBase.h @@ -46,6 +46,7 @@ public: virtual String8 getParameters(const String8& keys); virtual size_t getInputBufferSize(uint32_t sampleRate, int format, int channelCount); + virtual status_t getMasterVolume(float *volume); /**This method dumps the state of the audio hardware */ virtual status_t dumpState(int fd, const Vector& args); diff --git a/include/hardware_legacy/AudioHardwareInterface.h b/include/hardware_legacy/AudioHardwareInterface.h index 847fe6b..425b0a5 100644 --- a/include/hardware_legacy/AudioHardwareInterface.h +++ b/include/hardware_legacy/AudioHardwareInterface.h @@ -210,6 +210,14 @@ public: virtual status_t setMasterVolume(float volume) = 0; /** + * Get the current master volume value for the HAL, if the HAL supports + * master volume control. AudioFlinger will query this value from the + * primary audio HAL when the service starts and use the value for setting + * the initial master volume across all HALs. + */ + virtual status_t getMasterVolume(float *volume) = 0; + + /** * setMode is called when the audio mode changes. NORMAL mode is for * standard audio playback, RINGTONE when a ringtone is playing, and IN_CALL * when a call is in progress. -- cgit v1.1 From e14fb4f6fb58bbb08ff737d1b17018610c3ac97d Mon Sep 17 00:00:00 2001 From: John Grossman Date: Mon, 29 Aug 2011 10:56:08 -0700 Subject: Add an implementation of get_next_write_timestamp. Add a default implementation of get_next_write_timestamp to the C <--> C++ legacy audio HAL implementation allowing HALs using the legacy C++ AudioStreamOut to overload and implement get_next_write_timestamp. Default implementation returns INVALID_OPERATION to indicate that the functionality is not supported. Change-Id: I2f32858197696cb46ba6b96f30acc08e0b737a3f --- audio/AudioHardwareInterface.cpp | 7 +++++++ audio/audio_hw_hal.cpp | 9 +++++++++ include/hardware_legacy/AudioHardwareInterface.h | 7 +++++++ 3 files changed, 23 insertions(+) diff --git a/audio/AudioHardwareInterface.cpp b/audio/AudioHardwareInterface.cpp index 4997a6a..c116669 100644 --- a/audio/AudioHardwareInterface.cpp +++ b/audio/AudioHardwareInterface.cpp @@ -73,6 +73,12 @@ AudioStreamOut::~AudioStreamOut() { } +// default implementation is unsupported +status_t AudioStreamOut::getNextWriteTimestamp(int64_t *timestamp) +{ + return INVALID_OPERATION; +} + AudioStreamIn::~AudioStreamIn() {} AudioHardwareBase::AudioHardwareBase() @@ -125,6 +131,7 @@ size_t AudioHardwareBase::getInputBufferSize(uint32_t sampleRate, int format, in return 320; } +// default implementation is unsupported status_t AudioHardwareBase::getMasterVolume(float *volume) { return INVALID_OPERATION; diff --git a/audio/audio_hw_hal.cpp b/audio/audio_hw_hal.cpp index f249f88..dd56c80 100644 --- a/audio/audio_hw_hal.cpp +++ b/audio/audio_hw_hal.cpp @@ -162,6 +162,14 @@ static int out_get_render_position(const struct audio_stream_out *stream, return out->legacy_out->getRenderPosition(dsp_frames); } +static int out_get_next_write_timestamp(const struct audio_stream_out *stream, + int64_t *timestamp) +{ + const struct legacy_stream_out *out = + reinterpret_cast(stream); + return out->legacy_out->getNextWriteTimestamp(timestamp); +} + static int out_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect) { return 0; @@ -433,6 +441,7 @@ static int adev_open_output_stream(struct audio_hw_device *dev, out->stream.set_volume = out_set_volume; out->stream.write = out_write; out->stream.get_render_position = out_get_render_position; + out->stream.get_next_write_timestamp = out_get_next_write_timestamp; *stream_out = &out->stream; return 0; diff --git a/include/hardware_legacy/AudioHardwareInterface.h b/include/hardware_legacy/AudioHardwareInterface.h index 425b0a5..87f933c 100644 --- a/include/hardware_legacy/AudioHardwareInterface.h +++ b/include/hardware_legacy/AudioHardwareInterface.h @@ -109,6 +109,13 @@ public: // return the number of audio frames written by the audio dsp to DAC since // the output has exited standby virtual status_t getRenderPosition(uint32_t *dspFrames) = 0; + + /** + * get the local time at which the next write to the audio driver will be + * presented + */ + virtual status_t getNextWriteTimestamp(int64_t *timestamp); + }; /** -- cgit v1.1 From 6a70518b93928d1c91457ff805e375c82d76b0e5 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Thu, 20 Oct 2011 11:56:19 +0100 Subject: Rename LOGV(_IF) to ALOGV(_IF) DO NOT MERGE See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I953e5eabaf5023a4dcd76339c336d9132f257f8c --- audio/A2dpAudioInterface.cpp | 26 +++---- audio/AudioDumpInterface.cpp | 36 +++++----- audio/AudioHardwareGeneric.cpp | 10 +-- audio/AudioPolicyManagerBase.cpp | 144 +++++++++++++++++++-------------------- audio/audio_policy_hal.cpp | 2 +- wifi/wifi.c | 2 +- 6 files changed, 110 insertions(+), 110 deletions(-) diff --git a/audio/A2dpAudioInterface.cpp b/audio/A2dpAudioInterface.cpp index 2d78858..57c23bb 100644 --- a/audio/A2dpAudioInterface.cpp +++ b/audio/A2dpAudioInterface.cpp @@ -64,7 +64,7 @@ AudioStreamOut* A2dpAudioInterface::openOutputStream( uint32_t devices, int *format, uint32_t *channels, uint32_t *sampleRate, status_t *status) { if (!AudioSystem::isA2dpDevice((AudioSystem::audio_devices)devices)) { - LOGV("A2dpAudioInterface::openOutputStream() open HW device: %x", devices); + ALOGV("A2dpAudioInterface::openOutputStream() open HW device: %x", devices); return mHardwareInterface->openOutputStream(devices, format, channels, sampleRate, status); } @@ -137,7 +137,7 @@ status_t A2dpAudioInterface::setParameters(const String8& keyValuePairs) String8 key; status_t status = NO_ERROR; - LOGV("setParameters() %s", keyValuePairs.string()); + ALOGV("setParameters() %s", keyValuePairs.string()); key = "bluetooth_enabled"; if (param.get(key, value) == NO_ERROR) { @@ -195,7 +195,7 @@ String8 A2dpAudioInterface::getParameters(const String8& keys) keyValuePairs += mHardwareInterface->getParameters(param.toString()); } - LOGV("getParameters() %s", keyValuePairs.string()); + ALOGV("getParameters() %s", keyValuePairs.string()); return keyValuePairs; } @@ -267,9 +267,9 @@ status_t A2dpAudioInterface::A2dpAudioStreamOut::set( A2dpAudioInterface::A2dpAudioStreamOut::~A2dpAudioStreamOut() { - LOGV("A2dpAudioStreamOut destructor"); + ALOGV("A2dpAudioStreamOut destructor"); close(); - LOGV("A2dpAudioStreamOut destructor returning from close()"); + ALOGV("A2dpAudioStreamOut destructor returning from close()"); } ssize_t A2dpAudioInterface::A2dpAudioStreamOut::write(const void* buffer, size_t bytes) @@ -281,7 +281,7 @@ ssize_t A2dpAudioInterface::A2dpAudioStreamOut::write(const void* buffer, size_t size_t remaining = bytes; if (!mBluetoothEnabled || mClosing || mSuspended) { - LOGV("A2dpAudioStreamOut::write(), but bluetooth disabled \ + ALOGV("A2dpAudioStreamOut::write(), but bluetooth disabled \ mBluetoothEnabled %d, mClosing %d, mSuspended %d", mBluetoothEnabled, mClosing, mSuspended); goto Error; @@ -316,7 +316,7 @@ ssize_t A2dpAudioInterface::A2dpAudioStreamOut::write(const void* buffer, size_t // NOTE: It is likely that the A2DP headset is being disconnected nsecs_t now = systemTime(); if ((uint32_t)ns2us(now - mLastWriteTime) < (mBufferDurationUs >> 2)) { - LOGV("A2DP sink runs too fast"); + ALOGV("A2DP sink runs too fast"); usleep(mBufferDurationUs - (uint32_t)ns2us(now - mLastWriteTime)); } mLastWriteTime = now; @@ -359,7 +359,7 @@ status_t A2dpAudioInterface::A2dpAudioStreamOut::standby_l() int result = NO_ERROR; if (!mStandby) { - LOGV_IF(mClosing || !mBluetoothEnabled, "Standby skip stop: closing %d enabled %d", + ALOGV_IF(mClosing || !mBluetoothEnabled, "Standby skip stop: closing %d enabled %d", mClosing, mBluetoothEnabled); if (!mClosing && mBluetoothEnabled) { result = a2dp_stop(mData); @@ -378,7 +378,7 @@ status_t A2dpAudioInterface::A2dpAudioStreamOut::setParameters(const String8& ke String8 key = String8("a2dp_sink_address"); status_t status = NO_ERROR; int device; - LOGV("A2dpAudioStreamOut::setParameters() %s", keyValuePairs.string()); + ALOGV("A2dpAudioStreamOut::setParameters() %s", keyValuePairs.string()); if (param.get(key, value) == NO_ERROR) { if (value.length() != strlen("00:00:00:00:00:00")) { @@ -428,7 +428,7 @@ String8 A2dpAudioInterface::A2dpAudioStreamOut::getParameters(const String8& key param.addInt(key, (int)mDevice); } - LOGV("A2dpAudioStreamOut::getParameters() %s", param.toString().string()); + ALOGV("A2dpAudioStreamOut::getParameters() %s", param.toString().string()); return param.toString(); } @@ -461,7 +461,7 @@ status_t A2dpAudioInterface::A2dpAudioStreamOut::setBluetoothEnabled(bool enable status_t A2dpAudioInterface::A2dpAudioStreamOut::setSuspended(bool onOff) { - LOGV("setSuspended %d", onOff); + ALOGV("setSuspended %d", onOff); mSuspended = onOff; standby(); return NO_ERROR; @@ -470,7 +470,7 @@ status_t A2dpAudioInterface::A2dpAudioStreamOut::setSuspended(bool onOff) status_t A2dpAudioInterface::A2dpAudioStreamOut::close() { Mutex::Autolock lock(mLock); - LOGV("A2dpAudioStreamOut::close() calling close_l()"); + ALOGV("A2dpAudioStreamOut::close() calling close_l()"); return close_l(); } @@ -478,7 +478,7 @@ status_t A2dpAudioInterface::A2dpAudioStreamOut::close_l() { standby_l(); if (mData) { - LOGV("A2dpAudioStreamOut::close_l() calling a2dp_cleanup(mData)"); + ALOGV("A2dpAudioStreamOut::close_l() calling a2dp_cleanup(mData)"); a2dp_cleanup(mData); mData = NULL; } diff --git a/audio/AudioDumpInterface.cpp b/audio/AudioDumpInterface.cpp index 6c11114..5b26999 100644 --- a/audio/AudioDumpInterface.cpp +++ b/audio/AudioDumpInterface.cpp @@ -38,7 +38,7 @@ AudioDumpInterface::AudioDumpInterface(AudioHardwareInterface* hw) LOGE("Dump construct hw = 0"); } mFinalInterface = hw; - LOGV("Constructor %p, mFinalInterface %p", this, mFinalInterface); + ALOGV("Constructor %p, mFinalInterface %p", this, mFinalInterface); } @@ -94,7 +94,7 @@ AudioStreamOut* AudioDumpInterface::openOutputStream( } if (status) *status = NO_ERROR; } - LOGV("openOutputStream(), outFinal %p", outFinal); + ALOGV("openOutputStream(), outFinal %p", outFinal); AudioStreamOutDump *dumOutput = new AudioStreamOutDump(this, mOutputs.size(), outFinal, devices, lFormat, lChannels, lRate); @@ -112,7 +112,7 @@ void AudioDumpInterface::closeOutputStream(AudioStreamOut* out) return; } - LOGV("closeOutputStream() output %p", out); + ALOGV("closeOutputStream() output %p", out); dumpOut->standby(); if (dumpOut->finalStream() != NULL) { @@ -160,7 +160,7 @@ AudioStreamIn* AudioDumpInterface::openInputStream(uint32_t devices, int *format } if (status) *status = NO_ERROR; } - LOGV("openInputStream(), inFinal %p", inFinal); + ALOGV("openInputStream(), inFinal %p", inFinal); AudioStreamInDump *dumInput = new AudioStreamInDump(this, mInputs.size(), inFinal, devices, lFormat, lChannels, lRate); @@ -191,7 +191,7 @@ status_t AudioDumpInterface::setParameters(const String8& keyValuePairs) AudioParameter param = AudioParameter(keyValuePairs); String8 value; int valueInt; - LOGV("setParameters %s", keyValuePairs.string()); + ALOGV("setParameters %s", keyValuePairs.string()); if (param.get(String8("test_cmd_file_name"), value) == NO_ERROR) { mFileName = value; @@ -201,7 +201,7 @@ status_t AudioDumpInterface::setParameters(const String8& keyValuePairs) Mutex::Autolock _l(mLock); param.remove(String8("test_cmd_policy")); mPolicyCommands = param.toString(); - LOGV("test_cmd_policy command %s written", mPolicyCommands.string()); + ALOGV("test_cmd_policy command %s written", mPolicyCommands.string()); return NO_ERROR; } @@ -215,7 +215,7 @@ String8 AudioDumpInterface::getParameters(const String8& keys) AudioParameter response; String8 value; -// LOGV("getParameters %s", keys.string()); +// ALOGV("getParameters %s", keys.string()); if (param.get(String8("test_cmd_policy"), value) == NO_ERROR) { Mutex::Autolock _l(mLock); if (mPolicyCommands.length() != 0) { @@ -225,7 +225,7 @@ String8 AudioDumpInterface::getParameters(const String8& keys) response.addInt(String8("test_cmd_policy"), 0); } param.remove(String8("test_cmd_policy")); -// LOGV("test_cmd_policy command %s read", mPolicyCommands.string()); +// ALOGV("test_cmd_policy command %s read", mPolicyCommands.string()); } if (param.get(String8("test_cmd_file_name"), value) == NO_ERROR) { @@ -266,13 +266,13 @@ AudioStreamOutDump::AudioStreamOutDump(AudioDumpInterface *interface, mSampleRate(sampleRate), mFormat(format), mChannels(channels), mLatency(0), mDevice(devices), mBufferSize(1024), mFinalStream(finalStream), mFile(0), mFileCount(0) { - LOGV("AudioStreamOutDump Constructor %p, mInterface %p, mFinalStream %p", this, mInterface, mFinalStream); + ALOGV("AudioStreamOutDump Constructor %p, mInterface %p, mFinalStream %p", this, mInterface, mFinalStream); } AudioStreamOutDump::~AudioStreamOutDump() { - LOGV("AudioStreamOutDump destructor"); + ALOGV("AudioStreamOutDump destructor"); Close(); } @@ -291,7 +291,7 @@ ssize_t AudioStreamOutDump::write(const void* buffer, size_t bytes) char name[255]; sprintf(name, "%s_out_%d_%d.pcm", mInterface->fileName().string(), mId, ++mFileCount); mFile = fopen(name, "wb"); - LOGV("Opening dump file %s, fh %p", name, mFile); + ALOGV("Opening dump file %s, fh %p", name, mFile); } } if (mFile) { @@ -302,7 +302,7 @@ ssize_t AudioStreamOutDump::write(const void* buffer, size_t bytes) status_t AudioStreamOutDump::standby() { - LOGV("AudioStreamOutDump standby(), mFile %p, mFinalStream %p", mFile, mFinalStream); + ALOGV("AudioStreamOutDump standby(), mFile %p, mFinalStream %p", mFile, mFinalStream); Close(); if (mFinalStream != 0 ) return mFinalStream->standby(); @@ -343,7 +343,7 @@ status_t AudioStreamOutDump::setVolume(float left, float right) } status_t AudioStreamOutDump::setParameters(const String8& keyValuePairs) { - LOGV("AudioStreamOutDump::setParameters %s", keyValuePairs.string()); + ALOGV("AudioStreamOutDump::setParameters %s", keyValuePairs.string()); if (mFinalStream != 0 ) { return mFinalStream->setParameters(keyValuePairs); @@ -427,7 +427,7 @@ AudioStreamInDump::AudioStreamInDump(AudioDumpInterface *interface, mSampleRate(sampleRate), mFormat(format), mChannels(channels), mDevice(devices), mBufferSize(1024), mFinalStream(finalStream), mFile(0), mFileCount(0) { - LOGV("AudioStreamInDump Constructor %p, mInterface %p, mFinalStream %p", this, mInterface, mFinalStream); + ALOGV("AudioStreamInDump Constructor %p, mInterface %p, mFinalStream %p", this, mInterface, mFinalStream); } @@ -447,7 +447,7 @@ ssize_t AudioStreamInDump::read(void* buffer, ssize_t bytes) char name[255]; sprintf(name, "%s_in_%d_%d.pcm", mInterface->fileName().string(), mId, ++mFileCount); mFile = fopen(name, "wb"); - LOGV("Opening input dump file %s, fh %p", name, mFile); + ALOGV("Opening input dump file %s, fh %p", name, mFile); } } if (mFile) { @@ -480,7 +480,7 @@ ssize_t AudioStreamInDump::read(void* buffer, ssize_t bytes) } strcat(name, ".wav"); mFile = fopen(name, "rb"); - LOGV("Opening input read file %s, fh %p", name, mFile); + ALOGV("Opening input read file %s, fh %p", name, mFile); if (mFile) { fseek(mFile, AUDIO_DUMP_WAVE_HDR_SIZE, SEEK_SET); } @@ -499,7 +499,7 @@ ssize_t AudioStreamInDump::read(void* buffer, ssize_t bytes) status_t AudioStreamInDump::standby() { - LOGV("AudioStreamInDump standby(), mFile %p, mFinalStream %p", mFile, mFinalStream); + ALOGV("AudioStreamInDump standby(), mFile %p, mFinalStream %p", mFile, mFinalStream); Close(); if (mFinalStream != 0 ) return mFinalStream->standby(); @@ -538,7 +538,7 @@ int AudioStreamInDump::format() const status_t AudioStreamInDump::setParameters(const String8& keyValuePairs) { - LOGV("AudioStreamInDump::setParameters()"); + ALOGV("AudioStreamInDump::setParameters()"); if (mFinalStream != 0 ) return mFinalStream->setParameters(keyValuePairs); return NO_ERROR; } diff --git a/audio/AudioHardwareGeneric.cpp b/audio/AudioHardwareGeneric.cpp index 61286e4..824b36b 100644 --- a/audio/AudioHardwareGeneric.cpp +++ b/audio/AudioHardwareGeneric.cpp @@ -273,7 +273,7 @@ status_t AudioStreamOutGeneric::setParameters(const String8& keyValuePairs) String8 key = String8(AudioParameter::keyRouting); status_t status = NO_ERROR; int device; - LOGV("setParameters() %s", keyValuePairs.string()); + ALOGV("setParameters() %s", keyValuePairs.string()); if (param.getInt(key, device) == NO_ERROR) { mDevice = device; @@ -296,7 +296,7 @@ String8 AudioStreamOutGeneric::getParameters(const String8& keys) param.addInt(key, (int)mDevice); } - LOGV("getParameters() %s", param.toString().string()); + ALOGV("getParameters() %s", param.toString().string()); return param.toString(); } @@ -318,7 +318,7 @@ status_t AudioStreamInGeneric::set( AudioSystem::audio_in_acoustics acoustics) { if (pFormat == 0 || pChannels == 0 || pRate == 0) return BAD_VALUE; - LOGV("AudioStreamInGeneric::set(%p, %d, %d, %d, %u)", hw, fd, *pFormat, *pChannels, *pRate); + ALOGV("AudioStreamInGeneric::set(%p, %d, %d, %d, %u)", hw, fd, *pFormat, *pChannels, *pRate); // check values if ((*pFormat != format()) || (*pChannels != channels()) || @@ -381,7 +381,7 @@ status_t AudioStreamInGeneric::setParameters(const String8& keyValuePairs) String8 key = String8(AudioParameter::keyRouting); status_t status = NO_ERROR; int device; - LOGV("setParameters() %s", keyValuePairs.string()); + ALOGV("setParameters() %s", keyValuePairs.string()); if (param.getInt(key, device) == NO_ERROR) { mDevice = device; @@ -404,7 +404,7 @@ String8 AudioStreamInGeneric::getParameters(const String8& keys) param.addInt(key, (int)mDevice); } - LOGV("getParameters() %s", param.toString().string()); + ALOGV("getParameters() %s", param.toString().string()); return param.toString(); } diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp index e299db8..b0c3006 100644 --- a/audio/AudioPolicyManagerBase.cpp +++ b/audio/AudioPolicyManagerBase.cpp @@ -33,7 +33,7 @@ status_t AudioPolicyManagerBase::setDeviceConnectionState(AudioSystem::audio_dev const char *device_address) { - LOGV("setDeviceConnectionState() device: %x, state %d, address %s", device, state, device_address); + ALOGV("setDeviceConnectionState() device: %x, state %d, address %s", device, state, device_address); // connect/disconnect only 1 device at a time if (AudioSystem::popCount(device) != 1) return BAD_VALUE; @@ -61,7 +61,7 @@ status_t AudioPolicyManagerBase::setDeviceConnectionState(AudioSystem::audio_dev LOGW("setDeviceConnectionState() device already connected: %x", device); return INVALID_OPERATION; } - LOGV("setDeviceConnectionState() connecting device %x", device); + ALOGV("setDeviceConnectionState() connecting device %x", device); // register new device as available mAvailableOutputDevices |= device; @@ -78,7 +78,7 @@ status_t AudioPolicyManagerBase::setDeviceConnectionState(AudioSystem::audio_dev #endif { if (AudioSystem::isBluetoothScoDevice(device)) { - LOGV("setDeviceConnectionState() BT SCO device, address %s", device_address); + ALOGV("setDeviceConnectionState() BT SCO device, address %s", device_address); // keep track of SCO device address mScoDeviceAddress = String8(device_address, MAX_DEVICE_ADDRESS_LEN); } @@ -92,7 +92,7 @@ status_t AudioPolicyManagerBase::setDeviceConnectionState(AudioSystem::audio_dev } - LOGV("setDeviceConnectionState() disconnecting device %x", device); + ALOGV("setDeviceConnectionState() disconnecting device %x", device); // remove device from available output devices mAvailableOutputDevices &= ~device; @@ -175,7 +175,7 @@ status_t AudioPolicyManagerBase::setDeviceConnectionState(AudioSystem::audio_dev AudioInputDescriptor *inputDesc = mInputs.valueFor(activeInput); uint32_t newDevice = getDeviceForInputSource(inputDesc->mInputSource); if (newDevice != inputDesc->mDevice) { - LOGV("setDeviceConnectionState() changing device from %x to %x for input %d", + ALOGV("setDeviceConnectionState() changing device from %x to %x for input %d", inputDesc->mDevice, newDevice, activeInput); inputDesc->mDevice = newDevice; AudioParameter param = AudioParameter(); @@ -221,7 +221,7 @@ AudioSystem::device_connection_state AudioPolicyManagerBase::getDeviceConnection void AudioPolicyManagerBase::setPhoneState(int state) { - LOGV("setPhoneState() state %d", state); + ALOGV("setPhoneState() state %d", state); uint32_t newDevice = 0; if (state < 0 || state >= AudioSystem::NUM_MODES) { LOGW("setPhoneState() invalid state %d", state); @@ -236,7 +236,7 @@ void AudioPolicyManagerBase::setPhoneState(int state) // if leaving call state, handle special case of active streams // pertaining to sonification strategy see handleIncallSonification() if (isInCall()) { - LOGV("setPhoneState() in call state management: new state is %d", state); + ALOGV("setPhoneState() in call state management: new state is %d", state); for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) { handleIncallSonification(stream, false, true); } @@ -249,17 +249,17 @@ void AudioPolicyManagerBase::setPhoneState(int state) // are we entering or starting a call if (!isStateInCall(oldState) && isStateInCall(state)) { - LOGV(" Entering call in setPhoneState()"); + ALOGV(" Entering call in setPhoneState()"); // force routing command to audio hardware when starting a call // even if no device change is needed force = true; } else if (isStateInCall(oldState) && !isStateInCall(state)) { - LOGV(" Exiting call in setPhoneState()"); + ALOGV(" Exiting call in setPhoneState()"); // force routing command to audio hardware when exiting a call // even if no device change is needed force = true; } else if (isStateInCall(state) && (state != oldState)) { - LOGV(" Switching between telephony and VoIP in setPhoneState()"); + ALOGV(" Switching between telephony and VoIP in setPhoneState()"); // force routing command to audio hardware when switching between telephony and VoIP // even if no device change is needed force = true; @@ -299,7 +299,7 @@ void AudioPolicyManagerBase::setPhoneState(int state) // if entering in call state, handle special case of active streams // pertaining to sonification strategy see handleIncallSonification() if (isStateInCall(state)) { - LOGV("setPhoneState() in call state management: new state is %d", state); + ALOGV("setPhoneState() in call state management: new state is %d", state); // unmute the ringing tone after a sufficient delay if it was muted before // setting output device above if (oldState == AudioSystem::MODE_RINGTONE) { @@ -321,14 +321,14 @@ void AudioPolicyManagerBase::setPhoneState(int state) void AudioPolicyManagerBase::setRingerMode(uint32_t mode, uint32_t mask) { - LOGV("setRingerMode() mode %x, mask %x", mode, mask); + ALOGV("setRingerMode() mode %x, mask %x", mode, mask); mRingerMode = mode; } void AudioPolicyManagerBase::setForceUse(AudioSystem::force_use usage, AudioSystem::forced_config config) { - LOGV("setForceUse() usage %d, config %d, mPhoneState %d", usage, config, mPhoneState); + ALOGV("setForceUse() usage %d, config %d, mPhoneState %d", usage, config, mPhoneState); bool forceVolumeReeval = false; switch(usage) { @@ -392,7 +392,7 @@ void AudioPolicyManagerBase::setForceUse(AudioSystem::force_use usage, AudioSyst AudioInputDescriptor *inputDesc = mInputs.valueFor(activeInput); newDevice = getDeviceForInputSource(inputDesc->mInputSource); if (newDevice != inputDesc->mDevice) { - LOGV("setForceUse() changing device from %x to %x for input %d", + ALOGV("setForceUse() changing device from %x to %x for input %d", inputDesc->mDevice, newDevice, activeInput); inputDesc->mDevice = newDevice; AudioParameter param = AudioParameter(); @@ -410,13 +410,13 @@ AudioSystem::forced_config AudioPolicyManagerBase::getForceUse(AudioSystem::forc void AudioPolicyManagerBase::setSystemProperty(const char* property, const char* value) { - LOGV("setSystemProperty() property %s, value %s", property, value); + ALOGV("setSystemProperty() property %s, value %s", property, value); if (strcmp(property, "ro.camera.sound.forced") == 0) { if (atoi(value)) { - LOGV("ENFORCED_AUDIBLE cannot be muted"); + ALOGV("ENFORCED_AUDIBLE cannot be muted"); mStreams[AudioSystem::ENFORCED_AUDIBLE].mCanBeMuted = false; } else { - LOGV("ENFORCED_AUDIBLE can be muted"); + ALOGV("ENFORCED_AUDIBLE can be muted"); mStreams[AudioSystem::ENFORCED_AUDIBLE].mCanBeMuted = true; } } @@ -432,15 +432,15 @@ audio_io_handle_t AudioPolicyManagerBase::getOutput(AudioSystem::stream_type str uint32_t latency = 0; routing_strategy strategy = getStrategy((AudioSystem::stream_type)stream); uint32_t device = getDeviceForStrategy(strategy); - LOGV("getOutput() stream %d, samplingRate %d, format %d, channels %x, flags %x", stream, samplingRate, format, channels, flags); + ALOGV("getOutput() stream %d, samplingRate %d, format %d, channels %x, flags %x", stream, samplingRate, format, channels, flags); #ifdef AUDIO_POLICY_TEST if (mCurOutput != 0) { - LOGV("getOutput() test output mCurOutput %d, samplingRate %d, format %d, channels %x, mDirectOutput %d", + ALOGV("getOutput() test output mCurOutput %d, samplingRate %d, format %d, channels %x, mDirectOutput %d", mCurOutput, mTestSamplingRate, mTestFormat, mTestChannels, mDirectOutput); if (mTestOutputs[mCurOutput] == 0) { - LOGV("getOutput() opening test output"); + ALOGV("getOutput() opening test output"); AudioOutputDescriptor *outputDesc = new AudioOutputDescriptor(); outputDesc->mDevice = mTestDevice; outputDesc->mSamplingRate = mTestSamplingRate; @@ -469,7 +469,7 @@ audio_io_handle_t AudioPolicyManagerBase::getOutput(AudioSystem::stream_type str // open a direct output if required by specified parameters if (needsDirectOuput(stream, samplingRate, format, channels, flags, device)) { - LOGV("getOutput() opening direct output device %x", device); + ALOGV("getOutput() opening direct output device %x", device); AudioOutputDescriptor *outputDesc = new AudioOutputDescriptor(); outputDesc->mDevice = device; outputDesc->mSamplingRate = samplingRate; @@ -491,7 +491,7 @@ audio_io_handle_t AudioPolicyManagerBase::getOutput(AudioSystem::stream_type str (samplingRate != 0 && samplingRate != outputDesc->mSamplingRate) || (format != 0 && format != outputDesc->mFormat) || (channels != 0 && channels != outputDesc->mChannels)) { - LOGV("getOutput() failed opening direct output: samplingRate %d, format %d, channels %d", + ALOGV("getOutput() failed opening direct output: samplingRate %d, format %d, channels %d", samplingRate, format, channels); if (output != 0) { mpClientInterface->closeOutput(output); @@ -516,7 +516,7 @@ audio_io_handle_t AudioPolicyManagerBase::getOutput(AudioSystem::stream_type str #ifdef WITH_A2DP if (a2dpUsedForSonification() && a2dpDevice != 0) { // if playing on 2 devices among which one is A2DP, use duplicated output - LOGV("getOutput() using duplicated output"); + ALOGV("getOutput() using duplicated output"); LOGW_IF((mA2dpOutput == 0), "getOutput() A2DP device in multiple %x selected but A2DP output not opened", device); output = mDuplicatedOutput; } else @@ -525,7 +525,7 @@ audio_io_handle_t AudioPolicyManagerBase::getOutput(AudioSystem::stream_type str // if playing on 2 devices among which none is A2DP, use hardware output output = mHardwareOutput; } - LOGV("getOutput() using output %d for 2 devices %x", output, device); + ALOGV("getOutput() using output %d for 2 devices %x", output, device); } else { #ifdef WITH_A2DP if (a2dpDevice != 0) { @@ -551,7 +551,7 @@ status_t AudioPolicyManagerBase::startOutput(audio_io_handle_t output, AudioSystem::stream_type stream, int session) { - LOGV("startOutput() output %d, stream %d, session %d", output, stream, session); + ALOGV("startOutput() output %d, stream %d, session %d", output, stream, session); ssize_t index = mOutputs.indexOfKey(output); if (index < 0) { LOGW("startOutput() unknow output %d", output); @@ -589,7 +589,7 @@ status_t AudioPolicyManagerBase::stopOutput(audio_io_handle_t output, AudioSystem::stream_type stream, int session) { - LOGV("stopOutput() output %d, stream %d, session %d", output, stream, session); + ALOGV("stopOutput() output %d, stream %d, session %d", output, stream, session); ssize_t index = mOutputs.indexOfKey(output); if (index < 0) { LOGW("stopOutput() unknow output %d", output); @@ -633,7 +633,7 @@ status_t AudioPolicyManagerBase::stopOutput(audio_io_handle_t output, void AudioPolicyManagerBase::releaseOutput(audio_io_handle_t output) { - LOGV("releaseOutput() %d", output); + ALOGV("releaseOutput() %d", output); ssize_t index = mOutputs.indexOfKey(output); if (index < 0) { LOGW("releaseOutput() releasing unknown output %d", output); @@ -670,7 +670,7 @@ audio_io_handle_t AudioPolicyManagerBase::getInput(int inputSource, audio_io_handle_t input = 0; uint32_t device = getDeviceForInputSource(inputSource); - LOGV("getInput() inputSource %d, samplingRate %d, format %d, channels %x, acoustics %x", inputSource, samplingRate, format, channels, acoustics); + ALOGV("getInput() inputSource %d, samplingRate %d, format %d, channels %x, acoustics %x", inputSource, samplingRate, format, channels, acoustics); if (device == 0) { return 0; @@ -711,7 +711,7 @@ audio_io_handle_t AudioPolicyManagerBase::getInput(int inputSource, (samplingRate != inputDesc->mSamplingRate) || (format != inputDesc->mFormat) || (channels != inputDesc->mChannels)) { - LOGV("getInput() failed opening input: samplingRate %d, format %d, channels %d", + ALOGV("getInput() failed opening input: samplingRate %d, format %d, channels %d", samplingRate, format, channels); if (input != 0) { mpClientInterface->closeInput(input); @@ -725,7 +725,7 @@ audio_io_handle_t AudioPolicyManagerBase::getInput(int inputSource, status_t AudioPolicyManagerBase::startInput(audio_io_handle_t input) { - LOGV("startInput() input %d", input); + ALOGV("startInput() input %d", input); ssize_t index = mInputs.indexOfKey(input); if (index < 0) { LOGW("startInput() unknow input %d", input); @@ -748,7 +748,7 @@ status_t AudioPolicyManagerBase::startInput(audio_io_handle_t input) param.addInt(String8(AudioParameter::keyRouting), (int)inputDesc->mDevice); param.addInt(String8(AudioParameter::keyInputSource), (int)inputDesc->mInputSource); - LOGV("AudioPolicyManager::startInput() input source = %d", inputDesc->mInputSource); + ALOGV("AudioPolicyManager::startInput() input source = %d", inputDesc->mInputSource); mpClientInterface->setParameters(input, param.toString()); @@ -758,7 +758,7 @@ status_t AudioPolicyManagerBase::startInput(audio_io_handle_t input) status_t AudioPolicyManagerBase::stopInput(audio_io_handle_t input) { - LOGV("stopInput() input %d", input); + ALOGV("stopInput() input %d", input); ssize_t index = mInputs.indexOfKey(input); if (index < 0) { LOGW("stopInput() unknow input %d", input); @@ -780,7 +780,7 @@ status_t AudioPolicyManagerBase::stopInput(audio_io_handle_t input) void AudioPolicyManagerBase::releaseInput(audio_io_handle_t input) { - LOGV("releaseInput() %d", input); + ALOGV("releaseInput() %d", input); ssize_t index = mInputs.indexOfKey(input); if (index < 0) { LOGW("releaseInput() releasing unknown input %d", input); @@ -789,14 +789,14 @@ void AudioPolicyManagerBase::releaseInput(audio_io_handle_t input) mpClientInterface->closeInput(input); delete mInputs.valueAt(index); mInputs.removeItem(input); - LOGV("releaseInput() exit"); + ALOGV("releaseInput() exit"); } void AudioPolicyManagerBase::initStreamVolume(AudioSystem::stream_type stream, int indexMin, int indexMax) { - LOGV("initStreamVolume() stream %d, min %d, max %d", stream , indexMin, indexMax); + ALOGV("initStreamVolume() stream %d, min %d, max %d", stream , indexMin, indexMax); if (indexMin < 0 || indexMin >= indexMax) { LOGW("initStreamVolume() invalid index limits for stream %d, min %d, max %d", stream , indexMin, indexMax); return; @@ -815,7 +815,7 @@ status_t AudioPolicyManagerBase::setStreamVolumeIndex(AudioSystem::stream_type s // Force max volume if stream cannot be muted if (!mStreams[stream].mCanBeMuted) index = mStreams[stream].mIndexMax; - LOGV("setStreamVolumeIndex() stream %d, index %d", stream, index); + ALOGV("setStreamVolumeIndex() stream %d, index %d", stream, index); mStreams[stream].mIndexCur = index; // compute and apply stream volume on all outputs according to connected device @@ -834,14 +834,14 @@ status_t AudioPolicyManagerBase::getStreamVolumeIndex(AudioSystem::stream_type s if (index == 0) { return BAD_VALUE; } - LOGV("getStreamVolumeIndex() stream %d", stream); + ALOGV("getStreamVolumeIndex() stream %d", stream); *index = mStreams[stream].mIndexCur; return NO_ERROR; } audio_io_handle_t AudioPolicyManagerBase::getOutputForEffect(effect_descriptor_t *desc) { - LOGV("getOutputForEffect()"); + ALOGV("getOutputForEffect()"); // apply simple rule where global effects are attached to the same output as MUSIC streams return getOutput(AudioSystem::MUSIC); } @@ -867,9 +867,9 @@ status_t AudioPolicyManagerBase::registerEffect(effect_descriptor_t *desc, return INVALID_OPERATION; } mTotalEffectsMemory += desc->memoryUsage; - LOGV("registerEffect() effect %s, io %d, strategy %d session %d id %d", + ALOGV("registerEffect() effect %s, io %d, strategy %d session %d id %d", desc->name, io, strategy, session, id); - LOGV("registerEffect() memory %d, total memory %d", desc->memoryUsage, mTotalEffectsMemory); + ALOGV("registerEffect() memory %d, total memory %d", desc->memoryUsage, mTotalEffectsMemory); EffectDescriptor *pDesc = new EffectDescriptor(); memcpy (&pDesc->mDesc, desc, sizeof(effect_descriptor_t)); @@ -901,7 +901,7 @@ status_t AudioPolicyManagerBase::unregisterEffect(int id) pDesc->mDesc.memoryUsage = mTotalEffectsMemory; } mTotalEffectsMemory -= pDesc->mDesc.memoryUsage; - LOGV("unregisterEffect() effect %s, ID %d, memory %d total memory %d", + ALOGV("unregisterEffect() effect %s, ID %d, memory %d total memory %d", pDesc->mDesc.name, id, pDesc->mDesc.memoryUsage, mTotalEffectsMemory); mEffects.removeItem(id); @@ -924,7 +924,7 @@ status_t AudioPolicyManagerBase::setEffectEnabled(int id, bool enabled) status_t AudioPolicyManagerBase::setEffectEnabled(EffectDescriptor *pDesc, bool enabled) { if (enabled == pDesc->mEnabled) { - LOGV("setEffectEnabled(%s) effect already %s", + ALOGV("setEffectEnabled(%s) effect already %s", enabled?"true":"false", enabled?"enabled":"disabled"); return INVALID_OPERATION; } @@ -936,7 +936,7 @@ status_t AudioPolicyManagerBase::setEffectEnabled(EffectDescriptor *pDesc, bool return INVALID_OPERATION; } mTotalEffectsCpuLoad += pDesc->mDesc.cpuLoad; - LOGV("setEffectEnabled(true) total CPU %d", mTotalEffectsCpuLoad); + ALOGV("setEffectEnabled(true) total CPU %d", mTotalEffectsCpuLoad); } else { if (mTotalEffectsCpuLoad < pDesc->mDesc.cpuLoad) { LOGW("setEffectEnabled(false) CPU load %d too high for total %d", @@ -944,7 +944,7 @@ status_t AudioPolicyManagerBase::setEffectEnabled(EffectDescriptor *pDesc, bool pDesc->mDesc.cpuLoad = mTotalEffectsCpuLoad; } mTotalEffectsCpuLoad -= pDesc->mDesc.cpuLoad; - LOGV("setEffectEnabled(false) total CPU %d", mTotalEffectsCpuLoad); + ALOGV("setEffectEnabled(false) total CPU %d", mTotalEffectsCpuLoad); } pDesc->mEnabled = enabled; return NO_ERROR; @@ -1147,7 +1147,7 @@ status_t AudioPolicyManagerBase::initCheck() #ifdef AUDIO_POLICY_TEST bool AudioPolicyManagerBase::threadLoop() { - LOGV("entering threadLoop()"); + ALOGV("entering threadLoop()"); while (!exitPending()) { String8 command; @@ -1162,7 +1162,7 @@ bool AudioPolicyManagerBase::threadLoop() if (param.getInt(String8("test_cmd_policy"), valueInt) == NO_ERROR && valueInt != 0) { - LOGV("Test command %s received", command.string()); + ALOGV("Test command %s received", command.string()); String8 target; if (param.get(String8("target"), target) != NO_ERROR) { target = "Manager"; @@ -1303,7 +1303,7 @@ status_t AudioPolicyManagerBase::handleA2dpConnection(AudioSystem::audio_devices const char *device_address) { // when an A2DP device is connected, open an A2DP and a duplicated output - LOGV("opening A2DP output for device %s", device_address); + ALOGV("opening A2DP output for device %s", device_address); AudioOutputDescriptor *outputDesc = new AudioOutputDescriptor(); outputDesc->mDevice = device; mA2dpOutput = mpClientInterface->openOutput(&outputDesc->mDevice, @@ -1406,7 +1406,7 @@ status_t AudioPolicyManagerBase::handleA2dpDisconnection(AudioSystem::audio_devi void AudioPolicyManagerBase::closeA2dpOutputs() { - LOGV("setDeviceConnectionState() closing A2DP and duplicated output!"); + ALOGV("setDeviceConnectionState() closing A2DP and duplicated output!"); if (mDuplicatedOutput != 0) { AudioOutputDescriptor *dupOutputDesc = mOutputs.valueFor(mDuplicatedOutput); @@ -1450,10 +1450,10 @@ void AudioPolicyManagerBase::checkOutputForStrategy(routing_strategy strategy) bool dupUsed = a2dpUsedForSonification() && a2dpWasUsed && (AudioSystem::popCount(prevDevice) == 2); dstOutput = mHardwareOutput; if (dupUsed) { - LOGV("checkOutputForStrategy() moving strategy %d from duplicated", strategy); + ALOGV("checkOutputForStrategy() moving strategy %d from duplicated", strategy); srcOutput = mDuplicatedOutput; } else { - LOGV("checkOutputForStrategy() moving strategy %d from a2dp", strategy); + ALOGV("checkOutputForStrategy() moving strategy %d from a2dp", strategy); srcOutput = mA2dpOutput; } } @@ -1461,10 +1461,10 @@ void AudioPolicyManagerBase::checkOutputForStrategy(routing_strategy strategy) bool dupUsed = a2dpUsedForSonification() && a2dpIsUsed && (AudioSystem::popCount(curDevice) == 2); srcOutput = mHardwareOutput; if (dupUsed) { - LOGV("checkOutputForStrategy() moving strategy %d to duplicated", strategy); + ALOGV("checkOutputForStrategy() moving strategy %d to duplicated", strategy); dstOutput = mDuplicatedOutput; } else { - LOGV("checkOutputForStrategy() moving strategy %d to a2dp", strategy); + ALOGV("checkOutputForStrategy() moving strategy %d to a2dp", strategy); dstOutput = mA2dpOutput; } } @@ -1476,7 +1476,7 @@ void AudioPolicyManagerBase::checkOutputForStrategy(routing_strategy strategy) if (desc->mSession != AudioSystem::SESSION_OUTPUT_STAGE && desc->mStrategy == strategy && desc->mIo == srcOutput) { - LOGV("checkOutputForStrategy() moving effect %d to output %d", mEffects.keyAt(i), dstOutput); + ALOGV("checkOutputForStrategy() moving effect %d to output %d", mEffects.keyAt(i), dstOutput); mpClientInterface->moveEffects(desc->mSession, srcOutput, dstOutput); desc->mIo = dstOutput; } @@ -1567,7 +1567,7 @@ uint32_t AudioPolicyManagerBase::getNewDevice(audio_io_handle_t output, bool fro device = getDeviceForStrategy(STRATEGY_DTMF, fromCache); } - LOGV("getNewDevice() selected device %x", device); + ALOGV("getNewDevice() selected device %x", device); return device; } @@ -1619,7 +1619,7 @@ uint32_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy strategy, uint32_t device = 0; if (fromCache) { - LOGV("getDeviceForStrategy() from cache strategy %d, device %x", strategy, mDeviceForStrategy[strategy]); + ALOGV("getDeviceForStrategy() from cache strategy %d, device %x", strategy, mDeviceForStrategy[strategy]); return mDeviceForStrategy[strategy]; } @@ -1757,7 +1757,7 @@ uint32_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy strategy, break; } - LOGV("getDeviceForStrategy() strategy %d, device %x", strategy, device); + ALOGV("getDeviceForStrategy() strategy %d, device %x", strategy, device); return device; } @@ -1770,7 +1770,7 @@ void AudioPolicyManagerBase::updateDeviceForStrategy() void AudioPolicyManagerBase::setOutputDevice(audio_io_handle_t output, uint32_t device, bool force, int delayMs) { - LOGV("setOutputDevice() output %d device %x delayMs %d", output, device, delayMs); + ALOGV("setOutputDevice() output %d device %x delayMs %d", output, device, delayMs); AudioOutputDescriptor *outputDesc = mOutputs.valueFor(output); @@ -1794,7 +1794,7 @@ void AudioPolicyManagerBase::setOutputDevice(audio_io_handle_t output, uint32_t // - the requested device is the same as current device and force is not specified. // Doing this check here allows the caller to call setOutputDevice() without conditions if ((device == 0 || device == prevDevice) && !force) { - LOGV("setOutputDevice() setting same device %x or null device for output %d", device, output); + ALOGV("setOutputDevice() setting same device %x or null device for output %d", device, output); return; } @@ -1856,7 +1856,7 @@ uint32_t AudioPolicyManagerBase::getDeviceForInputSource(int inputSource) device = 0; break; } - LOGV("getDeviceForInputSource()input source %d, device %08x", inputSource, device); + ALOGV("getDeviceForInputSource()input source %d, device %08x", inputSource, device); return device; } @@ -1949,7 +1949,7 @@ float AudioPolicyManagerBase::volIndexToAmpl(uint32_t device, const StreamDescri float amplification = exp( decibels * 0.115129f); // exp( dB * ln(10) / 20 ) - LOGV("VOLUME vol index=[%d %d %d], dB=[%.1f %.1f %.1f] ampl=%.5f", + ALOGV("VOLUME vol index=[%d %d %d], dB=[%.1f %.1f %.1f] ampl=%.5f", curve[segment].mIndex, volIdx, curve[segment+1].mIndex, curve[segment].mDBAttenuation, @@ -2058,7 +2058,7 @@ float AudioPolicyManagerBase::computeVolume(int stream, int index, audio_io_hand float minVol = (musicVol > SONIFICATION_HEADSET_VOLUME_MIN) ? musicVol : SONIFICATION_HEADSET_VOLUME_MIN; if (volume > minVol) { volume = minVol; - LOGV("computeVolume limiting volume to %f musicVol %f", minVol, musicVol); + ALOGV("computeVolume limiting volume to %f musicVol %f", minVol, musicVol); } } } @@ -2071,14 +2071,14 @@ status_t AudioPolicyManagerBase::checkAndSetVolume(int stream, int index, audio_ // do not change actual stream volume if the stream is muted if (mOutputs.valueFor(output)->mMuteCount[stream] != 0) { - LOGV("checkAndSetVolume() stream %d muted count %d", stream, mOutputs.valueFor(output)->mMuteCount[stream]); + ALOGV("checkAndSetVolume() stream %d muted count %d", stream, mOutputs.valueFor(output)->mMuteCount[stream]); return NO_ERROR; } // do not change in call volume if bluetooth is connected and vice versa if ((stream == AudioSystem::VOICE_CALL && mForceUse[AudioSystem::FOR_COMMUNICATION] == AudioSystem::FORCE_BT_SCO) || (stream == AudioSystem::BLUETOOTH_SCO && mForceUse[AudioSystem::FOR_COMMUNICATION] != AudioSystem::FORCE_BT_SCO)) { - LOGV("checkAndSetVolume() cannot set stream %d volume with force use = %d for comm", + ALOGV("checkAndSetVolume() cannot set stream %d volume with force use = %d for comm", stream, mForceUse[AudioSystem::FOR_COMMUNICATION]); return INVALID_OPERATION; } @@ -2090,7 +2090,7 @@ status_t AudioPolicyManagerBase::checkAndSetVolume(int stream, int index, audio_ if (volume != mOutputs.valueFor(output)->mCurVolume[stream] || force) { mOutputs.valueFor(output)->mCurVolume[stream] = volume; - LOGV("setStreamVolume() for output %d stream %d, volume %f, delay %d", output, stream, volume, delayMs); + ALOGV("setStreamVolume() for output %d stream %d, volume %f, delay %d", output, stream, volume, delayMs); if (stream == AudioSystem::VOICE_CALL || stream == AudioSystem::DTMF || stream == AudioSystem::BLUETOOTH_SCO) { @@ -2128,7 +2128,7 @@ status_t AudioPolicyManagerBase::checkAndSetVolume(int stream, int index, audio_ void AudioPolicyManagerBase::applyStreamVolumes(audio_io_handle_t output, uint32_t device, int delayMs, bool force) { - LOGV("applyStreamVolumes() for output %d and device %x", output, device); + ALOGV("applyStreamVolumes() for output %d and device %x", output, device); for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) { checkAndSetVolume(stream, mStreams[stream].mIndexCur, output, device, delayMs, force); @@ -2137,7 +2137,7 @@ void AudioPolicyManagerBase::applyStreamVolumes(audio_io_handle_t output, uint32 void AudioPolicyManagerBase::setStrategyMute(routing_strategy strategy, bool on, audio_io_handle_t output, int delayMs) { - LOGV("setStrategyMute() strategy %d, mute %d, output %d", strategy, on, output); + ALOGV("setStrategyMute() strategy %d, mute %d, output %d", strategy, on, output); for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) { if (getStrategy((AudioSystem::stream_type)stream) == strategy) { setStreamMute(stream, on, output, delayMs); @@ -2150,7 +2150,7 @@ void AudioPolicyManagerBase::setStreamMute(int stream, bool on, audio_io_handle_ StreamDescriptor &streamDesc = mStreams[stream]; AudioOutputDescriptor *outputDesc = mOutputs.valueFor(output); - LOGV("setStreamMute() stream %d, mute %d, output %d, mMuteCount %d", stream, on, output, outputDesc->mMuteCount[stream]); + ALOGV("setStreamMute() stream %d, mute %d, output %d, mMuteCount %d", stream, on, output, outputDesc->mMuteCount[stream]); if (on) { if (outputDesc->mMuteCount[stream] == 0) { @@ -2182,7 +2182,7 @@ void AudioPolicyManagerBase::handleIncallSonification(int stream, bool starting, if (getStrategy((AudioSystem::stream_type)stream) == STRATEGY_SONIFICATION) { AudioOutputDescriptor *outputDesc = mOutputs.valueFor(mHardwareOutput); - LOGV("handleIncallSonification() stream %d starting %d device %x stateChange %d", + ALOGV("handleIncallSonification() stream %d starting %d device %x stateChange %d", stream, starting, outputDesc->mDevice, stateChange); if (outputDesc->mRefCount[stream]) { int muteCount = 1; @@ -2190,14 +2190,14 @@ void AudioPolicyManagerBase::handleIncallSonification(int stream, bool starting, muteCount = outputDesc->mRefCount[stream]; } if (AudioSystem::isLowVisibility((AudioSystem::stream_type)stream)) { - LOGV("handleIncallSonification() low visibility, muteCount %d", muteCount); + ALOGV("handleIncallSonification() low visibility, muteCount %d", muteCount); for (int i = 0; i < muteCount; i++) { setStreamMute(stream, starting, mHardwareOutput); } } else { - LOGV("handleIncallSonification() high visibility"); + ALOGV("handleIncallSonification() high visibility"); if (outputDesc->device() & getDeviceForStrategy(STRATEGY_PHONE)) { - LOGV("handleIncallSonification() high visibility muted, muteCount %d", muteCount); + ALOGV("handleIncallSonification() high visibility muted, muteCount %d", muteCount); for (int i = 0; i < muteCount; i++) { setStreamMute(stream, starting, mHardwareOutput); } @@ -2282,7 +2282,7 @@ void AudioPolicyManagerBase::AudioOutputDescriptor::changeRefCount(AudioSystem:: return; } mRefCount[stream] += delta; - LOGV("changeRefCount() stream %d, count %d", stream, mRefCount[stream]); + ALOGV("changeRefCount() stream %d, count %d", stream, mRefCount[stream]); } uint32_t AudioPolicyManagerBase::AudioOutputDescriptor::refCount() diff --git a/audio/audio_policy_hal.cpp b/audio/audio_policy_hal.cpp index d5f2816..aa70037 100644 --- a/audio/audio_policy_hal.cpp +++ b/audio/audio_policy_hal.cpp @@ -142,7 +142,7 @@ static audio_io_handle_t ap_get_output(struct audio_policy *pol, { struct legacy_audio_policy *lap = to_lap(pol); - LOGV("%s: tid %d", __func__, gettid()); + ALOGV("%s: tid %d", __func__, gettid()); return lap->apm->getOutput((AudioSystem::stream_type)stream, sampling_rate, format, channels, (AudioSystem::output_flags)flags); diff --git a/wifi/wifi.c b/wifi/wifi.c index 37cbb1e..fc8f54e 100644 --- a/wifi/wifi.c +++ b/wifi/wifi.c @@ -630,7 +630,7 @@ int wifi_send_command(struct wpa_ctrl *ctrl, const char *cmd, char *reply, size_ int ret; if (ctrl_conn == NULL) { - LOGV("Not connected to wpa_supplicant - \"%s\" command dropped.\n", cmd); + ALOGV("Not connected to wpa_supplicant - \"%s\" command dropped.\n", cmd); return -1; } ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), reply, reply_len, NULL); -- cgit v1.1