Merge "hal: improve logging."

This commit is contained in:
Linux Build Service Account 2014-05-08 17:37:02 -07:00 committed by Gerrit - the friendly Code Review server
commit e1be46f950
2 changed files with 36 additions and 22 deletions

View File

@ -741,6 +741,8 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
out_snd_device,
in_snd_device);
ALOGD("%s: done",__func__);
return status;
}
@ -785,7 +787,8 @@ int start_input_stream(struct stream_in *in)
struct audio_device *adev = in->dev;
in->usecase = platform_update_usecase_from_source(in->source,in->usecase);
ALOGV("%s: enter: usecase(%d)", __func__, in->usecase);
ALOGD("%s: enter: stream(%p)usecase(%d: %s)",
__func__, &in->stream, in->usecase, use_case_table[in->usecase]);
/* Check if source matches incall recording usecase criteria */
ret = voice_check_and_set_incall_rec_usecase(adev, in);
@ -1163,8 +1166,9 @@ int start_output_stream(struct stream_out *out)
struct audio_usecase *uc_info;
struct audio_device *adev = out->dev;
ALOGD("%s: enter: usecase(%d: %s) devices(%#x)",
__func__, out->usecase, use_case_table[out->usecase], out->devices);
ALOGD("%s: enter: stream(%p)usecase(%d: %s) devices(%#x)",
__func__, &out->stream, out->usecase, use_case_table[out->usecase],
out->devices);
out->pcm_device_id = platform_get_pcm_device_id(out->usecase, PCM_PLAYBACK);
if (out->pcm_device_id < 0) {
ALOGE("%s: Invalid PCM device id(%d) for the usecase(%d)",
@ -1352,13 +1356,13 @@ static int out_standby(struct audio_stream *stream)
struct stream_out *out = (struct stream_out *)stream;
struct audio_device *adev = out->dev;
ALOGV("%s: enter: usecase(%d: %s)", __func__,
out->usecase, use_case_table[out->usecase]);
ALOGD("%s: enter: stream (%p) usecase(%d: %s)", __func__,
stream, out->usecase, use_case_table[out->usecase]);
if (out->usecase == USECASE_COMPRESS_VOIP_CALL) {
/* Ignore standby in case of voip call because the voip output
* stream is closed in adev_close_output_stream()
*/
ALOGV("%s: Ignore Standby in VOIP call", __func__);
ALOGD("%s: Ignore Standby in VOIP call", __func__);
return 0;
}
@ -1909,7 +1913,9 @@ static int in_standby(struct audio_stream *stream)
struct stream_in *in = (struct stream_in *)stream;
struct audio_device *adev = in->dev;
int status = 0;
ALOGV("%s: enter", __func__);
ALOGD("%s: enter: stream (%p) usecase(%d: %s)", __func__,
stream, in->usecase, use_case_table[in->usecase]);
if (in->usecase == USECASE_COMPRESS_VOIP_CALL) {
/* Ignore standby in case of voip call because the voip input
@ -1949,7 +1955,7 @@ static int in_set_parameters(struct audio_stream *stream, const char *kvpairs)
char value[32];
int ret = 0, val = 0, err;
ALOGV("%s: enter: kvpairs=%s", __func__, kvpairs);
ALOGD("%s: enter: kvpairs=%s", __func__, kvpairs);
parms = str_parms_create_str(kvpairs);
pthread_mutex_lock(&in->lock);
@ -2132,11 +2138,14 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
struct stream_out *out;
int i, ret = 0;
ALOGV("%s: enter: sample_rate(%d) channel_mask(%#x) devices(%#x) flags(%#x)",
__func__, config->sample_rate, config->channel_mask, devices, flags);
*stream_out = NULL;
out = (struct stream_out *)calloc(1, sizeof(struct stream_out));
ALOGD("%s: enter: sample_rate(%d) channel_mask(%#x) devices(%#x) flags(%#x)\
stream_handle(%p)",__func__, config->sample_rate, config->channel_mask,
devices, flags, &out->stream);
if (!out) {
return -ENOMEM;
}
@ -2193,9 +2202,6 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
goto error_open;
}
} else if (out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) {
ALOGD("%s: copl(%x): sample_rate(%d) channel_mask(%#x) devices(%#x) flags(%#x)",
__func__, (unsigned int)out, config->sample_rate, config->channel_mask, devices, flags);
if (config->offload_info.version != AUDIO_INFO_INITIALIZER.version ||
config->offload_info.size != AUDIO_INFO_INITIALIZER.size) {
ALOGE("%s: Unsupported Offload information", __func__);
@ -2340,6 +2346,8 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
config->sample_rate = out->stream.common.get_sample_rate(&out->stream.common);
*stream_out = &out->stream;
ALOGD("%s: Stream (%p) picks up usecase (%s)", __func__, &out->stream,
use_case_table[out->usecase]);
ALOGV("%s: exit", __func__);
return 0;
@ -2357,7 +2365,8 @@ static void adev_close_output_stream(struct audio_hw_device *dev,
struct audio_device *adev = out->dev;
int ret = 0;
ALOGV("%s: enter", __func__);
ALOGD("%s: enter:stream_handle(%p)",__func__, out);
if (out->usecase == USECASE_COMPRESS_VOIP_CALL) {
ret = voice_extn_compress_voip_close_output_stream(&stream->common);
if(ret != 0)
@ -2569,12 +2578,15 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
int ret = 0, buffer_size, frame_size;
int channel_count = popcount(config->channel_mask);
ALOGV("%s: enter", __func__);
*stream_in = NULL;
if (check_input_parameters(config->sample_rate, config->format, channel_count) != 0)
return -EINVAL;
in = (struct stream_in *)calloc(1, sizeof(struct stream_in));
ALOGD("%s: enter: sample_rate(%d) channel_mask(%#x) devices(%#x)\
stream_handle(%p)",__func__, config->sample_rate, config->channel_mask,
devices, &in->stream);
pthread_mutex_init(&in->lock, (const pthread_mutexattr_t *) NULL);
@ -2645,7 +2657,7 @@ static void adev_close_input_stream(struct audio_hw_device *dev,
{
int ret;
struct stream_in *in = (struct stream_in *)stream;
ALOGV("%s", __func__);
ALOGD("%s: enter:stream_handle(%p)",__func__, in);
if (in->usecase == USECASE_COMPRESS_VOIP_CALL) {
ret = voice_extn_compress_voip_close_input_stream(&stream->common);

View File

@ -52,7 +52,7 @@ status_t AudioPolicyManager::setDeviceConnectionState(audio_devices_t device,
{
SortedVector <audio_io_handle_t> outputs;
ALOGV("setDeviceConnectionState() device: %x, state %d, address %s", device, state, device_address);
ALOGD("setDeviceConnectionState() device: %x, state %d, address %s", device, state, device_address);
// connect/disconnect only 1 device at a time
if (!audio_is_output_device(device) && !audio_is_input_device(device)) return BAD_VALUE;
@ -303,7 +303,7 @@ status_t AudioPolicyManager::setDeviceConnectionState(audio_devices_t device,
void AudioPolicyManager::setForceUse(AudioSystem::force_use usage, AudioSystem::forced_config config)
{
ALOGV("setForceUse() usage %d, config %d, mPhoneState %d", usage, config, mPhoneState);
ALOGD("setForceUse() usage %d, config %d, mPhoneState %d", usage, config, mPhoneState);
bool forceVolumeReeval = false;
switch(usage) {
@ -400,7 +400,7 @@ audio_io_handle_t AudioPolicyManager::getInput(int inputSource,
audio_io_handle_t input = 0;
audio_devices_t device = getDeviceForInputSource(inputSource);
ALOGV("getInput() inputSource %d, samplingRate %d, format %d, channelMask %x, acoustics %x",
ALOGD("getInput() inputSource %d, samplingRate %d, format %d, channelMask %x, acoustics %x",
inputSource, samplingRate, format, channelMask, acoustics);
if (device == AUDIO_DEVICE_NONE) {
@ -509,6 +509,8 @@ audio_io_handle_t AudioPolicyManager::getInput(int inputSource,
return 0;
}
mInputs.add(input, inputDesc);
ALOGD("getInput() returns input %d", input);
return input;
}
@ -1067,7 +1069,7 @@ audio_io_handle_t AudioPolicyManager::getOutput(AudioSystem::stream_type stream,
}
#endif
ALOGV(" getOutput() device %d, stream %d, samplingRate %d, format %x, channelMask %x, flags %x ",
ALOGD(" getOutput() device %d, stream %d, samplingRate %d, format %x, channelMask %x, flags %x ",
device, stream, samplingRate, format, channelMask, flags);
@ -1158,7 +1160,7 @@ audio_io_handle_t AudioPolicyManager::getOutput(AudioSystem::stream_type stream,
(format == outputDesc->mFormat) &&
(channelMask == outputDesc->mChannelMask)) {
outputDesc->mDirectOpenCount++;
ALOGV("getOutput() reusing direct output %d", mOutputs.keyAt(i));
ALOGD("getOutput() reusing direct output %d", mOutputs.keyAt(i));
return mOutputs.keyAt(i);
}
}
@ -1228,7 +1230,7 @@ get_output__new_output_desc:
ALOGW_IF((output == 0), "getOutput() could not find output for stream %d, samplingRate %d,"
"format %d, channels %x, flags %x", stream, samplingRate, format, channelMask, flags);
ALOGV("getOutput() returns output %d", output);
ALOGD("getOutput() returns output %d", output);
return output;
}