Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIDI access cannot be init first time unless reload #2821

Closed
wildfiremedia opened this issue Sep 17, 2015 · 4 comments
Closed

MIDI access cannot be init first time unless reload #2821

wildfiremedia opened this issue Sep 17, 2015 · 4 comments

Comments

@wildfiremedia
Copy link

Critical fix need for this issue on Windows, tested on 8/8.1 that can't properly initial midi port the first time Electron is run, it could only properly initialize after reload the page using remote.getCurrentWindow().reload()

All of these error have been tested exhaustively and conclude it's a bug.

var midi = null;  // global MIDIAccess object
var output = null;

function echoMIDIMessage( event ) {
  if (output) {
    output.send( event.data, event.timestamp );
  }
}

function onMIDISuccess( midiAccess ) {
  console.log( "MIDI ready!" );
//  var input = midiAccess.inputs.entries.next();
 // if (input)
 //   input.onmidimessage = echoMIDIMessage;
  output = midiAccess.outputs.values().next().value;
  if (!output)
    console.log("Uh oh! Couldn't get i/o ports.");
}

function onMIDIFailure(msg) {
  console.log( "Failed to get MIDI access - " + msg );
}

navigator.requestMIDIAccess().then( onMIDISuccess, onMIDIFailure );
@zcbenz zcbenz added the bug label Sep 18, 2015
@zcbenz
Copy link
Contributor

zcbenz commented Sep 18, 2015

Which version of Electron are you using? I got following output but I think it is because I don't have MIDI devices:

MIDI ready!
Uh oh! Couldn't get i/o ports.

Also can you try if it works in Chrome?

@wildfiremedia
Copy link
Author

The Uh oh! Couldn't get i/o ports. can mean 2 things, either there is no ports or the port open at the wrong steps/lifecycle.

I tried on latest Electron and Google chrome web browser with the same issue that tell me either V8 or W8.x have issue. I tried W7 early this year was fine. Note, I didn't have any firewalls or antivirus installed.

You can install any supported Virtual Midi e.g. LoopBe1, the output api from webmidi will show blank results, if we load the page, the device will appear. There is no race conditions from user end, I assume there might be a bug in V8 implementation.

On Friday, September 18, 2015, Cheng Zhao notifications@github.com wrote:

Which version of Electron are you using? I got following output but I
think it is because I don't have MIDI devices:

MIDI ready!
Uh oh! Couldn't get i/o ports.

Also can you try if it works in Chrome?


Reply to this email directly or view it on GitHub
#2821 (comment).

@zcbenz
Copy link
Contributor

zcbenz commented Sep 18, 2015

If it doesn't work in Chrome browser you should report it to Chromium's issues tracker instead, we are not able to fix it on Electron's side.

@zcbenz zcbenz removed the bug label Sep 21, 2015
@zcbenz zcbenz closed this as completed Sep 21, 2015
@proyb2
Copy link

proyb2 commented Sep 26, 2015

Updated Electron with Nodejs 4.1.1 works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants