From 22aac4e9fdb3786178f7815a0cb2150f588b1582 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Mon, 10 Jun 2013 18:17:39 +0530 Subject: [PATCH] alsa-mixer: Disable headphones when playing to speakers Assume that the headphone port volume is lower than the speaker volume. When plugging in headphones, if the path is active, while the jack is being inserted and before it is actually detected as being plugged in, it will still receive the signal being played (which is at a higher volume than it will be when plugged in completely). The volume difference manifests as a volume spike when the headphones are plugged in, before the final volume is set. This patch is required to prevent such a volume spike when plugging in headphones. The problem is not fixed completely, but the spike is shortened. To be fixed completely, we need to apply the port volume before unmuting the new path. --- src/modules/alsa/mixer/paths/analog-output-speaker.conf | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/modules/alsa/mixer/paths/analog-output-speaker.conf b/src/modules/alsa/mixer/paths/analog-output-speaker.conf index 8416a25..ccd438f 100644 --- a/src/modules/alsa/mixer/paths/analog-output-speaker.conf +++ b/src/modules/alsa/mixer/paths/analog-output-speaker.conf @@ -54,16 +54,15 @@ override-map.2 = all-left,all-right switch = off volume = off -; This profile path is intended to control the speaker, not the -; headphones. But it should not hurt if we leave the headphone jack -; enabled nonetheless. +; This profile path is intended to control the speaker, let's mute headphones +; else there will be a spike when plugging in headphones [Element Headphone] -switch = mute -volume = zero +switch = off +volume = off [Element Headphone2] -switch = mute -volume = zero +switch = off +volume = off [Element Speaker] required-any = any -- 2.7.4