djipco / webmidi

Tame the Web MIDI API. Send and receive MIDI messages with ease. Control instruments with user-friendly functions (playNote, sendPitchBend, etc.). React to MIDI input with simple event listeners (noteon, pitchbend, controlchange, etc.).
Apache License 2.0
1.52k stars 115 forks source link

Output not working on Archlinux #388

Closed sensn closed 7 months ago

sensn commented 9 months ago

Hello,

I can't get Output to send events on Archlinux(Chrome/Firefox). Input works fine ,I can recieve MIDI events from attached Device, but when I use playNote or sendCC i do not recieve the events on my device. Same code on Windows works. How can I fix this?

djipco commented 9 months ago

It is very hard for me to help you since I do not have this environment to conduct tests. Are you getting errors in the console or any form of hints that may help us help you?

sensn commented 9 months ago

Midi devices show up and work. In browser console no error, pure webmidi implementation of test alsay cant send but recieve,

cat proc/asound/seq/clients 
Client   0 : "System" [Kernel Legacy]
  Port   0 : "Timer" (Rwe-) [In/Out]
  Port   1 : "Announce" (R-e-) [In]
    Connecting To: 128:0
Client  14 : "Midi Through" [Kernel Legacy]
  Port   0 : "Midi Through Port-0" (RWe-) [In/Out]
    Connecting To: 128:0
    Connected From: 129:0
Client  24 : "SAMSUNG_Android" [Kernel Legacy]
  Port   0 : "SAMSUNG_Android MIDI 1" (RWeX) [In/Out]
    Connecting To: 128:0
    Connected From: 129:1
Client 128 : "Chrome (input)" [User Legacy]
  Port   0 : "port-0" (-w--) [Out]
    Connected From: 0:1, 14:0, 24:0
  Input pool :
    Pool size          : 200
    Cells in use       : 0
    Peak cells in use  : 6
    Alloc success      : 19
    Alloc failures     : 0
Client 129 : "Chrome (output)" [User Legacy]
  Port   0 : "port-0" (r---) [In]
    Connecting To: 14:0
  Port   1 : "port-1" (r---) [In]
    Connecting To: 24:0
djipco commented 8 months ago

Could you run this code in your environment and report with the results? It sends a note on message (middle C, full velocity) to all outputs using the bare Web MIDI API:

function onMIDISuccess(midiAccess) {
  console.log("MIDI ready!");
  midiAccess.outputs.forEach(o => o.send([0x90, 60, 0x7f]));
}

navigator
  .requestMIDIAccess()
  .then(onMIDISuccess, msg => `MIDI error: ${msg}`);
djipco commented 7 months ago

Since it's been 3 weeks and I haven't heard back, I will close this issue. @sensn Feel free to reopen if the bare Web MIDI API example from above does work in your environment.