[pulseaudio-discuss] [PATCH] alsa-mixer: Adding Jack of Front Headphone Front and Surround

Hui Wang hui.wang at canonical.com
Wed Jan 2 12:23:27 UTC 2019


On 2018/12/31 下午9:46, Tanu Kaskinen wrote:
> On Fri, 2018-12-21 at 11:05 +0800, Hui Wang wrote:
>> We have 2 HP desktop models which have one front headphone Jack and
>> one front headset Jack, in the Linux kernel, these two jacks are
>> named "Front Headphone Front Jack" and "Front Headphone Surround
>> Jack", now adding them into the pathes conf file.
> How do the kcontrols map to physical connectors? Is there only one
> physical connector or two? How do different kinds of devices
> (headphones, headsets, stand-alone mics) change the state of the two
> kcontrols?
There are 2 physical connectors/jacks, one is the pure headphone jack, 
the other is the headset jack (headphone + mic).

For the headphone jack, the kcontrols are:  'Front Headphone Surround 
Jack' and 'Headphone Playback Volume' index 1

For the headset jack, the kcontrols are: 'Front Headphone Front Jack',  
'Headphone Playback Volume' index 0, 'Mic Jack' and 'Mic Boost Volume'

If we plug a headphone in either of the two jacks, the 'Surround Jack' 
or 'Front Jack' will be true. If we plug a headset in the headset jack, 
the 'Front Jack' and 'Mic Jack' will be true.

This is not the Dell machine, most Dell machines can't detect mic of 
headset, so we add headset-mic, headphone-mic for them.  This HP machine 
can detect mic of headset jack, and it doesn't support stand-alone mics too.


>
> I think at least the headset-mic path configuration in your patch is
> incorrect, but I don't know how it should be configured before knowing
> how the two kcontrols behave.

After reading your comments above,  I think you are right.  And I think 
I shouldn't touch analog-input-headset-mic.conf in the patch, since this 
is a HP machine, and the headset jack of this machine has capability to 
detect the mic on the headset and the kcontrols are "Mic Jack" and 
"Headphone Front Jack". It is different from the Dell machines.


> (A sidenote: it would be awesome to have some documentation that
> explains what combinations of headphone/headset/mic jacks exist in the
> wild and how those combinations map to physical connectors. The details
> of the headphone/headset/mic jack detection mess are impossible to
> remember.)
>
It is not easy to fully understand this part, need to study it bit by 
bit.  :-)


>> Without this change, if users plug a headset or headphone, the
>> path of headphone will not be activated, and users can't see
>> headphones from UI like gnome-control-center.
>>
>> Signed-off-by: Hui Wang <hui.wang at canonical.com>
>> ---
>> For alsa-info.txt of one of machines, please access:
>> https://pastebin.ubuntu.com/p/CjCGySMpM5/
>>
>>   .../alsa/mixer/paths/analog-input-headset-mic.conf        | 6 ++++++
>>   .../alsa/mixer/paths/analog-output-headphones.conf        | 6 ++++++
>>   .../alsa/mixer/paths/analog-output-speaker-always.conf    | 8 ++++++++
>>   src/modules/alsa/mixer/paths/analog-output-speaker.conf   | 8 ++++++++
>>   4 files changed, 28 insertions(+)
>>
>> diff --git a/src/modules/alsa/mixer/paths/analog-input-headset-mic.conf b/src/modules/alsa/mixer/paths/analog-input-headset-mic.conf
>> index 579db6bb7..bc687b6e4 100644
>> --- a/src/modules/alsa/mixer/paths/analog-input-headset-mic.conf
>> +++ b/src/modules/alsa/mixer/paths/analog-input-headset-mic.conf
>> @@ -35,6 +35,12 @@ state.plugged = unknown
>>   [Jack Front Headphone]
>>   state.plugged = unknown
>>   
>> +[Jack Front Headphone Front]
>> +state.plugged = unknown
>> +
>> +[Jack Front Headphone Surround]
>> +state.plugged = unknown
>> +
>>   [Jack Headphone Mic]
>>   state.plugged = unknown
>>   
>> diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones.conf b/src/modules/alsa/mixer/paths/analog-output-headphones.conf
>> index d2147c50f..2d751607c 100644
>> --- a/src/modules/alsa/mixer/paths/analog-output-headphones.conf
>> +++ b/src/modules/alsa/mixer/paths/analog-output-headphones.conf
>> @@ -40,6 +40,12 @@ required-any = any
>>   state.plugged = unknown
>>   state.unplugged = unknown
>>   
>> +[Jack Front Headphone Front]
>> +required-any = any
>> +
>> +[Jack Front Headphone Surround]
>> +required-any = any
>> +
>>   [Jack Headphone]
>>   required-any = any
>>   
>> diff --git a/src/modules/alsa/mixer/paths/analog-output-speaker-always.conf b/src/modules/alsa/mixer/paths/analog-output-speaker-always.conf
>> index 71f356dce..c9374e471 100644
>> --- a/src/modules/alsa/mixer/paths/analog-output-speaker-always.conf
>> +++ b/src/modules/alsa/mixer/paths/analog-output-speaker-always.conf
>> @@ -33,6 +33,14 @@ state.unplugged = unknown
>>   state.plugged = no
>>   state.unplugged = unknown
>>   
>> +[Jack Front Headphone Front]
>> +state.plugged = no
>> +state.unplugged = unknown
>> +
>> +[Jack Front Headphone Surround]
>> +state.plugged = no
>> +state.unplugged = unknown
>> +
>>   [Jack Line Out]
>>   state.plugged = no
>>   state.unplugged = unknown
>> diff --git a/src/modules/alsa/mixer/paths/analog-output-speaker.conf b/src/modules/alsa/mixer/paths/analog-output-speaker.conf
>> index 9f4dac414..536630d0a 100644
>> --- a/src/modules/alsa/mixer/paths/analog-output-speaker.conf
>> +++ b/src/modules/alsa/mixer/paths/analog-output-speaker.conf
>> @@ -36,6 +36,14 @@ state.unplugged = unknown
>>   state.plugged = no
>>   state.unplugged = unknown
>>   
>> +[Jack Front Headphone Front]
>> +state.plugged = no
>> +state.unplugged = unknown
>> +
>> +[Jack Front Headphone Surround]
>> +state.plugged = no
>> +state.unplugged = unknown
>> +
>>   [Jack Line Out]
>>   state.plugged = no
>>   state.unplugged = unknown




More information about the pulseaudio-discuss mailing list