[RFC] Jack insertion interface

Guillem Jover guillem.jover at nokia.com
Fri Oct 10 17:08:05 PDT 2008


Hi,

On embedded devices (and some laptops) it's common to have support for
jack insertion notifications, which can then trigger userland to act
on that, like starting a recording application or changing the audio
routing.

With kernel 2.6.27 there's now a new SW_MICROPHONE_INSERT switch in
the input layer [0]. And in the ALSA tree there's an upcoming jack
reporting API [1][2].

So I'd like to propose to add a new namespace 'input.jack', any device
with such capability would have:

* a button with state to signal the insertions, with a 'button.type' =
  'jack_insert', although that would need the current 'headphone_insert'
  to be changed, which might break existing applications even though
  that 'button.type' is not present right now in the spec, so it might
  be just fine?

* an 'input.jack.type' (string) key with possible values being 'none',
  'headphone', 'microphone', 'headset' and 'unknown', with the value
  changing once a jack is being inserted or removed.

* it might make sense to have stuff like 'input.jack.headphone' and
  'input.jack.microphone' as capabilities in case the computer has
  several jack slots.

Another possibility could be to specify the jack type in the
'button.type', and not have an 'input.jack.type' key, but that would
imply changing it on insertions in case the slot supports different
jack types, and I'm not sure if that'd be fine.

Comments?

I'll send the patches for the spec and to support this interface, once
the namespace, keys and values have been decided.

regards,
guillem

[0] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=5ec461d083066441c1a280aa9e13d3bb5c3e008a
[1] http://git.kernel.org/?p=linux/kernel/git/tiwai/sound-2.6.git;a=commitdiff;h=63c60035a8f399ba8bbf75222213cfb55adc75fd
[2] http://git.kernel.org/?p=linux/kernel/git/tiwai/sound-2.6.git;a=commitdiff;h=753e8359e93ef952bf892be4b2b252ab5d5515b7


More information about the hal mailing list