AppImage working with JACK 2 aka. jackdmp1.99

• Jan 21, 2018 - 20:39

First, this is a suggestion, not to be meant as complaining.
Since using the AppImage format (since musescore 2.0.3) musescore didn't work with the JACK2 transport layer. Look at the unsatisfying discussion here https://musescore.org/en/node/105361. I am not a nerd, but i couldn't let go and ( with a lot try and error) build my own AppImage from the sources. Unfortunately, there is no hint in the "Build from Sources" description, about the already existing possibility to build a portable AppImage direct from the sources. (of course to compile, link and install, "make" is more "nerdy" then install a package from the repositories)
A single command line instruction "make portable" will initialize the AppImage build, by creating the necessary directory "MuseScore.AppDir" and its contents. With the AppImageKit (which is an AppImage itself) i build my own MuseScore2.1.AppImage:
"./appimagetool-x86_64.AppImage MuseScore.AppDir"
The Important thing is that this AppImage runs with the JACK2 transport layer. The good thing is, it proves MuseScore.AppImages could work with JACK2, the bad thing is (for me), it seems that whoever build the downloadable AppImages uses the JACK1 version. Ubuntustudio64, AV-Linux, Linux Mint have JACK2 in their repositories
Maybe the maintainers could reconsider their decision to not support the two JACK versions. (see https://musescore.org/en/node/105361). For those who use JACK2, MuseScore without JACK is a big step back.
Macht es Sinn das noch mal in deutsch zu posten ?


Comments

Macht es Sinn das noch mal in deutsch zu posten ?
Not really, development happens in english.

The whole AppImage packaging process is in the code. If you managed to have MuseScore app image works with Jack, it would be great if you could explain how exactly and what could be wrong in our process.

In reply to by [DELETED] 5

Hi lasconic,
first I have to admit that my AppImage is not fully independent yet. It works on two different computers with Ubuntu Studio 16.04LTS installed, but one Computer with Linux Mint (on Ubuntu 14.0.4LTS) there were some libs missing. And in comparison with the official mscore2.1.AppImage there are some libs missing. I am a newbie with managing this AppImage stuff, but i will continue to work on that "JACK" matter. At the moment, my guess is that indeed the original AppImage has been bundled while working with the JACK1 kit. This guess comes because in discussion https://musescore.org/en/node/105361, "flufetor posted on Nov 26, 2017" that he had success by replacing JACK2 with JACK1. The JACK audio kit has two different versions with (on the upper level) identical behaviour, but the interface between the JACK1 client and Jack2 server or vice versa might be different.
Here's what I did:On my Ubuntu Studio computer I started with trying to create a debian packet from the sources. To be successful eventually I had to install a lot additional packets on my Ubuntu studio (not a surprise). This first attempt got me a musescore.deb, but it didn't work neither with jack nor with ALSA, but with pulse. ( I had messed up the make file) To be sure whether MuseScore V2.1would work with JACK2 I installed it with "make release" and "make install" but changed the prefix to my home directory and the label to "dev". That worked with JACK2. While working on the make file I saw the "make portable" possibility and tried it from newly downloaded sources. Than I looked for the musescore.AppDir and generated the AppImage with the appimagetool. I deinstalled and cleaned the previous installation and deinstalled every MuseScore.deb with synaptic (gui for the apt tool) The AppImage works still. Wether you start the JACK server by yourself, or let Musescore do it, it doesn't matter. I will work on the AppImage to get it work fully independent. I you can provide any suggestions what I could do to help to find a solution to the JACK problem, don't hesitate to tell me

In reply to by [DELETED] 5

Hi Iasconic, finally I've been successful Because my own AppImage build from Sources has still some libs missing, I downloaded a nightly build AppImage. I unpacked it by using loop-mount and replaced the originallibjack.so by my libjack.so (hardlink) and its origin libjack.so.0.1.0. Now AppRun complained missing libstdc++.6(hardlink) -> libstdc++.6.0.21. I added that lib too (both libs of Ubuntu 16.04 LTS). With the appimagetool I repacked the AppImage and now it works with 16.04, 14.04. To test 12.04. I revived my old lapptop with Ubuntu 12.04 and saw by using synaptic that this Ubuntu version uses the jack 1 (jackd1 v0.121) version by default. The support for that version ran out April 2017, but the packets are still available. I replaced the jack 1 by the jack 2 (jack2 v1.9.8).
jack1 and jack2 exclude each other. Unfortunately I couldn't test my AppImage yet, because my Ubuntu 12.04 is a 32bit version, my AppImage is 64bit. Probably I will try the 32bit version some when, if there is an appimagetool for this Ubuntuversion.
Replacing the jack 1 with jack 2 for further M.S. AppImage Versions is definitely on my wish list. But your team decide of course. If there is need for a verbose description, let me know . I have now a work around.

In reply to by Andreas3

So maybe one can simply add jackd2 to the list of dependencies in the apt-get -y install instruction for the Docker recipes
( build/Linux+BSD/portable/x86_32/Recipe and build/Linux+BSD/portable/x86_64/Recipe )
It should install Jack2 and at the same time uninstall Jack1.

In reply to by ABL

@ABL I have to admit, that I don't understand your comment, I am happy already to understand the AppImage handling a little bit. Imho, the newer Debian related distributions use the JACK2 audio kit. As long as you install MuseScore as a .deb packet with apt-get, or from the sources with make release, MuseScore will work with your JACK version. The AppImage however has everything inside itself and than you have to patch the current version(s), if your distri uses JACK2. I guess with snap or Flatpack, there will be the same problem, but the same solution also

In reply to by Andreas3

@Andreas3 : Indeed, I was talking about the way the AppImage is built by the server.
I think also libjack-jackd2-dev is needed in the system in addition to jackd2.

I managed to setup the automated AppImage build (the same used for MuseScore Nightly builds). Here are the AppImages with jackd2:
https://bintray.com/antoniobl/musescore-custom-nightlies/download_file?…

https://bintray.com/antoniobl/musescore-custom-nightlies/download_file?…

@Andreas3 : Could you please try if they work in your system?
Thank you for your help.

Ciao,
ABL

In reply to by [DELETED] 5

Hi lasconic, I testet the x86_64.AppImage. Unfortunately the image does not work yet. Therefore I loop mounted the image as MuseExtract/ and in /MuseExtract/lib there is (as supposed) the directory qt5/ and the libopenal.so.1, libporttime.so.0, libportmidi.so.0, libportaudio.so.2. But the libjack* and the stdc++* lib are missing. As expected with i686 Image it is the same.
I agree with ABL the the libjack-dev should be included.
The funny thing is that when I first tried to patch the nightly build some days ago, there was a libjack.so.
in the /lib directory. When I patched today the MuseScore 2.1 stable version, ther was no libjack*.so in the /lib, but the patch works anyway. I guess the automatic build doesn't put the libjacks etc. in the /lib directory yet.

In reply to by Andreas3

Meanwhile I looked into the nightly builds again. With the x86_64 now there are different error messages:
noJACK ERROR: Cannot read socket fd = 22 err = Datei oder Verzeichnis nicht gefunden
noJACK ERROR: Could not read result type = 22
noJACK ERROR: Client name = mscore conflits with another running client
noJACK ERROR: Cannot connect to the server

The message mscore conflicts... seems important.
To be sure I placed again those libjack... and libstdc.. files in the AppDir/lib and the nightly build works.
When I tried the i686 version crashed with ubuntu 12.04 with memory problems:
/tmp/mount/_b1Iwo0/AppRun: Line 18: 2717 memory access error..
But my Ubuntu 12.04 might be a bit messy and not used in years, so I would concentrate on my Ubuntu14.04 and 16.04.
When I tried the 32bit AppImage with my Ubuntu studio 64bit following error message occured: ./MuseScoreDev-201801251143-2.2-abbbfb8-i686.AppImage: error while loading shared libraries: libfuse.so.2: cannot open shared object file: No such file or directory
To be sure I placed the missing libraries into the AppDir/lib and the newly AppImage worked.
I'm sorry, that I can't provide better news.

In reply to by Andreas3

Yes, I saw your comment. Thank you very much for your help. I hope we will be able to tackle this problem in the end.
I see that the approach I was naively proposing is unfortunately not working. Now I am trying to locally reproduce the build chain (which uses a docker image to compile and pack the AppImage) to analyze and verify exactly which version of jack is used for compiling and linking.
I wonder if maybe completely leaving out libjack.so.0 and relying on the version provided by the system could be the way to go (the dependencies analysis shows libjack as "provided by both" the AppImage and the system in my machine), but I don't know if such a move would give problems (e.g. crash) in a system where Jack is not installed.
In principle, under Windows Jack dll is not bundled with MuseScore.
Still investigating...

Ciao,
ABL

In reply to by ABL

@ABl and lasconic,
I deinstalled the most of jack from my spare system with synaptic. Only libjack2 would have removed half of my systems multi media programs. Therefore I renamed the remaining libjack.so.0( and the links ) to rubbish. The "check-depends" showed jack as only provided by the package. The AppImage worked with Alsa and didn't with jack (as expected) but did not crash. I absolutely can understand, that it is pretty difficult to build the system in a way that fits all needs. And of course jack is more or less a Linux thing. If I can help somewhen again, let me know

In reply to by Andreas3

I tried to compile without embedding jack libraries and in my system it seems to be working.
Actually, I see a terrible lag, but it may be due to my Jack configuration (I am not an expert) or the fact that I am using a virtual machine to test the AppImage.
@Andreas3 : could you please test the following images, I think they should work now:
https://bintray.com/antoniobl/musescore-custom-nightlies/download_file?…

https://bintray.com/antoniobl/musescore-custom-nightlies/download_file?…

In the source there is a comment that Centos 7 needs this library which I took away from the AppImage bundle. At the moment I am installing a virtual machine running such OS to check if it gives problems.

In reply to by ABL

@ABL. with x86-64 success :-). I can start MuseScore with or without JACK starting separately. It is important also, that one can use ladish or similar Jack config tools prior to starting M.S., because my Interfaces changing whether I'm at home or on the road. With my configuration, I have no lag at all.
Her are the messages when starting from the command line:andreas@andreas-TERRA-PC:~/Downloads$ ./MuseScoreDev-201801271100-2.2-ee0763d-x86_64.AppImage
initScoreFonts 0x3528420
JACK: sample rate changed: 48000
JackAudio::connect
Audio port mscore:right ( 1 ) already connected to system:playback_2
qt.network.ssl: QSslSocket: cannot resolve SSLv2_client_method
qt.network.ssl: QSslSocket: cannot resolve SSLv2_server_method
Ignore SSL error: 6 The certificate has expired

The qt.network messages are not on the scope right now.
The i686-Image is complaining about a missing libfuse.so.2: on my 64bit system. I try it on my Ubuntu 12.04 soon. 12.04 is the last 32bit system I have, but I guess there are a lot of people still working with 32bit machines.

In reply to by Andreas3

Thank you again for your tests.
Unfortunately, in a system without Jack the AppImage was not working ("missing libjack.so.0").
I thus did some research and I found that we are not the only one having this problem, see:
https://github.com/LMMS/lmms/issues/3719
I followed a strategy similar to their solution: https://github.com/LMMS/lmms/pull/3958/files
and created PR: https://github.com/musescore/MuseScore/pull/3428
with a workaround similar to theirs.
I pushed it against 2.2 branch instead of master because I was working locally on 2.2. Sorry that I used the wrong workflow (which should be first on master and possibly to 2.2). In case, I can rebase the change on master (the PR should be completely identical).

I tested under Linux Mint 18.3 (64bit) with Jack installed and Centos 7 (64bit) without Jack in the system and MuseScore worked in both, with Jack connections in the system where it was installed.
I could not extensively test in a 32bit Linux environment.

In reply to by [DELETED] 5

Hi All
At first: It works!
I tested the 32Bit version with Ubuntu12.04 32Bit. It worked with jack. I couldn't test it without jack because my 12.04 is messed up. No ALSA and no Pulse produced any output even with audio configuration tests, but jack did. Then I used a Mint 17.1 32Bit life CD. The AppImage worked with ALSA, with JACK and with Pulse.:-o The life CD had no JACK server preinstalled, but the libjack.so.x (only this jacklib) was in the /usr/lib/i386-linux-gnu/ anyway. Therefore, when starting from command line, there was always the message: Jack appears to be installed on this system, so we'll use it., even when you couldn't use the M.S. jack settings. I renamed the libjack.so.x to rubbish. Still the message Jack appears to be installed on this system, so we'll use it. appeared, but the Musescore could not start. The libjack.so.x (either in /usr/lib/i386-linux-gnu/ or in /usr/lib/x86_64/linux-gnu/) seems to be essential at least in an Ubuntu system or it's forks, because it seems to be installed by default.
When the whole JACK (with server etc.) was installed, M.S. worked with jack. But the important this is: Whether jack was installed or not, M.S. didn't crash, but worked. The 32bit version does not work on my different 64bit systems. It complained about a missing libfuse.so. This lib is not in the /usr/lib/i386-linux-gnu/ only in /usr/lib/x86_64/linux-gnu.
The x86_64 version works also besides this maybe confusing message. It works with ALSA and Pulse and JACK.
If you like to have more specific tests let me know.

In reply to by Andreas3

I've tested the x86-64 AppImage with Gentoo Linux (64 Bit live CD). (Arch Linux or Suse have no LiveCD and i don't want to replace one of my Distris).
Started with the command line the message
"No jack... using Dummy..." appeared. Then the system complained about a missing libpulse.so. Even when invoked with --use-audio alsa it needed the libpulse. I added the pulse-audio package and the AppImage worked with the pulse settings or the alsa settings. Because adding pulse-audio needed over 4 hours, a have no intention to try to install Jack in this live environment. But so far the switch JACK / NoJACK seems to work

In reply to by Andreas3

@Andreas3 : Thank you for your testing.
I think we can stop testing for now: the change is present in the nightly build and hopefully more people with different Linux environments and configurations will be able to test it.
In principle, in the case in which Jack is not installed in the system, the AppImage will behave exactly as it was behaving before this change. So there should not be side-problems.

Regarding the strange behavior when manually deleting libjack.so.0:
The change implemented is a workaround which includes the bundled libjack in the AppImage PATH only if ldconfig does not report it as one of the libraries present in the system. When libjack is manually deleted, ldconfig will continue to tell its presence because it relies on its cache. I believe that updating ldconfig cache would solve that case.
But I don't think an end-user would try to manually delete system libraries on purpose :-)

