Skip to contentSkip to conversation

support for jackSense feature in modern sound cards

DISCUSSION Balaji Rao 3 participants 3 messages Feb 10, 2008

lore
Share & tools
lore

Balaji Rao

author
#0 lore raw

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.

Signature · 2 lines
regards,
balaji rao
#1 lore raw

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

Quoted 15 lines · Balaji Rao

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.

Signature · 5 lines
Tobin Davis 


I hate users
 you sound like a sysadmin already!
#2 lore raw
In reply to Balaji Rao
Quoted 3 lines · Balaji Rao

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).

Quoted 4 lines

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.