alsa: Jack detection kcontrol implementation
authorDavid Henningsson <david.henningsson@canonical.com>
Thu, 23 Feb 2012 06:17:02 +0000 (07:17 +0100)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Sun, 11 Mar 2012 06:53:46 +0000 (12:23 +0530)
commitdedf1340c611c3d9b17a08e0ee18ae22afac623c
tree3a3d53638115b32a5e7155fb55cbe6e34e8046e8
parent74e01ad6164060ac1dc9aa98239b2d435f2d4bda
alsa: Jack detection kcontrol implementation

Support the new jack detection interface implemented in Linux 3.3
(and Ubuntu's 3.2 kernel).

Jacks are probed and detected using the snd_hctl_* commands, which
means we need to listen to them using fdlists. As this detection
needs to be active even if there is currently no sink for the jack,
so this polling is done on the card level.

Also add configuration support in paths, like this:
[Jack Headphone]
required-any = any

...where 'Jack Headphone' should match 'Headphone Jack' as given by
ALSA (as seen in e g 'amixer controls').
"Required", "required-any" and "required-absent" is supported. Using
required-any, one can have several ports even though there is no
other indication in the mixer that this path exists.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
14 files changed:
src/modules/alsa/alsa-mixer.c
src/modules/alsa/alsa-mixer.h
src/modules/alsa/alsa-sink.c
src/modules/alsa/alsa-source.c
src/modules/alsa/alsa-util.c
src/modules/alsa/alsa-util.h
src/modules/alsa/mixer/paths/analog-input-dock-mic.conf
src/modules/alsa/mixer/paths/analog-input-front-mic.conf
src/modules/alsa/mixer/paths/analog-input-linein.conf
src/modules/alsa/mixer/paths/analog-input-mic.conf
src/modules/alsa/mixer/paths/analog-input-rear-mic.conf
src/modules/alsa/mixer/paths/analog-output-headphones.conf
src/modules/alsa/mixer/paths/analog-output.conf.common
src/modules/alsa/module-alsa-card.c