Bug 2517136

Summary: snd_seq_midi default 4096-byte output buffer causes large SysEx/Web MIDI transfers to fail
Product: [Fedora] Fedora Reporter: Ruslan <ruslan.panasiuk>
Component: kernelAssignee: Justin M. Forbes <jforbes>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 43CC: acaringi, adscvr, airlied, hans, hpa, jforbes, junjie.cao, kernel-maint, linville, masami256, mchehab, nickolasjcarr, ptalbert, steved, suraj.ghimire7
Target Milestone: ---Keywords: Desktop
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ruslan 2026-08-15 19:57:16 UTC
1. Please describe the problem:
Context:
First of all, the 'bug' is related to specific audio production device types that are using Web MIDI with SysEx extension.
In my case it is Novation Circuit Tracks, a so called groovebox that used for creating and performing electronic music.
WebMidi and SysEx is often a default way for transfer data in such devices, because of it does not require custom protocol, just MIDI, and works in Web (with WebMIDI). /Context

My Novation Circuit Tracks is detected correctly and normal Web MIDI communication works in Chromium.

Large SysEx transfers, specifically sample uploads from Novation Components, fail after approximately one second.

Cause:
>cat /sys/module/snd_seq_midi/parameters/output_buffer_size
4096

Fix:
>sudo bash -c 'echo "options snd_seq_midi output_buffer_size=131072" > /etc/modprobe.d/snd-seq-midi-buffer-size-novation.conf'
>sudo rmmod snd_seq_midi
>sudo modprobe snd_seq_midi

Increasing `output_buffer_size` from 4096 (default) to 131072 completely resolves the problem.

2. What is the Version-Release number of the kernel:
Linux fedora 7.0.13-100.fc43.x86_64

3. Did it work previously in Fedora?
Unknown

4. Can you reproduce this issue?
Reproducing is not trivial if you do not own hardware that relies on the SysEx/WebMIDI transport. In my case, with Novation Circuit Tracks groovebox:
  1. Use any Chromium(!) browser (native, no Flatpak)
  2. Go to https://components.novationmusic.com/
  3. Connect device (Novation Circuit Tracks or similar) via USB
  4. In the Novation Components web UI ensure it is connected and operational
  5. In 'Samples editor' UI add any wav/mp3 sample to any slot
  6. Click 'Send to Circuit Tracks' (or Send to <Your Device Name>)
  7. Progress bar would appear and then it would crash with 'Something went wrong' after 1 sec


5. Does this problem occur with the latest Rawhide kernel?
Untested. It is likely not related to particular version, but to `snd_seq_midi` module configuration


6. Are you running any modules that not shipped with directly Fedora's kernel?:
No

7. Please attach the kernel logs.
```
rugp. 15 19:39:56 kernel: dump_midi: 10 callbacks suppressed
rugp. 15 19:39:56 kernel: ALSA: seq_midi: MIDI output buffer overrun
rugp. 15 19:39:56 kernel: ALSA: seq_midi: MIDI output buffer overrun
rugp. 15 19:39:56 kernel: ALSA: seq_midi: MIDI output buffer overrun
rugp. 15 19:39:56 kernel: ALSA: seq_midi: MIDI output buffer overrun
rugp. 15 19:39:56 kernel: ALSA: seq_midi: MIDI output buffer overrun
rugp. 15 19:39:56 kernel: ALSA: seq_midi: MIDI output buffer overrun
rugp. 15 19:39:56 kernel: ALSA: seq_midi: MIDI output buffer overrun
rugp. 15 19:39:56 kernel: ALSA: seq_midi: MIDI output buffer overrun
rugp. 15 19:39:56 kernel: ALSA: seq_midi: MIDI output buffer overrun
rugp. 15 19:39:56 kernel: ALSA: seq_midi: MIDI output buffer overrun
```

Reproducible: Always

Comment 1 junjie.cao 2026-08-31 14:32:39 UTC
Root cause: dump_midi() in sound/core/seq/seq_midi.c fails a chunk with
-ENOMEM whenever it doesn't fit in the rawmidi output buffer, even on
the write(2) path where the caller may sleep. Any one-shot SysEx larger
than the buffer is dropped once the client gets ahead of the device by
output_buffer_size bytes, so raising the module parameter only moves
the limit.

Patch sent upstream, waiting for the device to drain instead on the
non-atomic path:
https://lore.kernel.org/all/<message-id>/

Until it lands, the output_buffer_size workaround from comment 0 is the
right one. If you can test a build with the patch, a Tested-by on the
list thread would help.

Comment 2 junjie.cao 2026-08-31 14:35:49 UTC
Correct link for the patch in comment 1:
https://lore.kernel.org/all/20260831143200.412572-1-junjie.cao@intel.com/(In reply to junjie.cao from comment #1)
> Root cause: dump_midi() in sound/core/seq/seq_midi.c fails a chunk with
> -ENOMEM whenever it doesn't fit in the rawmidi output buffer, even on
> the write(2) path where the caller may sleep. Any one-shot SysEx larger
> than the buffer is dropped once the client gets ahead of the device by
> output_buffer_size bytes, so raising the module parameter only moves
> the limit.
> 
> Patch sent upstream, waiting for the device to drain instead on the
> non-atomic path:
> https://lore.kernel.org/all/<message-id>/
> 
> Until it lands, the output_buffer_size workaround from comment 0 is the
> right one. If you can test a build with the patch, a Tested-by on the
> list thread would help.

Correct link for the patch in comment 1:
https://lore.kernel.org/all/20260831143200.412572-1-junjie.cao@intel.com/

Comment 3 junjie.cao 2026-09-01 14:43:15 UTC
Upstream declined the blocking approach: the seq_midi event handler runs
inside the sequencer delivery path and must not sleep for long, whatever
the calling context. The maintainer's position is that a real fix needs
a design change in the sequencer core (parking events per destination
port with back-pressure to the writer). Thread:
https://lore.kernel.org/all/871pbddz5k.wl-tiwai@suse.de/

Until that lands, the output_buffer_size workaround from comment 0
stands. It only raises the limit: a transfer that gets more than
output_buffer_size bytes ahead of the device is still truncated
silently, because Chromium sends SysEx as 256-byte direct events and
does not check the result of snd_seq_event_output_direct().

Comment 4 Aoife Moloney 2026-11-10 19:53:57 UTC
This message is a reminder that Fedora Linux 43 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 43 on 2026-12-02.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '43'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 43 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.