public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
* fixing seq_midi: MIDI output buffer overrun
@ 2018-12-24 20:43 Adam Goode
  2018-12-25 11:34 ` Takashi Sakamoto
  0 siblings, 1 reply; 4+ messages in thread
From: Adam Goode @ 2018-12-24 20:43 UTC (permalink / raw)
  To: alsa-devel

Hi,

I am investigating why Chromium can't reliably send sysex messages on
Linux. (See https://bugs.chromium.org/p/chromium/issues/detail?id=917708.)

I've seen the message at
https://alsa-devel.alsa-project.narkive.com/6w35hffF/sysex-overflow-when-using-the-midi-sequencer-event-interface

Chromium does use seq and we do need sysex to be reliable since
vendors such as Novation and Yamaha use Web MIDI to interface with
hardware.

The code in question predates git history (2005). It's
event_process_midi() and dump_midi() in seq_midi.c.

I see that dump_midi() returns either ENOMEM or EINVAL under certain
conditions, but the only caller (event_process_midi()) throws these
errors away and always returns 0 if everything but dump_midi()
succeeds.

A few questions:

1. Can I change dump_midi to block instead of return ENOMEM if I don't
use SND_SEQ_NONBLOCK in snd_seq_open?

2. What should be returned in NONBLOCK mode? Probably EAGAIN?

3. The general blocking behavior of seq seems inconsistent. If I am
using snd_seq_ev_set_direct, then I get EAGAIN even with a blocking
open. Should I expect blocking from the pool, or only if using a
queue?

4. Is there any obvious fix I am overlooking?


Thanks,

Adam

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

end of thread, other threads:[~2018-12-26  5:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-24 20:43 fixing seq_midi: MIDI output buffer overrun Adam Goode
2018-12-25 11:34 ` Takashi Sakamoto
2018-12-26  1:29   ` Adam Goode
2018-12-26  5:13     ` Takashi Sakamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox