summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher N. Hesse <raymanfx@gmail.com>2018-02-02 23:19:42 +0100
committerChristopher N. Hesse <raymanfx@gmail.com>2018-02-09 15:23:07 +0000
commit11ef2117492b5a92aeee6f6c990fc7af5b2f346d (patch)
tree0deb091430b7def3e87309f5786e44a39d46f8fa
parent56508259a620a1b5f5f2178ce7a2bf4c9135c1b5 (diff)
downloadandroid_hardware_samsung-staging/lineage-15.1.tar.gz
android_hardware_samsung-staging/lineage-15.1.tar.bz2
android_hardware_samsung-staging/lineage-15.1.zip
audio: Avoid mixer path dependency conflictsstaging/lineage-15.1
On some devices, certain input and output mixer controls share the same endpoint, which means that if an input stream is disabled (and the mixer is updated), that shared endpoint may be disabled as well. This would result in no audio, because no one is aware that the output stream in fact does still need the shared endpoint to be enabled. We prevent this by enabling the output mixers after disabling input mixers, if any. Change-Id: I4d80fcd0648a11099f27177da3cd29095b6a8c34 (cherry picked from commit 507e8ce5bffb36fae8b1cd4e5498fa19a6273ee6)
-rw-r--r--audio/audio_hw.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index c050dd5..1ede8e1 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -980,7 +980,9 @@ int disable_snd_device(struct audio_device *adev,
{
struct mixer_card *mixer_card;
struct listnode *node;
+ struct audio_usecase *out_uc_info = get_usecase_from_type(adev, PCM_PLAYBACK);
const char *snd_device_name = get_snd_device_name(snd_device);
+ const char *out_snd_device_name = NULL;
if (snd_device_name == NULL)
return -EINVAL;
@@ -1006,6 +1008,15 @@ int disable_snd_device(struct audio_device *adev,
update_mixer = true;
#endif /* DSP_POWEROFF_DELAY */
audio_route_reset_path(mixer_card->audio_route, snd_device_name);
+ if (out_uc_info != NULL) {
+ /*
+ * Cycle the rx device to eliminate routing conflicts.
+ * This prevents issues when an input route shares mixer controls with an output
+ * route.
+ */
+ out_snd_device_name = get_snd_device_name(out_uc_info->out_snd_device);
+ audio_route_apply_path(mixer_card->audio_route, out_snd_device_name);
+ }
if (update_mixer) {
audio_route_update_mixer(mixer_card->audio_route);
}