Crash when using Eighth Notes with Real-Time(Manual) Input
1) Create a new score
2) Set note input to Real-Time (manual)
3) Set note length to eighth
4) Press and hold any key on a midi keyboard or virtual piano keyboard
5) Press enter or real-time advance three times
6) Musescore crashes
Tested on Arch Linux
STDOUT logs:
unknown:unknown: changeState NORMAL -> NOTE_ENTRY
unknown:unknown: unknown cmd
unknown:unknown: midiNoteReceived: pitch 60, chord 0, velocity 57
unknown:unknown: Internal error: shortcut <> not found
unknown:unknown: unknown cmd <>
qrc:/qml/palettes/Palette.qml:onStateChanged: STATE CHANGED
qrc:/qml/palettes/Palette.qml:onStateChanged: STATE CHANGED HOVERED
unknown:unknown: midiNoteReceived: pitch 64, chord 1, velocity 71
unknown:unknown: Internal error: shortcut <> not found
unknown:unknown: unknown cmd <>
unknown:unknown: midiNoteReceived: pitch 60, chord 0, velocity 0
unknown:unknown: Internal error: shortcut <> not found
unknown:unknown: unknown cmd <>
unknown:unknown: Pitches match! Note 60, Pitch 60
unknown:unknown: midiNoteReceived: pitch 65, chord 1, velocity 56
unknown:unknown: Internal error: shortcut <> not found
unknown:unknown: unknown cmd <>
unknown:unknown: midiNoteReceived: pitch 64, chord 0, velocity 0
unknown:unknown: Internal error: shortcut <> not found
unknown:unknown: unknown cmd <>
unknown:unknown: Pitches match! Note 64, Pitch 64
/build/musescore/src/MuseScore/libmscore/durationtype.cpp:unknown: ASSERT: "truncate || (fraction() - l).numerator() == 0" in file /build/musescore/src/MuseScore/libmscore/durationtype.cpp, line 438
Aborted (core dumped)
Comments
I can reproduce the exact symptoms with eighth notes and shorter, which makes realtime not input basically unusable. Quarters or longer have no issue.
Let me know if I can provide anything else (logs, debug traces, etc).
I did some testing today. I cannot reproduce the issue on a Windows 10 machine. I've only reproduced it on Linux. I've tested the ALSA, Pipewire, and JACK backends and they all crash. Based on frnx's other bug report is seems we're both using Pipewire/JACK, so this is likely to be an issue exclusive to Pipewire.
Furthermore, I've managed to reproduce it in new ways. It happens in both automatic and manual real-time modes. It seems to be the insertion of the fourth quarter note that causes it, no manual advance necessary. You can put in three quarter rests and hit any MIDI key and it will crash.
I spent some time getting a MuseScore build up and running with gdb and tracked the root cause down.
I haven't yet looked into how to get it integrated into MuseScore as I'm not too familiar with the contribution process, but here's a patch that appears to fix the issue for me (see attachment).
I'm not exactly sure as to how the issue is not more widespread, because from what I can see it has nothing to do with Pipewire.
See https://github.com/musescore/MuseScore/pull/9593 (for 3.6.2), https://github.com/musescore/MuseScore/pull/9000 (includes this for the 3.x branch) and https://github.com/musescore/MuseScore/pull/9593
Fixed in branch master, commit 4d289d8864
_Fix #321716: Realtime note entry 8th crash
Port of #9593_
Fixed in branch master, commit a4138fb147
_Merge pull request #10199 from Jojo-Schmitz/321716-fix-noteentry-8th-crash
[MU4] Fix #321716: Realtime note entry 8th crash_
Automatically closed -- issue fixed for 2 weeks with no activity.