Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 794163

Summary: media-sound/musescore-3.6.2: freezes, consumes 100% CPU
Product: Gentoo Linux Reporter: globus <yoric-k>
Component: Current packagesAssignee: Gentoo Sound Team <sound>
Status: UNCONFIRMED ---    
Severity: normal CC: 89q1r14hd, fordfrog, jstein, louis.frayser, sam
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: .xsession-errors
strace out
genlop -l listing since I last installed MuseScore

Description globus 2021-06-04 13:52:38 UTC
Hello, sorry my bad English.
Almost every launch freezes, consumes 100% CPU and clogs up .xsession-errors. I am attaching the information. Deleting configs does not help.

Reproducible: Always

Steps to Reproduce:
1.Just start 
2.Maybe you need to upload a score
3.
Actual Results:  
freezes, consumes 100% CPU and clogs up .xsession-errors
Comment 1 globus 2021-06-04 14:53:27 UTC
Created attachment 713631 [details]
.xsession-errors
Comment 2 globus 2021-06-04 14:54:21 UTC
There is sound in the system, qmmp is playing.
Comment 3 globus 2021-06-04 14:55:50 UTC
$ emerge --info
Portage 3.0.18 (python 3.8.9-final-0, default/linux/amd64/17.1/desktop, gcc-10.2.0, glibc-2.32-r7, 5.10.27-gentoo-m1 x86_64)
=================================================================
System uname: Linux-5.10.27-gentoo-m1-x86_64-AMD_Phenom-tm-_II_X2_550_Processor-with-glibc2.2.5
KiB Mem:     6098760 total,   1728008 free
KiB Swap:   10485692 total,  10460812 free
Timestamp of repository gentoo: Sat, 29 May 2021 00:30:01 +0000
Head commit of repository gentoo: fa0b2c0ebb451f1001a907e08c2a185714018dd6
sh bash 5.1_p8
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
app-shells/bash:          5.1_p8::gentoo
dev-lang/perl:            5.32.1::gentoo
dev-lang/python:          2.7.18_p9::gentoo, 3.7.10_p3::gentoo, 3.8.9_p2::gentoo, 3.9.4_p1::gentoo
dev-lang/rust-bin:        1.51.0::gentoo
dev-util/cmake:           3.18.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.23::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            10.2.0-r5::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r7::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going=y --quiet-build=y --with-bdeps=y"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.bloodhost.ru/ http://ftp.halifax.rwth-aachen.de/gentoo/"
INSTALL_MASK="/usr/share/locale -/usr/share/locale/en_US -/usr/share/locale/ru"
LANG="ru_RU.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="ru en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_BUNZIP2_COMMAND="lbunzip2 -n2"
PORTAGE_BZIP2_COMMAND="lbzip2 -n2"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="3dnow 3dnowext X a52 aac acpi alsa amd64 bash-completion berkdb branding bzip2 cairo cdda cdr cli crypt dbus dri drm dts dvd dvdr encode exif flac gdbm gif gtk gui iconv icu jpeg jpeg2k ladspa lcms libglvnd libnotify libtirpc mad mmx mmxext mng mp3 mp4 mpeg mtp multilib musepack ncurses nls nptl nvidia ogg opengl openmp pam pango pcre pdf png popcnt ppds readline sdl seccomp smp split-usr sse sse2 sse3 sse4a ssl startup-notification svg tcpd tiff truetype udev unicode upower usb vaapi vdpau vorbis wmf wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2018" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" L10N="ru en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, LC_ALL, PORTAGE_BINHOST, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Comment 4 globus 2021-06-04 15:00:28 UTC
# emerge -pv media-sound/musescore

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] media-sound/musescore-3.6.2::gentoo  USE="alsa mp3 sf3 -debug -jack -omr -osc -portaudio -portmidi -pulseaudio -sfz -webengine" 0 KiB
Comment 5 Niklāvs Koļesņikovs 2021-06-05 05:34:58 UTC
This is just a guess based on experience but the "Broken pipe" coming from ALSA is likely indicative of either CPU not being able to keep up due to excessively tight latency requirements or perhaps interrupts interfering with audio thread scheduling (but to a degree that's still CPU not having enough cycles to deal with it). Or it could be a bug somewhere.

What are the settings of the MuseScore ALSA driver? On my system 48000 Hz sample rate with 3 fragments of 256 samples per period works fine (running on pipewire with ALSA applications being routed to pipewire-pulse by the PulseAudio's ALSA plugin).
Comment 6 globus 2021-06-06 14:31:12 UTC
Could it be that I moved an extraneous sound bank (.sf2) to a different location, but the old place remains in the scores?
Comment 7 globus 2021-06-13 14:06:20 UTC
Removed all configs and scores, completely all traces of life. Rebuilt musescore with some dependencies (mostly dev-qt/*). I launched it (load on one processor core is 100%) and started composing the score from scratch. After typing 8 clock cycles, it hung (the contents of the window are not visible on the screen, only the title, the load on one processor core is 100%). "killall musescore" solved the problem, the score was gone))
Comment 8 Miroslav Šulc gentoo-dev 2021-06-13 15:45:25 UTC
you might want to compile musescore in debug mode and then run it using gdb. once musescore gets stucked, you can press ctrl+c in gdb and inspect the threads.

here are some hints:
* https://wiki.gentoo.org/wiki/Debugging_with_GDB
* https://stackoverflow.com/questions/24810662/use-gdb-to-find-where-program-stuck
Comment 9 globus 2021-06-13 16:45:56 UTC
Can strace be used? gdb is too difficult for me))
Comment 10 Miroslav Šulc gentoo-dev 2021-06-13 17:05:36 UTC
(In reply to globus from comment #9)
> Can strace be used? gdb is too difficult for me))

i guess you can use strace too.
Comment 11 globus 2021-06-13 18:37:52 UTC
Created attachment 715764 [details]
strace out

I didn’t type the score, otherwise the log would be too big. The terminal received messages many times:
unknown: unknown: Alsa_driver: recover: pcm_status (): Broken pipe
unknown: unknown: Alsa_driver: recover: pcm_status (): Broken pipe
unknown: unknown: Alsa_driver: recover: pcm_status (): Broken pipe
unknown: unknown: Fluid: loadSoundFonts: already loaded
unknown: unknown: Final: 4193
unknown: unknown: QMutex: destroying locked mutex
There was no hang, I finished it myself. CPU 100%
Comment 12 Louis Frayser 2021-08-23 01:38:33 UTC
Just want to CONFIRM:
I've never had this problem until today.  I didn't just emerge MuseScore; it's been working fine until now.

Terminal output(until I interrupted), after trying to play anything in musescore:
  repeats:
   unknown:unknown: Alsa_driver: recover: pcm_status(): Broken pipe
   unknown:unknown: Alsa_driver: recover: pcm_status(): Broken pipe
   unknown:unknown: Alsa_driver: recover: pcm_status(): Broken pipe
   unknown:unknown: Alsa_driver: recover: pcm_status(): Broken pipe
   unknown:unknown: Alsa_driver: recover: pcm_status(): Broken pipe^C


Last line of genlop -l musescore:
   Fri Mar 12 15:46:32 2021 >>> media-sound/musescore-3.6.2

I have emerged many other things recently, though. "genlop-l" attached.
Comment 13 Louis Frayser 2021-08-23 01:42:52 UTC
Created attachment 735205 [details]
genlop -l listing since I last installed MuseScore
Comment 14 Louis Frayser 2021-08-23 01:45:02 UTC
(In reply to Louis Frayser from comment #12)
> Just want to CONFIRM:
> I've never had this problem until today.  I didn't just emerge MuseScore;
> it's been working fine until now.
> 
> Terminal output(until I interrupted), after trying to play anything in
> musescore:
>   repeats:
>    unknown:unknown: Alsa_driver: recover: pcm_status(): Broken pipe
>    unknown:unknown: Alsa_driver: recover: pcm_status(): Broken pipe
>    unknown:unknown: Alsa_driver: recover: pcm_status(): Broken pipe
>    unknown:unknown: Alsa_driver: recover: pcm_status(): Broken pipe
>    unknown:unknown: Alsa_driver: recover: pcm_status(): Broken pipe^C
> 
> 
> Last line of genlop -l musescore:
>    Fri Mar 12 15:46:32 2021 >>> media-sound/musescore-3.6.2
> 
> I have emerged many other things recently, though. "genlop-l" attached.

Last line from: "genlop -t musescore"
Comment 15 Niklāvs Koļesņikovs 2021-08-23 11:19:36 UTC
The only thing that stands out immediately is JACK2:
Sun Aug 22 13:36:28 2021 >>> media-sound/jack2-1.9.19

Which backend are you using for MuseScore? I'm not familiar with them but in my testing, IIRC, even if I disabled everything else, MuseScore would still not automatically pick JACK making me suspect it might be buggy or have some other issue that makes it be strictly opt-in. And a follow up if you're using the ALSA backend - is that native ALSA or are you then routing the audio to JACK or another daemon?

Finally please check out comment 8 by Miroslav on how to try debugging the issue itself.
Comment 16 Louis Frayser 2021-08-23 16:11:02 UTC
I've been using the ALSA backend for a least a year, maybe for years.  I uninstalled and masked media-sound/pulseaudio.  The use flag is also 
 "-pulseaudio" for everything.

Please have a look at this--seems to be the same thing--issue as discussed by MuseScore developers:
   https://musescore.org/en/node/314891

SEE ALSO:
   https://github.com/alsa-project/alsa-lib/issues/107


I will try the 1.2.5.1 media-libs/alsa-lib
Comment 17 Louis Frayser 2021-08-23 16:17:38 UTC
(In reply to Louis Frayser from comment #16)
> I've been using the ALSA backend for a least a year, maybe for years.  I
> uninstalled and masked media-sound/pulseaudio.  The use flag is also 
>  "-pulseaudio" for everything.
> 
> Please have a look at this--seems to be the same thing--issue as discussed
> by MuseScore developers:
>    https://musescore.org/en/node/314891
> 
> SEE ALSO:
>    https://github.com/alsa-project/alsa-lib/issues/107
> 
> 
> I will try the 1.2.5.1 media-libs/alsa-lib

Okay.  Upgrading (unmasking and emerging) to =media-libs/alsa-lib-1.2.5.1 did the trick for me.  I've got sound again in MuseScore!
Comment 18 globus 2021-09-27 12:19:33 UTC
PCI Latency Timer in BIOS Can't Affect? 32 64 etc
Comment 19 globus 2021-09-28 16:29:42 UTC
(In reply to Louis Frayser from comment #17)
> Okay.  Upgrading (unmasking and emerging) to =media-libs/alsa-lib-1.2.5.1
> did the trick for me.  I've got sound again in MuseScore!

It helped me too.