All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Adam Goode <agoode@chromium.org>, alsa-devel@alsa-project.org
Subject: Re: seq module loading issue
Date: Thu, 09 Oct 2014 09:29:03 +0200	[thread overview]
Message-ID: <5436393F.6020309@ladisch.de> (raw)
In-Reply-To: <CAOf41NnCESt3PEGhp3yKgZhScG1H0+qrhz8h3+vjBUfGzfhsyA@mail.gmail.com>

Adam Goode wrote:
> 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.

In practice, programs that listen to these announcements do so in order
to dynamically update their own list of MIDI clients/ports, and
enumerating those would have triggered autoloading.  This might be the
reason that this problem has not been reported so far.

I don't know about your implementation of the MIDIAccess interface, but
it looks as if enumeration is needed when the client accesses either the
"inputs" or "outputs" fields.  Couldn't you trigger the same enumeration
when the onconnect/ondisconnect event handlers are set?


Regards,
Clemens

      parent reply	other threads:[~2014-10-09  7:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5436393F.6020309@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=agoode@chromium.org \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.