MS3 halts playback when switching between display modes

• Dec 20, 2018 - 15:48
Reported version
3.0
Priority
P3 - Low
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
active
Regression
Yes
Workaround
No
Project

With attached score, MuseScore 3 halts playback for several seconds each time I switch between page view, single page view and and continuous display mode.

OS: macOS 10.14, Arch.: x86_64, MuseScore version (64-bit): 3.0.0.20032, revision: 1256be5

Attachment Size
K77 Silent_night.mscz 29.12 KB

Comments

Priority P3 - Low

To some extent, trying to do anything likely to be CPU-intensive during score playback is asking for trouble, there is pretty much no way we can overcome limitations of system resources. That said, sure, we might be able to figure out ways of being a little less resource-hungry on certain operations, to make such playback glitches slightly less noticeable.

I am not a performance expert, but somehow I doubt whether CPU load is the issue here.

I have done a few experiments to determine the relation between CPU load and playback performance. Disclaimer: These were quick and informal experiments, but I believe they illustrate the basic situation.

I have watched and compared the CPU load caused by MuseScore on my machine, with and without playback, both on 2.3.2 and on the latest nightly build. Absolute numbers mean little, but the comparison is interesting.

  • MuseScore 2.3.2, running with score loaded but no activity (no playback), and no other user programs running:

-- load (%CPU) varying between 3.8 (mostly) and 40.8 (peak)

  • MuseScore 2.3.2, playing back score:

-- load (%CPU) varying between 26.6 and 67.9, once even 84.7
-- No hiatus in playback while switching back and forth between page and continuous display

With the latest nightly build (MuseScoreNightly-2018-12-20-1853-master-7c71ea7.dmg) results were the following, with the same score loaded:

  • MS3, not playing:

-- load (%CPU) between 6.8 and 7.1

  • MS3, playing:

-- load (%CPU) between 10.9 and 17.1

My conclusions: first of all, and most importantly, it looks like MS3 is much more well behaved in terms of CPU load than 2.3.2. "Still" average might be slightly higher, although difficult to tell with such a small sample, but load is much smoother and no high peaks were observed.

If these observations are typical this is a big achievement indeed. Impressive.

Secondly, when playing back, CPU load with MS3 is much smaller than with 2.3.2, and much more stable too.

However, functionally, MS3 has the problem that playback halts when switching between display modes. This is not the case with 2.3.2.

Viewing these results together, I do not think that this playback problem with MS3 is related to CPU load, but rather with some implementation issue, unknown to me.

To me it seems that it might very well have the same ground cause as the playback problems noted elsewhere, for instance "Saving during playback causes it to skip to a random note and hang, moves playback cursor elsewhere" (issue #279050), and related issues around autosave.

Finally, even if CPU load occasionally were to remain a problem, putting playback in a separate thread might solve the problem. See also "Saving during playback causes it to skip to a random note and hang, moves playback cursor elsewhere" (issue #279050, https://musescore.org/en/comment/879294#comment-879294) for a discussion on this.