Closed Bug 1805593 Opened 2 years ago Closed 8 months ago

Firefox on osx must be quit and restarted to recognize new MIDI device using WebMIDI

Categories

(Core :: DOM: Device Interfaces, enhancement)

Firefox 108
enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1802149

People

(Reporter: maccailein.mor, Unassigned)

Details

Steps to reproduce:

Start Firefox on MacOS, navigate to a page that calls requestMIDIAccess, then plug in a midi device. Reload the page.

Actual results:

Device does not appear in midiAccess.outputs. If you quit Firefox and start it again with the device plugged in, the device is present in midiAccess.outputs.

Expected results:

Reloading the page should reflect changes to midi devices without quitting and restarting Firefox.

Summary: webmidi on osx has to be quit and restarted to recognize changes to devices → Firefox on osx must be quit and restarted to recognize changes to devices using WebMIDI
Summary: Firefox on osx must be quit and restarted to recognize changes to devices using WebMIDI → Firefox on osx must be quit and restarted to recognize new MIDI device using WebMIDI

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Device Interfaces' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Device Interfaces
Product: Firefox → Core

A similar behavior can be observed on Linux as well, where Firefox 118 doesn't detect MIDI devices are connected or disconnected until the page is reloaded.

@maccailein.mor, can you check what behavior you get with Firefox 118?

Flags: needinfo?(maccailein.mor)

I just checked it in 118.0.2. I have to close and restart Firefox after connecting a new device. There's a console message that Firefox silently denied requestMidiAccess because no devices were detected. Sorry, I'm not sure the exact words of the message, the closest mac is in another building.

I don't have an easy way to install 118 on my linux box at the moment to confirm what you're seeing.

Windows hotplug seems to be working for me in 118.0.2. No browser restart required.

Flags: needinfo?(maccailein.mor)

I think Bug 1802149 would fix this. I ran into it too.

(In reply to Vanessa Freudenberg from comment #4)

I think Bug 1802149 would fix this. I ran into it too.

I can't remember the exact history of this but I think there are two bugs, or at least different behavior on different OS. At the end of 2022 webmidi in Firefox was in a very dynamic spot. I think I suspected the hotplug bug was close to closing.

a.
On Windows and Linux (last I checked on recent deb and ubuntu) a reload will enumerate new midi devices. It would be nice if that fired a statechange event, but I can convince a user to reload the page and give them a nice big button to make that easy. I would call that the "hotplug" bug report referenced.

b.
On Macos you have to quit and restart Firefox. This is especially hard to explain to mac users because unlike other os, Firefox stays open even after all windows and tabs are closed. The best I can come up with is a message along the lines, "if using Firefox on macos and you don't see the device, hold cmd-q for a couple seconds, make sure everything is plugged in, then open Firefox and navigate here again." There's a nontrivial number of users who won't understand and follow those steps. I might be better off telling them to reboot.

I can work around (a.) by asking the user to refresh, but (b.) is much harder to deal with in application.

It's an amazing that any of this works at all. Being able to quickly implement cross-platform tools to work with audio hardware using a protocol with 40 years of compatibility is...wow. Many thanks to the Firefox coders making this a reality.

All that said, I'm comfortable merging this into the other bug report you mentioned from around the same time. It seems that discussion has brought up the specific macos behavior a few times, so this one is probably redundant.

Status: UNCONFIRMED → RESOLVED
Closed: 8 months ago
Duplicate of bug: 1802149
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.