musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
11.8k stars 2.56k forks source link

MuseScore 4.2.1 MIDI output and MIDI input not received #21795

Open zDEFz opened 4 months ago

zDEFz commented 4 months ago

Issue type

Other type of issue

Bug description

MuseScore 3 and 4 doesn't seem to get anything through either input or output direction.

Steps to reproduce

Preparation

  1. Install https://vmpk.sourceforge.io/ or a comparable package to send test MIDI events
  2. Install midisnoop
  3. Open midisnoop
  4. Configure [x] Driver | ALSA Sequencer [x] Input Port | ADI-2 DAC (51080( [x] Output Port | VMPK Input:in 13Cv
  5. Open vmpk > Edit > MIDI connections [x] Enable MIDI Input [x] MIDI IN Driver ALSA

[x] Enable MIDI Thru on MIDI Output [x] MIDI OUT Driver ALSA [x] Output MIDI Connection | midisnoop

  1. MIDI should be catched in midisnoop

Execution

  1. Now open MuseScore 4.2.1 ./MuseScore-4.2.1.240230938-x86_64.AppImage
  2. Open Preferences
  3. At I/O set comparable:

Audio Device [x] System default [x] Buffer size: 1024

MIDI

MIDI input: [x] ADI-2 DAC (51080054) MIDI output: [x] ADI-2 DAC (51080054)

Press OK.

  1. Now from the earlier steps, open vmpk again and go to MIDI connections like before. Only change: [x] Input MIDI Connection | ADI-2 DAC (51080054) [x] Output MIDI Connection | ADI-2 DAC (51080054)

  2. Open Musescore in note edit mode and enter a note via vmpk. Nothing happens.

  3. Open vmpk/midisnoop and look if from the Input Port we configured anything came over to midisnoop/. Nothing.

You are looking for e.g Timestamp Status 1709493381243 Note On, Channel - Note: 38 (D2), Velocity: 100 1

2 1709493381331 Note Off, Channel Note: 38 (D2), Velocity: 0

Sending in files for debug

  1. Open Musescore> Diagnostic > Save Diagnostic files Attach diagnostics

Trying to find similar issues

19337

19604

Trying on older MuseScore Version:

Try Setting up on MuseScore 3 similarly. No in/output.

Additional information:

diagnostics.zip

Screenshots/Screen recordings

Please read the instructions.

MuseScore Version

4.2.1

Regression

I don't know

Operating system

Archlinux latest

Additional context

Vanilla Arch Linux x86_64 with Kernel: 6.7.7-1-cachyos

zDEFz commented 4 months ago

Found some lead: https://aur.archlinux.org/packages/musescore-midi

I am compiling right now.

17308

Did not help.

I get a lot of those when I try to set the output:

1:45:51.002 | ERROR | main_thread     | ipc::writeToSocket | failed write to socket, err: "QLocalSocket::connectToServer: Socket access error"
21:45:56.150 | WARN  | main_thread     | IpcSocket::connect | failed connect to server
21:45:56.151 | WARN  | main_thread     | IpcSocket::connect | failed connect to server
21:45:56.151 | ERROR | main_thread     | IpcServer::listen | failed listen: "QLocalServer::listen: Address in use"
21:45:56.151 | WARN  | main_thread     | IpcSocket::connect | failed connect to server
21:45:56.151 | WARN  | main_thread     | Qt              | QIODevice::write (QLocalSocket): device not open
21:45:56.151 | WARN  | main_thread     | Qt              | QAbstractSocket::waitForBytesWritten() is not allowed in UnconnectedState
21:45:56.151 | ERROR | main_thread     | ipc::writeToSocket | failed write to socket, err: "QLocalSocket::connectToServer: Socket access error"
21:46:00.133 | WARN  | main_thread     | IpcSocket::connect | failed connect to server
21:46:00.133 | WARN  | main_thread     | IpcSocket::connect | failed connect to server
21:46:00.133 | ERROR | main_thread     | IpcServer::listen | failed listen: "QLocalServer::listen: Address in use"
21:46:00.134 | WARN  | main_thread     | IpcSocket::connect | failed connect to server
21:46:00.134 | WARN  | main_thread     | Qt              | QIODevice::write (QLocalSocket): device not open
21:46:00.134 | WARN  | main_thread     | Qt              | QAbstractSocket::waitForBytesWritten() is not allowed in UnconnectedState
21:46:00.134 | ERROR | main_thread     | ipc::writeToSocket | failed write to socket, err: "QLocalSocket::connectToServer: Socket access error"
21:46:02.428 | WARN  | main_thread     | IpcSocket::connect | failed connect to server
21:46:02.428 | WARN  | main_thread     | IpcSocket::connect | failed connect to server
21:46:02.428 | ERROR | main_thread     | IpcServer::listen | failed listen: "QLocalServer::listen: Address in use"
21:46:02.428 | WARN  | main_thread     | IpcSocket::connect | failed connect to server
21:46:02.428 | WARN  | main_thread     | Qt              | QIODevice::write (QLocalSocket): device not open
21:46:02.428 | WARN  | main_thread     | Qt              | QAbstractSocket::waitForBytesWritten() is not allowed in UnconnectedState
21:46:02.428 | ERROR | main_thread     | ipc::writeToSocket | failed write to socket, err: "QLocalSocket::connectToServer: Socket access error"

11220

But I do have sound playing back... Just no MIDI output.

Tried artifact https://github.com/musescore/MuseScore/pull/19246 Didn't succeed - same writeToSocket issues.

zDEFz commented 4 months ago

Workaround:

  1. Download https://github.com/diedeno/MuseScore/releases
  2. Download and install https://kushview.net/element/download/
  3. Restart Musescore...
  4. In the Mixer, add image
  5. Double Click the new Item
  6. "Add Graph" from the three dot menu / hamburger menu
  7. In Mixer, enable the new plugin and add MIDI through port
  8. Conect MIDI through port to INPUT
  9. Enable the > "Play" button so that it is green, if you want. It looks nice.
  10. image

See your Success!

image

zDEFz commented 4 months ago

Needless to say, the first note does seem to require to be played with a buffer of 1024, and increasing the buffer to 4096 makes MuseScore all stuttery for me. https://musescore.org/en/node/341622

Can we have a finer control? I can easily do 48KHz 64 samples. Don't forget, this workaround is experimental.

bkunda commented 4 months ago

Hi @zDEFz, It'd be helpful for us to know whether this problem can be reproduced on Ubuntu. Are you able to test this? If not, we'll get one of our QAs on to it.

zDEFz commented 4 months ago

Hi @zDEFz, It'd be helpful for us to know whether this problem can be reproduced on Ubuntu. Are you able to test this? If not, we'll get one of our QAs on to it.

What version of ubuntu? I do have one ready. I'll report in a bit.

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"

OK, so, I just tested.

Test Case

  1. Get the 4.2.1 appimage and execute it
  2. In I/O, set MIDI OUTPUT to your device. In my case: "ADI2-DAC"
  3. Download Pianoteq8 Demo
  4. In preferences listen to all MIDI available (one click)
  5. Check that you use the defaults (PulseAudio)
  6. In MuseScore, play back via Play button on a mscz

Expected

Something is on the MIDI line for PianoTeq8 to receive

Actual

Nothing is on the MIDI line for PianoTeq8 to receive

Important to mention

This is a clean new installment. I am not using the ADI2-DAC as my immediate DAC. In fact, in Ubuntu, my SMSL audio interface was chosen which sends S/PDIF out to my ADI-2 DAC FS, for the signal to be processed.

MuseScore does only show my ADI-2 DAC, not my other sound card (SMSL PO100 Pro) Why? Cause my ADI-2 DAC FS has a MIDI interface you can play with. It indeed doesnt have a physical MIDI port, but doesnt need to.

MIDI output could as well be a virtual output, but which MuseScore does not list.

tstibor commented 2 months ago

Enabling virtual devices MIDI devices on Linux exists since commit: Enable ALSA virtual MIDI devices So any version before this commit only finds true midi hardware via ALSA, no virtual such as snd_virmidi, snd_seq_dummy, etc...

zDEFz commented 2 months ago

Enabling virtual devices MIDI devices on Linux exists since commit: Enable ALSA virtual MIDI devices So any version before this commit only finds true midi hardware via ALSA, no virtual such as snd_virmidi, snd_seq_dummy, etc...

What is 'true' MIDI hardware? My ADI-2 DAC FS can do MIDI!

tstibor commented 2 months ago

'True' means any MIDI hardware which is not exposed via virtual midi kernel modules. The PR https://github.com/musescore/MuseScore/pull/20493 shows screenshots and explains it in more detail.