[pulseaudio-discuss] Headset-detection

Himanshu Chug himanshu.chug at gmail.com
Thu Jul 21 00:24:26 PDT 2011

Thanks Colin and Spidey for making this clarification.

So regarding JACK detection and routing:

1. module-udev-detect currently can detect JACK physical hot-plugging but it
can't decode the information about what type of JACK device ( input or
output ) is connected to the sound-card, and for that one need to write an
JACK detection module to handle that.
is my understanding correct ?

2 Currently our Kernel/ALSA team support for providing seperate kcontrol
(amixer scripts) for enabling/disabling loudspeaker and headset to PA, so it
might be an good idea to handle Jack detection and routing in one of the
existing module or write up an new jack detection module for this, as Colin
suggested, provided that we are able to recognize Jack device type
(input/mic or output/headset or both)  from point 1, ( i will take further
help from kernel team here about detecting jack device type, but any
suggestions are welcome :-) )


On Wed, Jul 20, 2011 at 7:11 PM, Spidey / Claudio <spideybr at gmail.com>wrote:
The udev module in PA also detects your coldplugged hardware, it's just a
hardware detection layer. It handles hotplugging too.
The difference between an USB headset and a p2 (conventional)
headphone/headset is that the USB one is detected by the computer (not only
by linux/pa/alsa) as a complete new sound card. This new sound card has one
input and one output only, both hard-wired to the headphone and microphone
in the headset.
Jack detection acts like udev hotplug manager, but for physical connections:
the sound board is there already, jack is just "something" that watches
sound card connection impedances, and switches it's working mode (input or
output) depending on what is connected. So PA udev module can't decode that
information, PA needs a Jack module to handle that.

> _________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

On Tue, Jul 19, 2011 at 2:10 PM, Colin Guthrie <gmane at colin.guthr.ie> wrote:

> '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.
> HTHs
> Col
> --
> Colin Guthrie
> gmane(at)colin.guthr.ie
> http://colin.guthr.ie/
> 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/]
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20110721/82f08c9c/attachment.htm>

More information about the pulseaudio-discuss mailing list