[alsa-devel] ALSA SoC + Hotplug ?

Takashi Iwai tiwai at suse.de
Tue May 30 15:48:55 CEST 2017


On Tue, 30 May 2017 15:29:59 +0200,
Pierre-Louis Bossart wrote:
> 
> On 5/30/17 1:42 AM, Kuninori Morimoto wrote:
> > Hi ALSA ML
> >
> > Now, ALSA SoC can support HDMI, then, we want to support Hotplug for it.
> > In my quick grep, it seems ALSA SoC doesn't have such support now (?)
> > But, is it supported ?
> 
> We looked at it a couple of days ago and were indeed surprised that
> only Intel drivers seem to use snd_jack_report() [1]. It'd be good if
> there was a common way of signaling hot plug events to user space...
> 
> [1] http://elixir.free-electrons.com/linux/latest/ident/SND_JACK_AVOUT

AFAIK, most of ASoC jacks are triggered implicitly in soc-jack.c via
gpiolib or such.  But the HDMI stuff seems to be the lost child.


About the original question from Morimoto-san: the answer is
"depends".

If you want a card-level hotplug, it's just the normal the device
probe / remove.

If you want ASoC component-level hotplug, it's unimplemented, AFAIK.

If you want the dynamic PCM device creation / removal, it should be
doable, but it'd be tricky.

Currently, HD-audio (and HDMI LPE audio) don't do the hotplug-style
device management.  Instead, it creates the PCM streams statically
while it notifies to user-space via kctl / input jack about the
monitor connection state.  It's basically for PulseAudio which expects
the static stream assignment per card.

Note that the monitor connection state may change rapidly, as the
audio is also gone when the video is blanked or the modeset changed;
thus creating/deleting the device at each time might whip udev and
others too much.  It's one of the reasons we didn't go to that
direction.

But, I'm not entirely convinced that the current implementation is the
always best.


Takashi


More information about the Alsa-devel mailing list