[alsa-devel] support for jackSense feature in modern sound cards
Hello people,
How well is the jack sense feature in modern soundcards supported in the kernel ? I opened up a few driver sources like hda-intel and found the word 'jack sense' in some files, but i could not find it being used anywhere.
Are there standard interfaces in kmix or equivalent software that use the jack sense feature ? If not, wouldn't it be nice to have a standard interface to expose this feature so that kmix and others could make use of in a device independent way ?
If yes, I would be more than willing to contribute to its development.
Please clarify.
Actually, most of the hda_intel sound codecs support jack sense to a certain extent. They are mainly used to mute/unmute speaker and microphone channels when headphones or external microphones are plugged in. Some of the codecs support additional sensing to determine the type of device plugged in, but that is very limited in the drivers, mainly because of the diverse nature of the systems that these codecs are used in.
Tobin
On Mon, 2008-02-11 at 01:03 +0530, Balaji Rao wrote:
Hello people,
How well is the jack sense feature in modern soundcards supported in the kernel ? I opened up a few driver sources like hda-intel and found the word 'jack sense' in some files, but i could not find it being used anywhere.
Are there standard interfaces in kmix or equivalent software that use the jack sense feature ? If not, wouldn't it be nice to have a standard interface to expose this feature so that kmix and others could make use of in a device independent way ?
If yes, I would be more than willing to contribute to its development.
Please clarify.
On Mon, Feb 11, 2008 at 01:03:37AM +0530, Balaji Rao wrote:
How well is the jack sense feature in modern soundcards supported in the kernel ? I opened up a few driver sources like hda-intel and found the word 'jack sense' in some files, but i could not find it being used anywhere.
FWIW this feature is frequently called "jack detect" or "headphone detect". I have actually been looking at this, mostly within the context of ASoC although obviously this all applies to ALSA core too. There is some in-kernel support for it at present, though some of those don't expose anything to user space and do fixed things to the hardware when there is a headphone detect event.
There is also an existing user space API for communicating events to user space via the input subsystem - this is in use by some of the Zaurus systems. Jacks are represented as switch events of type SW_HEADPHONE_INSERT. User space can listen for these events and can then adjust the system configuration as appropriate.
My plan for supporting this in ALSA had been to add helpers to assist in the creation of input devices representing the jacks along with new switch types to allow systems that can detect the type of device plugged into a jack to represent this to user space (eg, SW_SPEAKER_INSERT). The helpers would parent the input device off the sound card device and provide a name for the jack to user space. My intention is to post some code once I've got sound working on the Zylonite (since that has jack detect support and would allow me to show working code).
Are there standard interfaces in kmix or equivalent software that use the jack sense feature ? If not, wouldn't it be nice to have a standard interface to expose this feature so that kmix and others could make use of in a device independent way ?
The existing user space API does seem reasonable to me - logically, a headphone jack does correspond to a switch and applications that respond to jack insert events are likely to also want to pay attention to other input events such as the mute and volume control keys often found on keyboards.
For embedded uses the expectation was that this would be used in conjunction with the ALSA scenario management API which my colleague Liam Girdwood is currently developing:
http://opensource.wolfsonmicro.com/node/14
This may or may not be appropriate for desktop systems, I am less familiar with the issues there.
participants (3)
-
Balaji Rao
-
Mark Brown
-
Tobin Davis