aboutsummaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
Diffstat (limited to 'audio')
-rwxr-xr-xaudio/audio_hw.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 9bd054a..c58a91b 100755
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -492,6 +492,7 @@ static void set_incall_device(struct espresso_audio_device *adev)
device_type = SOUND_AUDIO_PATH_HANDSET;
break;
case AUDIO_DEVICE_OUT_SPEAKER:
+ case AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET:
case AUDIO_DEVICE_OUT_AUX_DIGITAL:
case AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET:
device_type = SOUND_AUDIO_PATH_SPEAKER;
@@ -628,9 +629,18 @@ static void select_output_device(struct espresso_audio_device *adev)
case AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET:
ALOGD("%s: AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET", __func__);
break;
+ case AUDIO_DEVICE_OUT_AUX_DIGITAL:
+ ALOGD("%s: AUDIO_DEVICE_OUT_AUX_DIGITAL", __func__);
+ break;
case AUDIO_DEVICE_OUT_ALL_SCO:
ALOGD("%s: AUDIO_DEVICE_OUT_ALL_SCO", __func__);
break;
+ case AUDIO_DEVICE_OUT_USB_ACCESSORY:
+ ALOGD("%s: AUDIO_DEVICE_OUT_USB_ACCESSORY", __func__);
+ break;
+ case AUDIO_DEVICE_OUT_USB_DEVICE:
+ ALOGD("%s: AUDIO_DEVICE_OUT_USB_DEVICE", __func__);
+ break;
default:
ALOGD("%s: AUDIO_DEVICE_OUT_ALL", __func__);
break;
@@ -2424,17 +2434,21 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
struct espresso_stream_out *out;
int ret;
int output_type;
+
*stream_out = NULL;
out = (struct espresso_stream_out *)calloc(1, sizeof(struct espresso_stream_out));
- if (!out)
+ if (!out) {
+ ALOGE("%s: out of memory!", __func__);
return -ENOMEM;
+ }
out->sup_channel_masks[0] = AUDIO_CHANNEL_OUT_STEREO;
out->channel_mask = AUDIO_CHANNEL_OUT_STEREO;
if (ladev->outputs[OUTPUT_DEEP_BUF] != NULL) {
ret = -ENOSYS;
+ ALOGW("%s: output not available!", __func__);
goto err_open;
}
output_type = OUTPUT_DEEP_BUF;
@@ -2450,8 +2464,10 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
RESAMPLER_QUALITY_DEFAULT,
NULL,
&out->resampler);
- if (ret != 0)
+ if (ret != 0) {
+ ALOGE("%s: error on resampler create!", __func__);
goto err_open;
+ }
out->stream.common.set_sample_rate = out_set_sample_rate;
out->stream.common.get_channels = out_get_channels;
@@ -2486,6 +2502,7 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
return 0;
err_open:
+ ALOGE("%s: error opening output stream", __func__);
free(out);
return ret;
}
@@ -2781,6 +2798,7 @@ static const struct {
{ AUDIO_DEVICE_OUT_WIRED_HEADSET | AUDIO_DEVICE_OUT_WIRED_HEADPHONE, "headphone" },
{ AUDIO_DEVICE_OUT_EARPIECE, "earpiece" },
{ AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET, "analog-dock" },
+ { AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET, "analog-dock" },
{ AUDIO_DEVICE_OUT_ALL_SCO, "sco-out" },
{ AUDIO_DEVICE_IN_BUILTIN_MIC, "builtin-mic" },
@@ -2990,7 +3008,7 @@ static int adev_open(const hw_module_t* module, const char* name,
hw_device_t** device)
{
struct espresso_audio_device *adev;
- int ret;
+ int i, ret;
if (strcmp(name, AUDIO_HARDWARE_INTERFACE) != 0)
return -EINVAL;
@@ -3037,6 +3055,10 @@ static int adev_open(const hw_module_t* module, const char* name,
adev->in_device = AUDIO_DEVICE_IN_BUILTIN_MIC & ~AUDIO_DEVICE_BIT_IN;
select_devices(adev);
+ for (i = 0; i < OUTPUT_TOTAL; i++) {
+ adev->outputs[i] = NULL;
+ }
+
adev->pcm_modem_dl = NULL;
adev->pcm_modem_ul = NULL;
adev->pcm_bt_dl = NULL;