JACK Audio on Musescore 3.x not working

• Mar 3, 2019 - 21:08
Reported version
3.0
Priority
P1 - High
Type
Performance
Frequency
Many
Severity
S3 - Major
Reproducibility
Always
Status
fixed
Regression
No
Workaround
Yes
Project

Steps to reproduce bug:
0. Set up JACK audio server (multiple tutorials on the forums)
1. Open MScore 3.0.x
2. Go to Edit > Preferences > I/O
3. Select the "JACK Audio Server" box
4. Close MuseScore
5. Run JACK Audio Server
6. Open MuseScore

Expected Behavior:
In JACK audio server, MuseScore will be listed under the Readable Audio or MIDI Client tabs. Musescore 2.x shows up as "mscore"

Actual Behavior:
No change is shown, MuseScore 3 is not listed in the server

Workaround:
Don't use JACK
Use Musescore 2

Discussion:
JACK Audio Server worked flawlessly on MS 2, I've never been able to get it working on MuseScore 3.
Both of my Windows 10 machines have this issue.

Operating System, version:
Windows 10 x64
Musescore 3.0.4.5763 (stable)


Comments

Exactly the same problem here. Works fine in version 2, but not in verson 3.0.5

OS: Debian GNU/Linux 9 (stretch), Arch.: x86_64, MuseScore version (64-bit): 3.0.5., revision: 58dd23d

I'm not an expert on this, but here is my understanding:

Lots of 64-bit systems use 32-bit apps, because many vendors don't want to have to build and support both, and 32-bit versions work on both architectures. Until MuseScore 3, we always shipped our executable as 32-bit. JACK gives you both options, because the 32-bit version can only talk to other 32-bit apps, and same for 64. Sounds like JACK came pre-installed for you, and my, guess is, it came as 32-bit like MuseScore 2 did and many others apps do.

So, if you are finding JACK can talk to MuseScore 2 but not 3, that is pretty strong evidence you are actually using the 32-bit JACK. Try installing the 64-bit version. You'll also need 64-bit versions of all the apps you want to connect to.

Same problem in ubuntu studio 19:04, MS3 not working with JACK audio and MS2.3.2 has not midi channels in the mixer. I hope one day MS works correctly and can use a vst on independently midi channels.

Did you build MuseScore yourself? If not, can you try, using Qt 5.12.4? For me on Windows 10, a current build against Qt 5.12.4 does work - it shows up in the JACK connection window, and I was able to use it to drive the playback in (what else?) MuseScore 2.

I don't know that Qt 5.12.4 is really the differentiator, but it seems a likely guess. 3.2.3 certainly does not work for me out of the box.

See my comment above. As far as I know, it's already working currently on Windows, at least for me. I'm suspecting it might have been a Qt biug that is now fixed already.

In reply to by Marc Sabatella

I downloaded 'MuseScoreSpecial-2018-09-20-0904-master-c07ed54-300-file-format.7z' which was the latest one on the dev page, and still no detection. Clicked the Jack tickboxes in Musescore IO page and closed down; Jack was set up as per the numerous tutorials, clicked Start to start the server; then restarted Musescore and still only have the system/system MIDI connections.

Windows 10 Home 64bit. My usual Musescore is the stable release 3.2.3.7635. Jack is 64bit version 0.3.13.10. (the splash page says Jack session support disabled, no idea if that's relevant, it's a build from 2015).

it didn't detect Musescore 2 either, which makes me wonder whether I'm not setting it up correctly or missing out a stage...

First, that's nowhere near the latest, it's actually very old (notice the date, 2018-9-20). The second one on the list is the latest. This is explained above on that page, poorly, and I think it's past time to remove that old "special" build. But anyhow, as I explained above, I think the key is the version of Qt that MuseScore is built with. MuseScore 3.2.3 uses 5.9.6 (?), the nightly builds for Windows currently use 5.12.3, I am using 5.12.4. For me, my own build using 5.12.4 works. MuseScore 3.2.3 does not. Not sure about the nightly build, but feel free to try it (the current one, the old special one isn't good anything any more).

MuseScore 2 was 32-bit, so I think it might be normal the 64-bit version of JACK wouldn't detect it. but MuseScore 3 is 64-bit. There were special 64 bit builds of MsueScore 2 floating around, and 32 bit builds of MuseScore 3, but better to just use the correct version of JACK for your version of MuseScore.

I'm using MuseScore 3.2.3 in Ubuntu 18.04 64 bit with Jack server installed with KxStudio and it is working, what is really important for me as well. Actually I've been always using the newest version from MuseScore, so I tested all releases 3.x as well as the later 2.x ones and it always worked. Always getting the pre-compiled Linux Appimage. I'm even using it together with GrandOrgue using midi Jack connections to control GrandOrgue live from MuseScore. What I still didn't test is using MS midi input.

It's an option when building. But if there is a difference, it more likely to have to do with MinGW vs MSVC. I suspect it will turn out not to be that, though, and maybe something else about our environments - version of JACK, some difference in device driver or DLL's we have loaded, etc.

I can confirm this issue: Windows 8, MS 3.2.3.7635, Jack 1.9.11 (64-bit JackRouter.dll registered). No Jack support means no xjadeo, so no video sync.

This is still an issue for Windows, from 2.1 to 3.3, even the nightly version. The playback controls are greyed out, and MuseScore does not appear in the JACK control panel.

However, the 32 bit version works fine... kind of. A few days ago, I tried the latest stable 32 bit installer to see if that would fix the issue, and while everything seemed functional, the playback was botched, it played every note instantaniously. So I tried the 2.x of MuseScore, which is only available precompiled for 32 bit, and JACK was back to being nonfunctional. I tried some other versions, then gave up.

Today though, I was changing the i/o devices for JACK to use Windows DirectSound, since I was having issues with Ardour connecting with JACK, and ASIO4ALL was hogging the output, ALSA style, I decided to give 32 bit MuseScore another chance... and it worked!

Windows DirectSound + 32 bit MuseScore fixes the issue on my end. I feel maybe it's both JACK and MuseScore have overlapping bugs, as the 64 bit version doesn't connect with Jack, and 32 bit version only connects when JACK is configured to use certain devices. I could do some experimenting, but since it works now I'm afraid of breaking it :/

TL;DR: Try the 32 bit version, and experiment with different Jack device configuration. It may also be worth installing an older version of JACK

In reply to by Marc Sabatella

Yes, I think this could be the issue for Windows:
https://github.com/musescore/MuseScore/blob/3.3/mscore/jackweakapi.cpp#…

libjack is stored in two locations for 32 bit and 64 bit:
- C:/Windows/libjack64.dll
- C/Windows/SysWOW64/libjack.dll

64 bit JACK has the suffix 64.dll, which is unaccounted for. But this is only for Windows, as JACK on my Arch Linux system uses libjack.so for both 32 bit and 64 bit packages. It's also possible that jackweakapi is not how JACK is handled by MuseScore, but this was the best match I could find searching for how JACK is supported.

EDIT: I did a quick check, MuseScore interacts with JACK flawlessly on my Arch system. I'm thinking this is just an issue with MuseScore not being able to finding and link against libjack at runtime.

I also think this might be a good initiative to add an error dialogue for if MuseScore is unable to connect with JACK, instead of just greying out the playback controls.

Also occurs on Debian 10 -- with Musescore 3.3.3 -- current appimage,
(fwiw, jackdbus is being used)

Here I have all settings for Jack enabled except 'Jack Audio'. I exit Musescore, and re-launch the application from terminal and I get this on output as soon as I do a checkmark on 'Jack Audio'. Just by clicking the on the checkbox Musescore crashes here.

At the end of the output, there's a mention of line number with
"/tmp/.mount_MuseScdQJPIA/AppRun: line 48: 24501 Segmentation fault "${APPDIR}/bin/mscore-portable" "$@""

"user@debian:~/local/musescore$ ./MuseScore-3.3.3-x86_64.appimage
/tmp/.mount_MuseScdQJPIA/AppRun: line 22: ldconfig: command not found
/home/user/other/opt-binary-user/musescore/MuseScore-3.3.3-x86_64.appimage: Using fallback for library 'libjack.so.0'
no message buffer overruns
no message buffer overruns
no message buffer overruns
unknown option character l
jackdmp 1.9.12
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2017 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
no message buffer overruns
no message buffer overruns
no message buffer overruns
`default' server already active
Failed to open server
QXcbConnection: XCB error: 3 (BadWindow), sequence: 1047, resource id: 25168059, major code: 40 (TranslateCoords), minor code: 0
OpenType support missing for "TakaoPGothic", script 11
OpenType support missing for "TakaoPGothic", script 19
QXcbConnection: XCB error: 3 (BadWindow), sequence: 4929, resource id: 25168071, major code: 40 (TranslateCoords), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 5490, resource id: 25168075, major code: 40 (TranslateCoords), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 12674, resource id: 25168079, major code: 40 (TranslateCoords), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 12802, resource id: 25168083, major code: 40 (TranslateCoords), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 15928, resource id: 25168087, major code: 40 (TranslateCoords), minor code: 0
qml: hello scorelist
qml: Score
QXcbConnection: XCB error: 3 (BadWindow), sequence: 33572, resource id: 25168106, major code: 40 (TranslateCoords), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 43585, resource id: 25168124, major code: 40 (TranslateCoords), minor code: 0
/tmp/.mount_MuseScdQJPIA/AppRun: line 48: 24501 Segmentation fault "${APPDIR}/bin/mscore-portable" "$@"
"

Syncing jackweakapi.cpp with Jack's version fixes the issues; that pull request should get merged.

The only other issues with JACK playback are these two issues:
https://musescore.org/en/node/294834
https://musescore.org/en/node/294836

Once these get resolved (I'm looking into submitting a pull request), JACK with MIDI playback should work perfectly, however, using JACK on non-Linux systems feels a bit unnecessary. MuseScore doesn't utilize JACK to its full potential, as instruments are set to use a specific channel instead of having separate JACK signals for each instrument. This isn't a bad thing, as the only application to truly support JACK I've found is Ardour, so with most other applications you would want to send the signal to a system MIDI input.

I'm still relatively unfamiliar with MIDI and audio systems in general, but it would be nice if MuseScore could somehow cut out the middle man and send MIDI signals to a generic system midi input, to then be handled by a VST host or DAW. Even more ideally would be to have MuseScore host VSTs itself, but that seems like too large of an undertaking to be worth it.

In reply to by chrdoot

Workaround No Yes

For now, I just copied "libjack64.dll" to "libjack.dll", and it's now showing up in the Jack control panel. So they're still both the 64bit version, but Musescore can find it now.
This is the first time trying this with musescore/jack and windows. I think there's a way to create a symbolic link in Windows now, but wasn't sure... but that should work too.

I also (probably need admin privileges) de-registered the 32-bit dll which is registered by default:
regsvr32 /U "C:\Program Files (x86)\Jack\32bits\jackrouter.dll"

then registered the 64bit version:
regsvr32 "C:\Program Files (x86)\Jack\64bits\jackrouter.dll"

In reply to by Jojo-Schmitz

More related to the note editing interface, but it's too difficult to use JACK with these two issues in place. I'm seeing about getting a pull request to fix these, and I have some other changes I'd like to make (as separate PRs), but this issue isn't the right place to discuss them.

Status PR created fixed

Fixed in branch master, commit 1ebceeab8e

_fix #285307: JACK Audio on Musescore 3.x not working +collect_artifacts

syncing our jackweakapi.cpp with https://github.com/jackaudio/jack2's
JackWeakAPI.c (commenting out new(?) APIs we most probably don't use
anyhow)
This minimizes the diffs between those 2 files and should bring
MuseScore 3 64bit back to play along with Jack._

Fix version
3.5.0