Loading hal/audio_hw.c +15 −6 Original line number Diff line number Diff line Loading @@ -1367,6 +1367,9 @@ int select_devices(struct audio_device *adev, out_snd_device == SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_A2DP) && (!audio_extn_a2dp_is_ready())) { ALOGW("%s: A2DP profile is not ready, routing to speaker only", __func__); if (out_snd_device == SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_A2DP) out_snd_device = SND_DEVICE_OUT_SPEAKER_SAFE; else out_snd_device = SND_DEVICE_OUT_SPEAKER; } Loading Loading @@ -2026,7 +2029,7 @@ int start_output_stream(struct stream_out *out) if (out->devices & AUDIO_DEVICE_OUT_ALL_A2DP) { if (!audio_extn_a2dp_is_ready()) { if (out->devices & AUDIO_DEVICE_OUT_SPEAKER) { if (out->devices & (AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_SPEAKER_SAFE)) { a2dp_combo = true; } else { if (!(out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD)) { Loading Loading @@ -2073,6 +2076,9 @@ int start_output_stream(struct stream_out *out) check_a2dp_restore_l(adev, out, false); } else { audio_devices_t dev = out->devices; if (dev & AUDIO_DEVICE_OUT_SPEAKER_SAFE) out->devices = AUDIO_DEVICE_OUT_SPEAKER_SAFE; else out->devices = AUDIO_DEVICE_OUT_SPEAKER; select_devices(adev, out->usecase); out->devices = dev; Loading Loading @@ -2545,7 +2551,7 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) */ if (val & AUDIO_DEVICE_OUT_ALL_A2DP) { if (!audio_extn_a2dp_is_ready()) { if (val & AUDIO_DEVICE_OUT_SPEAKER) { if (val & (AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_SPEAKER_SAFE)) { //combo usecase just by pass a2dp ALOGW("%s: A2DP profile is not ready,routing to speaker only", __func__); bypass_a2dp = true; Loading Loading @@ -2625,6 +2631,9 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) if (!bypass_a2dp) { select_devices(adev, out->usecase); } else { if (new_dev & AUDIO_DEVICE_OUT_SPEAKER_SAFE) out->devices = AUDIO_DEVICE_OUT_SPEAKER_SAFE; else out->devices = AUDIO_DEVICE_OUT_SPEAKER; select_devices(adev, out->usecase); out->devices = new_dev; Loading Loading @@ -2953,7 +2962,7 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer, if ((out->devices & AUDIO_DEVICE_OUT_ALL_A2DP) && (audio_extn_a2dp_is_suspended())) { if (!(out->devices & AUDIO_DEVICE_OUT_SPEAKER)) { if (!(out->devices & (AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_SPEAKER_SAFE))) { if (!(out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD)) { ret = -EIO; goto exit; Loading Loading
hal/audio_hw.c +15 −6 Original line number Diff line number Diff line Loading @@ -1367,6 +1367,9 @@ int select_devices(struct audio_device *adev, out_snd_device == SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_A2DP) && (!audio_extn_a2dp_is_ready())) { ALOGW("%s: A2DP profile is not ready, routing to speaker only", __func__); if (out_snd_device == SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_A2DP) out_snd_device = SND_DEVICE_OUT_SPEAKER_SAFE; else out_snd_device = SND_DEVICE_OUT_SPEAKER; } Loading Loading @@ -2026,7 +2029,7 @@ int start_output_stream(struct stream_out *out) if (out->devices & AUDIO_DEVICE_OUT_ALL_A2DP) { if (!audio_extn_a2dp_is_ready()) { if (out->devices & AUDIO_DEVICE_OUT_SPEAKER) { if (out->devices & (AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_SPEAKER_SAFE)) { a2dp_combo = true; } else { if (!(out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD)) { Loading Loading @@ -2073,6 +2076,9 @@ int start_output_stream(struct stream_out *out) check_a2dp_restore_l(adev, out, false); } else { audio_devices_t dev = out->devices; if (dev & AUDIO_DEVICE_OUT_SPEAKER_SAFE) out->devices = AUDIO_DEVICE_OUT_SPEAKER_SAFE; else out->devices = AUDIO_DEVICE_OUT_SPEAKER; select_devices(adev, out->usecase); out->devices = dev; Loading Loading @@ -2545,7 +2551,7 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) */ if (val & AUDIO_DEVICE_OUT_ALL_A2DP) { if (!audio_extn_a2dp_is_ready()) { if (val & AUDIO_DEVICE_OUT_SPEAKER) { if (val & (AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_SPEAKER_SAFE)) { //combo usecase just by pass a2dp ALOGW("%s: A2DP profile is not ready,routing to speaker only", __func__); bypass_a2dp = true; Loading Loading @@ -2625,6 +2631,9 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) if (!bypass_a2dp) { select_devices(adev, out->usecase); } else { if (new_dev & AUDIO_DEVICE_OUT_SPEAKER_SAFE) out->devices = AUDIO_DEVICE_OUT_SPEAKER_SAFE; else out->devices = AUDIO_DEVICE_OUT_SPEAKER; select_devices(adev, out->usecase); out->devices = new_dev; Loading Loading @@ -2953,7 +2962,7 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer, if ((out->devices & AUDIO_DEVICE_OUT_ALL_A2DP) && (audio_extn_a2dp_is_suspended())) { if (!(out->devices & AUDIO_DEVICE_OUT_SPEAKER)) { if (!(out->devices & (AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_SPEAKER_SAFE))) { if (!(out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD)) { ret = -EIO; goto exit; Loading