Thank you for your efforts which brought to this solution :-)

Ciao,
ABL

In reply to by ABL

Getting a similar message trying to run MuseScore-3.0.0-x86_64.AppImage on AVLinux 2018.6.25 64 bit:

user@avlinux:~$ ./MuseScore-3.0.0-x86_64.AppImage
/tmp/.mount_t8tFXO/AppRun: line 15: ldconfig: command not found
Jack does not appear to be installed. That's OK, we'll use a dummy version instead.
QApplication: invalid style override passed, ignoring it.
QXcbConnection: XCB error: 3 (BadWindow), sequence: 2302, resource id: 16122270, major code: 40 (TranslateCoords), minor code: 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
QMutex: destroying locked mutex

I'd like to use Real Time Note Entry feature, is there a version of 2.x I could use or some other way this could work?

I tried running MuseScoreDev-201801271100-2.2-ee0763d-x86_64.AppImage , which does run and connect to jackd OK, but no notes from my MIDI controller keyboard appear when I enter Realtime automatic or Realtime manual modes. MIDI notes from my keyboard do appear in Step-time mode, but only after I've manually entered a note with the mouse, and then the notes from the keyboard keep stacking into a chord without advancing to the next beats.

Sorry I forgot about the new calendar year so didn't realize this thread was old.

In reply to by ttblum

@ ttblum :
Ok, don't worry, but next time please start a new thread :-)
From the command line log, it appears that the AppImage is not finding ldconfig, see the second line:
/tmp/.mount_t8tFXO/AppRun: line 15: ldconfig: command not found
so it is putting the path to the bundled version of jack in front of the LD_LIBRARY_PATH just before launching MuseScore.
I think you could solve the problem by putting the path to your ldconfig in the PATH, before launching the AppImage. Usually it can be found in /sbin, or /usr/local/sbin, /usr/sbin.
See for example http://blog.tordeu.com/?p=374
To avoid adding it to the PATH every time, you could append the ldconfig path to the PATH variable in .bashrc or .profile (depending on your shell, see https://serverfault.com/questions/261802/what-are-the-functional-differ… ).

Do you still have an unanswered question? Please log in first to post your question.