[alsa-devel] Jack sensing in snd_usb_audio ?

Bastien Nocera hadess at hadess.net
Wed Oct 12 12:58:43 CEST 2016


On Wed, 2016-10-12 at 19:36 +0900, Takashi Sakamoto wrote:
> On Oct 12 2016 14:10, Bastien Nocera wrote:
> > My questions are:
> > - does the USB audio driver support jack sensing?
> > - is this something standard that's just not implemented yet? In
> > which
> > case, I'd be up for at least trying, given specs.
> > - or is it something that depends on the device, and in which case,
> > how
> > would I find out?
> 
> 
> In ALSA usb-related codes, there's no functions calls for
> snd_jack_*(),
> thus none of ALSA drivers for USB support Jack sense feature of ALSA
> control interface.
> 
> The requirement of Jack sense feature is whether hardwares support
> it.
> For example, some hardware codecs such as HDA codecs generates
> signals
> when plugs are insert to jacks connected to the codecs. Corresponding
> ALSA drivers catch the signals, then tell it to user land.
> 
> If your hardware performs like it, you have a probability to add
> support
> for jack sense feature to ALSA drivers for USB. But I don't know
> exactly
> that USB related specifications such as USB Audio Device Class
> 1.0/2.0/3.0 supports the feature.

Looks like whether or not jack sensing works depends on the device
itself, but there is a mechanism to propagate the change in setup in
the USB Audio 2.0 spec, in the "Interrupts" section:
"
A change of state in the audio function is most often caused by a
certain event that takes place. An event can either be user-initiated
or device-initiated. User-initiated jack insertion or removal is a
typical example of a user-initiated event.
"

I guess I should probably test in another operating system to check
whether the hardware I have supports this to start with, and go from
there.

Cheers


More information about the Alsa-devel mailing list