command line mode should not require X server
Priority
P3 - Low
Type
Functional
Frequency
Few
Severity
S3 - Major
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project
hi,
on Ubuntu, in a console (Ctrl+Alt+F1):
mscore score.mscz -o score.xml
mscore.real: cannot connect to X server
it would be just nice if i could run the converting from the console...
thanks,
Kovi
Comments
Does anybody have an idea about this command line mode issue? As kovianyo I'd be glad about a hint how to use musescore's converting abilities without a running X server.
I'd appreciate a short reply - also a negative one.
Thanks
Are there any plans to support this feature?
thanks
MuseScore 1.2 and MuseScore 2 (development version) on Ubuntu 11.10 here: I regularly run it from a console and the conversions mscx->mscz, msc?->pdf, msc?->xml do work for both versions
It probably uses an X client, though, which is useless, takes resources and adds to startup time.
M.
when i run it from the gnome-terminal, it works. it only does not work when using real command line (Ctrl+Alt+F1).
but this is only a nice-to-have feature, i can imagine that the converting code also uses Qt.
i use a simple workaround to convert files on commandline.
my server is a CentOS 6.3 KVM-box running mscore 0.9.6.3.
just install a socalled "virtual frame buffer" - a "headless" X-server
~> yum install Xvfb
start in background:
~> Xvfb :0 -screen 0 800x600x16&
use your console/scripting-language like PHP:
system('export DISPLAY=localhost:0.0; /usr/local/bin/mscore music.xml -o music.pdf');
greets, mart;n
Can confirm that user "fatAngel" 's workaround worked for me on an Ubuntu machine with Musescore versions 1.3 and 2.0.
Cross-referencing to where I posted more details recently on post at URL:
https://musescore.org/en/node/29041
Quick workaround for Ubuntu users: you can use Xfvb as a headless X-Server to simulate having a display.
To run from commandline:
sudo apt-get install xfvb
xfvb-run mscore [options]
ex. xfvb-run mscore --version
In reply to #7 by tintinker
Another simpler way is to just set “QT_QPA_PLATFORM” environment variable to “offscreen” — no need for xvfb at all. Tested with MuseScore 2.1.
Similar issue on Mac OS: I'm running
mscore
for scripted conversions, and instead of running headless, the application opens up and steals focus every time (doesn't actually display any windows though).I don't know if this should be filed as a separate issue, or if this issue should contain both problems.
In reply to Another simpler way is to… by p-himik
Confirmed that the workaround from p-himik worked for me in Ubuntu 18.04 and MuseScore 2.1. Thanks for the tip!
The
QT_QPA_PLATFORM=offscreen
workaround does not work on Mac OS: I getand the problem persists with MuseScore 3.3RC.
The issue is that QFontDatabase class used by MuseScore to manage fonts (including those used for drawing musical symbols) requires QGuiApplication instance to be created which, in turn, normally requires graphical environment to be available. It might potentially be possible to use a platform plugin which doesn't require graphical environment but those don't seem to support application fonts (at least it is the case for
minimal
plugin). So it is unlikely that MuseScore could be run in non-graphical environments without using workarounds likexvfb-run
without reworking the entire application fonts management system.We might probably better close this as "By Design"
In reply to (No subject) by Jojo-Schmitz
It isn’t by design, though, is it? It’s an unfortunate consequence of Qt font rendering, perhaps.
But that fact that we do use Qt and that font rendering is by design
In reply to But that fact that we do use… by Jojo-Schmitz
Yes, but this issue regards the inability for MuseScore to run headless—and that’s not by design; it’s a bug. It may be a bug that’s not feasible to fix, given the technical constraints, but it’s still a bug.
That's why the issue is still open ;-)
Could be made "Won't fix" too...
In reply to That's why the issue is… by Jojo-Schmitz
Understood. If it were my project, I’d leave it open, but your standards might be different. :)
In reply to Understood. If it were my… by marnen
Check it out, this Dockerfile works
Indeed.
xvfb
is an X-Server.Fixed in branch master, commit f77eb5828a
fix #8970: remove space between accidentals and arpeggios
Is this actually fixed? The content of commit f77eb58 appears to contain nothing that would affect this, but I haven’t tested it yet.
Perfectly right
In reply to #7 by tintinker
it's right. Thanks.
As this issue tracker has been discontinued, reopen an an issue on GitGub, https://github.com/musescore/MuseScore/issues/new/choose