New issue
Advanced search Search tips

Issue 660197 link

Starred by 1 user

Issue metadata

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

Blocked on:
issue 672793



Sign in to add a comment

Web MIDI: MIDI output device is opened multiple times when input device is switched on.

Reported by j.ing...@netcologne.de, Oct 27 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36

Steps to reproduce the problem:
1. I have a MIDI keyboard attached to my computer. It is initially switched off. I also have the Coolsoft VirtualMIDISynth installed. This is the only software synth I have installed that Chrome detects.
2. go to http://james-ingram-act-two.de/open-source/assistantPerformer/assistantPerformer.html
   (Top pair of device menu contents in the attached .png.)
3. switch the keyboard power on. Chrome detects this event, and updates the available devices in the device menus. (Middle pair of device menu contents in the attached .png.)
4. switch the keyboard power off again. The (E-MU XBoard) keyboard is correctly removed from the device menus, but multiple entries for the VirtualMIDISynth remain (Bottom pair of device menu contents in the attached .png.).

What is the expected behavior?
Switching the keyboard on/off should just result in it being added/removed to/from the input device menu. All other available devices should remain unchanged.

What went wrong?
The VirtualMIDISynth is added multiple times to the output device menu. The actual number of times seems unpredictable. 

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 54.0.2840.71  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0

Apart from the Virtual MIDI Synth, the following devices also appear in the list of available output devices on my system:
-- Resident Software Synth: an experimental software device (A Web Audio application) installed on the site.
   The Resident Software Synth is not in the list of output devices detected by Chrome (I've added it programmatically to the output device select control).
-- TS22 PCI MIDI: a hardware sound card. This also appears in the list of output devices that Chrome detects.

See  Issue 58052   #11  and  #12 : these relate to VMS's reaction to attempts to re-open it, so may be relevant.

Chrome Version 54.0.2840.71 m
OS: Windows 10 Pro (up-to-date anniversary edition)
VirtualMidiSynth version 2.0.0-rc2
 
ChromeDeviceMenuStates.png
29.2 KB View Download
I've just seen something that I've never seen before:
1. reboot Windows (with keyboard switched off).
2. start Chrome.
(see screenshot)
a) The TS22 sound card appeared as an available, selected input device (!) (The keyboard is plugged in to the TS22's MIDI IN, but is switched off.)
b) There are multiple copies of the VirtualMIDISynth in the list of output devices. 

Tried again: Rebooted Windows, and restarted Chrome. The behaviour was as it should be with the input device selector set to "choose a MIDI input device", the output device selector set to "choose a MIDI output device" and the available output devices correct (as in the "Initial state" in the original report (above).

I've also noticed that repeatedly turning the keyboard on and off increases the number of entries for the VirtualMIDISynth in the list of available output devices.
1. ChromeInitialDevices.png
4.9 KB View Download
I get occasional problems with the Windows either not recognising the keyboard at all or not finding it again after being in sleep mode. So, suspecting that the problem may lie in a flaky keyboard driver, I tried updating it using the Windows device manager. (screenshot 1)
After searching the web, I was told that the driver is already up to date (screenshot 2).

It seems a bit odd that Windows classes "Audio, Video and Games controllers" as loudspeakers (output devices) rather than as input devices (see screenshot 1 and screenshot 2). Maybe that's not important, but I just thought I'd mention it.

Translation of screenshot 2: "USB-Audiogerät" means "USB Audio device". (My keyboard is NOT an audio device.)

DeviceManager.png
18.0 KB View Download
KeyboardDriverUpdateDialog.png
9.5 KB View Download
Cc: rbasuvula@chromium.org
Labels: TE-Hardware-Dependency

Comment 4 by tkent@chromium.org, Dec 14 2016

Components: Blink>WebMIDI

Comment 5 by dk...@chromium.org, Feb 6 2017

Owner: toyoshim@chromium.org
+toyoshim
toyoshim@, is this still an unconfirmed issue? Could you please help triage or route this appropriately?
Blockedon: 672793
Status: Started (was: Unconfirmed)
I confirmed that this issue happens on Windows 10 (probably with a specific Windows update) when the Windows MIDI system goes in a wrong state. The system actually returns multiple device entries and system reboot could fix this problem in my case.

Also VirtualMIDISynth is a third party driver that behaves differently from what our implementation assumes. I.e., the port can be opened even after the port is exclusively opened. That could be a reason of this problem.

I'm currently rewriting the backend to fix several problems (issue 672793). I believe it will fix this problem.

j.ingram:
Can you try Canary channel with following flag explicitly being flipped like below?
Implementation wasn't finished yet, but you could confirm if device enumeration works correctly. (sending and receiving functionalities may be not in the Canary yet)

chrome://flags/#enable-midi-manager-dynamic-instantiation => Enabled
chrome://flags/#use-winrt-midi-api => Disabled
Labels: M-58
Yes, I can confirm that device enumeration is now working correctly in Canary with the flags set as above.
More precisely: Live switching my keyboard works correctly in both input and output menus.
The VirtualMIDISynth is also fine.
Status: Fixed (was: Started)
Thanks!

Today I submitted all planned changes for m58.
So, probably I could enable this new backend on the m58.
(Now, it is enabled on Canary and Dev for 50% users)

I implemented new Web MIDI backend for Windows from scratch, and I believe this new backend can fix all long-living problems.

I want to figure out and fix all critical bugs while m58 is in Canary, Dev, and Beta. So, I'm very happy if you continue to play with this new mode.

@toyoshim: Please keep me posted about changes to the Canary implementation. I normally develop using Chrome, but will be happy to try things out as they appear. As you say, sending and receiving functionalities are not there yet...

You can track this design change progress by monitoring the issue 672793 (please check the star icon for mail notification).

All chromium side changes including new mode support for other platforms will be posted there, and I will post comments when field trial configuration is changed.

Thanks!
Understood. :-)

Sign in to add a comment