[pulseaudio-discuss] Headset-detection

Colin Guthrie gmane at colin.guthr.ie
Tue Jul 19 01:40:42 PDT 2011

'Twas brillig, and Himanshu Chug at 19/07/11 07:14 did gyre and gimble:
> Hi Colin,
> Thanks for the useful information, good to know this information.
> and after discussion with our kernel team here I come to know that they
> can handle the JACK detection and route audio internally at ALSA level
> (like in ubuntu10.10) and also they can exposed few mixer scripts to PA
> to externally route the data over headset and loudspeaker if needed.

At present, if (and not all harware/drivers do this) alsa provides
separate kcontrols for Headphones vs. Speakers, PA should detect this
and offer different "ports" on the alsa sink itself. These ports have to
be manually selected just now (tho' it would be easy enough for you to
hack up a module to flip them if you do your own Jack detection).

This allows PA to use the correct kcontrol for the current volume
situation and thus also use optimum power.

> few more clarification :
> - if not jack detection, then what module-udev-detect is montior for ?
> or in other words what is the functionality of module-udev-detect?

udev detects new sound cards. The term headset used in your title, I
interpreted to be USB Headsets... (normally I would expect jack
detection to be triggered by headphones (subtly different to headsets!).
This is just a quirk of English where I'm a perhaps jumping to
conclusions (the words are not incorrect - gotta love the langauage!)

Anyway, yeah, it will detect if the user plugs in e.g. new USB Speakers,
or similar.

> - what will happen in case of USB headset plug-in/out, will that be
> appear as a new sink ? or USB detection is also same as jack detection ?

USB is quite different to Headphone Jack detection. USB devices do
indeed appear as new sinks and this is done by udev-detect, whereas a
Headphone Jack will (when all the support is added in the various
layers) will just change an existing sink - USB can be used at the same
time as internal device, but the speakers and the headphones cannot be
used at the same time, one overrides the other (this is not strictly
true but the principle and model is more or less true). So that's why
Jack detection is different to USB.

> - what to trigger to PA to appear/show a new sink (pacmd list-sink)? I
> am trying to understand the "sink" definition in terms of PA ?

Sink is an output device. In the case of headphones it's typically the
same device you are accessing. You'll just access it in one of two
modes... either speakers or headphones. That's where ports come in. They
allow you to change the operating mode of the sink.




Colin Guthrie

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

More information about the pulseaudio-discuss mailing list