New issue
Advanced search Search tips

Issue 725448 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression


Show other hotlists

Hotlists containing this issue:
Hotlist-1


Sign in to add a comment

Web MIDI: Chrome hangs up if users disconnect MIDI IN devices when Web MIDI is active

Reported by jon.knig...@gmail.com, May 23 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

Steps to reproduce the problem:
Example at https://jsfiddle.net/JonKnight/59hywskL/3/ 
1. Run the above fiddle
2. Connect a USB midi device - this should be reported in the output
3. Disconnect the midi device - no event is fired

What is the expected behavior?
The disconnect event should be fired when the USB device is removed.

What went wrong?
The disconnect state change event is never fired, and subsequent midi access doesn't work.
Also Chrome sometimes hangs.

Did this work before? Yes This works on the current version of Opera, which is on 58.0.3029.89 - Not sure about 58.0.3029.96.  Also, not been able to test with 58.0.3029.140.

Does this work in other browsers? Yes

Chrome version: 58.0.3029.110  Channel: stable
OS Version: 10.0
Flash Version: 

This functionality is used on a live site of ours, so we could obviously do with a fix as soon as possible.
 

Comment 1 by toyos...@gmail.com, May 23 2017

Thank you for reporting this issue.
We enabled a new backend on Windows recently, and this problem should be the new backend specific.

Could you try it with chrome://flags/#enable-midi-manager-dynamic-instantiation Disabled on Stable channel?

Also, could you share more information about your MIDI device?
New backend monitors device configuration change events to realize MIDI hotplug on Windows because Windows MIDI API does not provide such interface. But unfortunately, some MIDI devices continue to appear on a Windows API to enumerate MIDI devices for a while even after the device is disconnected. This time lag seems to be device dependent.

At this point, I notice that "ZOOM MS-50G" causes this problem very often.

Also, the lag may depends on Windows version. Could you clarify minor version of Windows 10 that you can find with winver.exe. The version should be something like 1703 that is the number of Creators Update.
Labels: Needs-Feedback
Owner: toyoshim@chromium.org
Oops, #1 was commented by my personal account.
Hi - thanks for the information.
My Windows build version is 14393.1198 (i.e. pre-Creators Update).
The hardware we've tried is an M-Audio Keystation Mini 32 controller, and a Marshall CODE 25 digital amp.
Changing the MIDIManager flag to disabled does seem fix the issue - I'll do some more testing tomorrow to check that nothing else is affected.
Is the default for this setting something that is likely to be updated in a new Chrome release, and if so do you have any idea of timescales?
Thanks.
Project Member

Comment 4 by sheriffbot@chromium.org, May 23 2017

Cc: toyoshim@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "toyoshim@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
I've done some more testing of midi after setting the midi manager flag to disabled, and everything seems to be working ok.
Labels: TE-Hardware-Dependency
On your machine, did the problem happen with all MIDI devices you had?

In another report, the problem happens only with with ZOOM MS-50G, and other devices work fine with his machine. Also he says the windows is pre-Creators Update.

I have one M-Audio keyboard at home though it's a different product. But it would worth trying. Let me try.
Status: Started (was: Unconfirmed)
A fix is under review. This could happen on MIDI input devices, that may depend on device driver implementation, and Win32 API internal behavior that may differ on recent versions.
Project Member

Comment 9 by bugdroid1@chromium.org, Jun 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8f7cc644d6f5c422e32a8886fa58a2e3b5c059ee

commit 8f7cc644d6f5c422e32a8886fa58a2e3b5c059ee
Author: Takashi Toyoshima <toyoshim@chromium.org>
Date: Thu Jun 01 14:02:29 2017

Web MIDI: fix a deadlock issue on unloading some input devices

After disconnecting some input devices, the next midiInGetNumDevs()
call invokes a callback with MIM_LONGDATA for the disconnected device,
and never returns until the callback completes.
This is unexpected control dependency, and causes a deadlock.

BUG= 725448 

Change-Id: I39733e4df31223de8f2b7f8e031711496e10ff4a
Reviewed-on: https://chromium-review.googlesource.com/519083
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#476273}
[modify] https://crrev.com/8f7cc644d6f5c422e32a8886fa58a2e3b5c059ee/media/midi/midi_manager_win.cc

Labels: Merge-Request-60
Labels: -Arch-x86_64 -Hotlist-Interop
Project Member

Comment 12 by sheriffbot@chromium.org, Jun 2 2017

Labels: -Merge-Request-60 Hotlist-Merge-Approved Merge-Approved-60
Your change meets the bar and is auto-approved for M60. Please go ahead and merge the CL to branch 3112 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), josafat@(ChromeOS), bustamante@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 13 by bugdroid1@chromium.org, Jun 3 2017

Labels: -merge-approved-60 merge-merged-3112
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bc288350e64bb6e17759f3a409b9406f89af9e0b

commit bc288350e64bb6e17759f3a409b9406f89af9e0b
Author: Takashi Toyoshima <toyoshim@chromium.org>
Date: Sat Jun 03 09:50:45 2017

Web MIDI: fix a deadlock issue on unloading some input devices

After disconnecting some input devices, the next midiInGetNumDevs()
call invokes a callback with MIM_LONGDATA for the disconnected device,
and never returns until the callback completes.
This is unexpected control dependency, and causes a deadlock.

BUG= 725448 

(cherry picked from commit 8f7cc644d6f5c422e32a8886fa58a2e3b5c059ee)

Change-Id: I39733e4df31223de8f2b7f8e031711496e10ff4a
Reviewed-on: https://chromium-review.googlesource.com/519083
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#476273}
Reviewed-on: https://chromium-review.googlesource.com/523345
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/branch-heads/3112@{#132}
Cr-Branched-From: b6460e24cf59f429d69de255538d0fc7a425ccf9-refs/heads/master@{#474897}
[modify] https://crrev.com/bc288350e64bb6e17759f3a409b9406f89af9e0b/media/midi/midi_manager_win.cc

Labels: M-60
Status: Fixed (was: Started)
The issue was fixed on m61 and the fix is merged to m60.

I guess merging this to m59 would not meat the bar.
 Issue 732650  has been merged into this issue.
 Issue 733368  has been merged into this issue.
Status: Started (was: Fixed)
Summary: Web MIDI: Chrome hangs up if users disconnect MIDI IN devices when Web MIDI is active (was: WebMidi device disconnect problem)
Let me keep this bug open until m60 goes to the Stable so that users can find this existing bug entry to know current status.

The problem is already fixed, and the fix was merged to beta branch. On the stable channel, the problem should be fixed at Chrome 60.
Just to clarify, is this the following bug?

 1. request MIDIAccess
 2. listen to "statechange" on MIDIAccess
 3. turn on MIDI device -> "statechange" fires
 4. listen to "midimessage" on an input port of MIDIAccess
 5. turn off MIDI device -> "statechange" does NOT fire, but it should
 6. try to close tab, chrome freezes completely

Strangely though, this bug appeared in Chrome 59 for us, there were no issues in 58.
Yes - that's the problem that we experienced.
We know that it worked in 58.0.3029.89, but first noticed it had a problem in 58.0.3029.110 - I'm not sure about any intermediate versions.
#18
Yes, exactly.

I flipped server managed configuration for m58 and m59 at the end of April and that caused this deadlock issue. If you manually set chrome://flags/#enable-midi-manager-dynamic-instantiation to Disabled at m58, you could escape from this issue. Also, until the end of April, m58 should have worked without this issue by default.

m59 can work if you manually set chrome://flags/#enable-midi-manager-dynamic-instantiation to Disabled. But you need to reset it to Default or Enabled when m60 comes. The flag won't make any difference after m61.

Sorry for inconvenience.
Status: Fixed (was: Started)

Sign in to add a comment