Closed Bug 1965635 Opened 9 months ago Closed 8 months ago

Large MIDI sysex messages not working on Linux

Categories

(Core :: DOM: Device Interfaces, defect, P3)

Firefox 138
defect

Tracking

()

VERIFIED FIXED
141 Branch
Tracking Status
firefox141 --- fixed

People

(Reporter: pmatilai, Assigned: gsvelto)

References

(Regressed 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0

Steps to reproduce:

Try to use WebMIDI to send large SysEx MIDI messages. In this particular case I'm trying to use Firefox for managing a Electra One MIDI controller with it's web application, but it's not at all specific to that.

Actual results:

The large sysex message is either truncated or not sent at all, leaving both the web app and the receiving end hanging in the air. Firefox doesn't crash, but obviously things do not work either.

Expected results:

There should be no arbitrary limits to SysEx message sending. These can be very large when uploading/downloading firmware, sample data and whatnot. This issue prevents the use of Firefox for all manner of interesting webmidi-related applications.

This is rather similar to https://bugzilla.mozilla.org/show_bug.cgi?id=1945967, just the platform and thus the underlying libraries involved are different. In the case of Linux it's the midir interface to ALSA that is the issue. The midir version bundled in Firefox is rather old (0.7.0 from 2020), and this particular issue has been fixed in midir upstream couple of years ago already:
https://github.com/Boddlnagg/midir/pull/125

I did a local build of Firefox 132 some months ago with the above patch to confirm it indeed fixed the large sysex issue, but Firefox should really update the bundled midir library to a newer version to gain all the other fixes as well.

Thanks.

The severity field is not set for this bug.
:cmartin, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(cmartin)

NI Gabriele for WebMIDI

Severity: -- → S3
Flags: needinfo?(cmartin) → needinfo?(gsvelto)
Priority: -- → P3

Confirming this. I've held back from updating the midir crate because they skipped the windows-sys 0.52 dependency and went straight to 0.56 which we don't have vendored. I can try patching back the crate dependency to 0.52 but I don't think that'll work. There were some significant changes in the external API between those two versions, notably HANDLE is an isize in the old one and a *mut c_void in the new one. Worst case I can fork midir again and use our fork, but I'd rather not go there if I can avoid it.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(gsvelto)

Thanks for the detailed response!

Ugh, guess vendored libraries are no panacea either. Some solution - whether a temporary fork for the specific issue or something else - would be much, much appreciated though. For me, this is the only thing I need Chromium for, and you can imagine how annoying it is to have to drag that monster around, especially when you know what a tinyt thing it is code-wise :D Of course this is a bit of a niche thing, but it does keep a number of musicians having to resort to other browsers.

If there's something I can do to help this matter (test a build or something), I'd be happy to.

I did some checking, tried patching using a windows patch crate to see if I could vendor midir 0.10.1 without changes and it won't work, because there were further changes to HANDLE and its related type (they're now transparent structus, something I had missed). So, the only way to vendor an updated midir is to fork it again, at least until they update their dependencies. I'll give it a spin tomorrow if I have some free time in-between builds.

WIP using our vendored branch, I still need to test this on all architectures.

Assignee: nobody → gsvelto
Attachment #9491660 - Attachment description: WIP: Bug 1965635 - Update the midir crate to version 0.10.1 to better handle large SysEx MIDI messages on Linux → Bug 1965635 - Update the midir crate to version 0.10.1 to better handle large SysEx MIDI messages on Linux r=padenot
Status: NEW → ASSIGNED
Pushed by gsvelto@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/99bfb78bdbd6 https://hg.mozilla.org/integration/autoland/rev/d8721d35e713 Update the midir crate to version 0.10.1 to better handle large SysEx MIDI messages on Linux r=padenot,supply-chain-reviewers
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch

This should be fixed now, at least in the nightly branch. Panu could you check if it works for you?

Flags: needinfo?(pmatilai)

Sure, inteded to test it couple of weeks ago already but there was something strange with that nightly build and didn't have a chance to really figure out whether it already had this fix or not. So, armed with the knowledge it is there now for sure, retrying:

With the latest nightly as of today, the Electra One editor seems to work just fine, whereas it previously choked pretty much on everything. So the operation appears a roaring success. Next stop, ask the Electra developer to drop their nag about using Chrome... once this lands in a release.

Thank you so much!!!

Flags: needinfo?(pmatilai)

Thank you!

Status: RESOLVED → VERIFIED
Regressions: 1977463
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: