All of lore.kernel.org
 help / color / mirror / Atom feed
* seq module loading issue
@ 2014-10-08 22:00 Adam Goode
  2014-10-09  6:42 ` Takashi Iwai
  2014-10-09  7:29 ` Clemens Ladisch
  0 siblings, 2 replies; 10+ messages in thread
From: Adam Goode @ 2014-10-08 22:00 UTC (permalink / raw)
  To: alsa-devel

Hi,

I've observed a scenario in ALSA that I would like some feedback on
solving. On Linux, Chrome uses seq for WebMIDI. Eventually, there will be
hotplug detection code in Chrome that looks like this:

1. Connect to announce port
2. Listen for any announcements for client/port start/end
3. Send MIDIConnectionEvent events to JavaScript clients (
http://webaudio.github.io/web-midi-api/#midiconnectionevent-interface)

Here is the scenario where this fails:

1. Cold boot a machine with no MIDI devices plugged in
2. Start client, subscribe on the seq announce port
3. Insert USB MIDI device
4. snd_rawmidi module is loaded, triggered by insertion of MIDI device
5. snd_seq_midi is NOT loaded, but marked for loading later

At this point, there is no client start event sent to the announce port.
This is because of the deferred module loading, which won't trigger except
for a handful of operations (snd_seq_client_info_get_client is an example).

This is easily replicated with looking at aseqdump -p 0:1.


My question is: how to solve this? There are a few options:

1. Periodically poll for new clients. This is fairly ugly, but will work to
trigger module loading and won't result in latency once any device has been
plugged in, since announce will again work.

2. Somehow trigger module loading if there are any clients listening on the
announce port. This seems pretty tricky and requires keeping track of some
new state.

3. Do away with deferred module loading in seq. This is pretty invasive and
would increase the number of modules loaded, but would result in a lot of
deleted code in the kernel and a clean fix.

Number 3 is my preferred solution, but I wanted to see if these sorts of
patches would be acceptable, since it is invasive and would result in more
modules loaded.


Thanks for any comments.


Adam

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-10-10 21:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-08 22:00 seq module loading issue Adam Goode
2014-10-09  6:42 ` Takashi Iwai
2014-10-09  7:29   ` Clemens Ladisch
2014-10-09  7:38     ` Takashi Iwai
2014-10-09  9:14       ` Clemens Ladisch
2014-10-09  9:21         ` Takashi Iwai
2014-10-09  9:46           ` Takashi Iwai
2014-10-09 15:45             ` Takashi Iwai
2014-10-10 21:45               ` Adam Goode
2014-10-09  7:29 ` Clemens Ladisch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.