[pulseaudio-discuss] [PATCH v2] alsa-mixer: Add support for "Headphone+LO" and "Speaker+LO"

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Tue Nov 4 02:53:40 PST 2014


On Mon, 2014-11-03 at 07:20 +0100, David Henningsson wrote:
> These two control names are currently being added to the HDA driver,
> so let's support them in PulseAudio as well.
> 
> Signed-off-by: David Henningsson <david.henningsson at canonical.com>
> ---
> 
> v2: Addressed comments by Tanu
> 
>  src/modules/alsa/mixer/paths/analog-output-headphones-2.conf |  8 ++++++++
>  src/modules/alsa/mixer/paths/analog-output-headphones.conf   | 11 +++++++++++
>  src/modules/alsa/mixer/paths/analog-output-lineout.conf      | 12 ++++++++++++
>  src/modules/alsa/mixer/paths/analog-output-mono.conf         | 10 ++++++++++
>  .../alsa/mixer/paths/analog-output-speaker-always.conf       | 10 ++++++++++
>  src/modules/alsa/mixer/paths/analog-output-speaker.conf      | 11 +++++++++++
>  6 files changed, 62 insertions(+)
> 
> diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf b/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
> index 74c467a..e29331b 100644
> --- a/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
> +++ b/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
> @@ -48,6 +48,14 @@ volume = off
>  switch = mute
>  volume = zero
>  
> +[Element Headphone+LO]
> +switch = mute
> +volume = zero

I think these should be "off". Why would you want to set the headphone
and lineout output to maximum when you start to use the headphones 2
jack? If both jacks are connected to speakers, things are going to get
loud...

> +
> +[Element Speaker+LO]
> +switch = off
> +volume = off
> +
>  [Element Headphone2]
>  required = any
>  switch = mute
> diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones.conf b/src/modules/alsa/mixer/paths/analog-output-headphones.conf
> index a41d41f..1ef17cf 100644
> --- a/src/modules/alsa/mixer/paths/analog-output-headphones.conf
> +++ b/src/modules/alsa/mixer/paths/analog-output-headphones.conf
> @@ -69,6 +69,17 @@ override-map.2 = all-left,all-right
>  switch = off
>  volume = off
>  
> +[Element Speaker+LO]
> +switch = off
> +volume = off
> +
> +[Element Headphone+LO]
> +required-any = any
> +switch = mute
> +volume = merge
> +override-map.1 = all
> +override-map.2 = all-left,all-right
> +
>  [Element Headphone]
>  required-any = any
>  switch = mute
> diff --git a/src/modules/alsa/mixer/paths/analog-output-lineout.conf b/src/modules/alsa/mixer/paths/analog-output-lineout.conf
> index 40af699..9160563 100644
> --- a/src/modules/alsa/mixer/paths/analog-output-lineout.conf
> +++ b/src/modules/alsa/mixer/paths/analog-output-lineout.conf
> @@ -76,6 +76,18 @@ volume = merge
>  override-map.1 = all
>  override-map.2 = all-left,all-right
>  
> +[Element Speaker+LO]
> +switch = mute
> +volume = merge
> +override-map.1 = all
> +override-map.2 = all-left,all-right
> +
> +[Element Headphone+LO]
> +switch = mute
> +volume = merge
> +override-map.1 = all
> +override-map.2 = all-left,all-right

These are still lacking "required-any = any".

> +
>  [Element Master Mono]
>  switch = off
>  volume = off
> diff --git a/src/modules/alsa/mixer/paths/analog-output-mono.conf b/src/modules/alsa/mixer/paths/analog-output-mono.conf
> index 87b5081..589d4ce 100644
> --- a/src/modules/alsa/mixer/paths/analog-output-mono.conf
> +++ b/src/modules/alsa/mixer/paths/analog-output-mono.conf
> @@ -45,6 +45,10 @@ override-map.2 = all-left,all-right
>  switch = mute
>  volume = zero
>  
> +[Element Headphone+LO]
> +switch = mute
> +volume = zero

Should be "off" for same reason as explained above.

> +
>  [Element Headphone2]
>  switch = mute
>  volume = zero
> @@ -55,6 +59,12 @@ volume = merge
>  override-map.1 = all
>  override-map.2 = all-left,all-right
>  
> +[Element Speaker+LO]
> +switch = mute
> +volume = merge
> +override-map.1 = all
> +override-map.2 = all-left,all-right

Should be "off" (there are also other instances in this file where
elements aren't set to "off" when they should). This path is meant to
control a mono output jack. When Lennart wrote this file, he seemed to
think that the "Speakers" element would apply to the mono jack too, but
it doesn't sound likely to me.

-- 
Tanu



More information about the pulseaudio-discuss mailing list