Building and Packaging on XStreamOS misses fonts
Hi,
I'm excited to package MuseScore with our new XStreamOS Desktop based on illumos kernel.
What happens, is that fonts are not installed in the prototype area.
I used cmake and then gmake lrelease and gmake install DESTDIR="..."
I got the prototype area with usr/bin usr/lib user/share/* but fonts from sources are not there.
Application runs, but only in debug mode showing fonts are obviously not there.
What may be the reason?
Gabriele.
Comments
I guess you'd better as this in the forums or on the developers mailing list rather than here in the issue tracker.
During the build process the fonts are not installed but packaged in the mscore executable, so if you don't see the noteheads, clefs etc... it's probably because Qt doesn't do a good job of loading these fonts from the virtual filesystem on your OS. Did you build Qt yourself? Can you debug the font loading process?
here is mscore running in debug mode:
Yes I build qt-everywhere-opensource-src-4.8.4 myself.
Should I check if internal font-loading is supported?
How can I see if my binary is built with internal font correctly?
Maybe some difference in solaris-like environment while linking?
These 3 lines are denoting the problem of internal font loading
Mscore: fatal error: cannot load internal font
Mscore: fatal error: cannot load internal font
Mscore: fatal error: cannot load internal font MuseJazz.ttf
You may want to take a look around line 1919 in mscore/mscore.cpp. MuseScore calls
QFontDatabase::addApplicationFont
and this is failing.Not sure how you can check if the font are correctly embedded in the binary. It's done during the build phase, the fonts are mentioned in mscore/mscore.qrc and should be picked when this file is processed. You should see a file qrc_mscore.cpp or something similar in your build directory.
To learn more about the resource system of Qt you can check http://qt-project.org/doc/qt-4.8/resources.html
I'm curious to see a screenshot of MuseScore on your system :)
Thanks for the guidelines, these should be enough tips to find the problem ;)
I'll get back to you as soon as I've solved the font problems, and attach a screenshot here
with some of my Sibelius scores imported and running inside MuseScore on XStreamOS Desktop :)
I checked the running mscore with "truss" to see system calls.
I see that just before the error on loading the font, there are calls to open/stat(":/fontfile").
These are file system calls, so in some way qt is not looking at the embedded file, but tries to find it
in the file system.
So, my question is: are all the button icons still embedded resources?
If yes, then qt is ok, because it loads icons correctly.
So maybe the problem is just around font, and addApplicationFont?
Don't you know of any similar problem on solaris like env?
I found a temporary solution:
- patched mscore.cpp to load fonts from "/usr/share/fonts/mscore/..."
- packaged with delivery of /usr/share/fonts/mscore/*.ttf
And now I have a very nice score layout in front of me! :)
Still some bits to resolve....some scripts are not loaded....will get back later...
Later also for a screenshot ;)
Ok. That's great! Only the musical fonts are loaded from the embedded filesystem. Most of the icons are svg/png I think. Your patch is good but it will be slower to load the font. The best way would be to investigate why QFontDatabase::addApplicationFont doesn't work well on your system and then patching Qt since it would benefit other apps on your system.
The non loaded scripts are most likely due to the plugin framework. It's kind of optional so Musescore should be working now.
Here you go with a couple of snapshots!
Just exported from Sibelius two scores I edited a while ago, into xml format.
Loaded, and here they are, almost perfect!
And I must congratulate with you guys, I never tried musescore before, and I waited to have it
built on XStreamOS for my first experience with it.
I have to tell you, the editing is very comfortable, sometimes even faster than Sibelius.
I used to work at a project of my own in the past, called JComposer, same idea, in Java+Swing and Java2D.
Then I stopped, not enough time!
I hope I can help this project, I may help coding here and there ;)
What I find a bit retro, is the qt4 interface. Do they have plans to modernize it?
Well, the current code base needs Qt5.1 or higher...
I'm using mscore-1.3 sources, and they like my qt4:
-- Found Qt4: /usr/bin/qmake (found suitable version "4.8.4", required is "4.6")
Should I step up to a newer mscore + newer qt?
If you're interested in the next version, you'd have to ;-)
Sure I am :) but that would require me to use the git code base, and maybe package a non stable
version...am I wrong?
right. But that is the version all development takes place on, 1.3 won't receive further fixes
Cool! Yes, you will need at least Qt 5.1 and preferably the last one Qt 5.2 to compile and run MuseScore git master. The interface should be different and the same on all the OSes.
There is a lot more new things in MuseScore git master that should become MuseScore 2.0 "soon"...
I'll give it a try ;)
having qt5 latest is a good thing for our distro, so I will start with this.
is it backward compatible with qt4? I mean, should I deliver both or just have the latest one?
Then, I'll check out the git code and let you know.
Thanks! Cool stuff!
Now I'm trying to get it to play something.
XStreamOS, as a Solaris derivative, has OSS engine.
I have packaged alsa-lib plus plugins to have alsa work over OSS.
Using alsa utils (aplay) it just works fine.
mscore always come out with this (ran with -d):
Alsa_driver: can't set period size to 1024: Invalid argument
init ALSA audio driver failed
init ALSA driver failed
init audio driver failed
We deliver a special conf file for alsa lib to work with oss, /etc/asound.conf:
pcm.oss {
type oss
device /dev/dsp
}
pcm.!default {
type oss
device /dev/dsp
}
ctl.oss {
type oss
device /dev/mixer
}
ctl.!default {
type oss
device /dev/mixer
}
This works with alsa play.
Do you have any idea what's happening?
Can you attach a screenshot of your Preferences -> I/O in MuseScore? Do you use ALSA directly there or did you build support of Portaudio? Portaudio could possibly talk directly to OSS.
I use ALSA directly, don't have Portaudio package at the moment, but this "sounds" interesting ;)
Here is the screenshot, anyway
Update about audio playback.
It now works!
I had to package and install portaudio, then rebuild musescore with portaudio, but at first it didn't work.
The I/O panel didn't let me choose any device for portaudio.
So looking at the build log, I could see it had both taken alsa and portaudio, but portaudio was including
alsa as a layer.
So I patched CMakeLists.txt to default with:
set (USE_ALSA 0)
set (HAS_MIDI 1)
on my build, as it does with APPLE.
This allows portaudio to work perfectly on OSS.
I could not make an "if" section, but just patched to just set as I needed.
I don't know what system cmake will detect on my OS, as it does with APPLE and MINGW.
Do you know how to check this?
You could try to add this two lines
# the complete system name, e.g. "Linux-2.4.22", "FreeBSD-5.4-RELEASE" or "Windows 5.1"
MESSAGE( STATUS "CMAKE_SYSTEM: " ${CMAKE_SYSTEM} )
# the short system name, e.g. "Linux", "FreeBSD" or "Windows"
MESSAGE( STATUS "CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME} )
Any news ?
No new for 4 years. I guess MuseScore is available for XStreamOS or there is no need anymore. I close this issue. Please reopen if needed.