Sound / Playback issue

This problem has been bugging me since Mint 20.2. For some unknown reason, at totally random times, the sound coming out of my speakers, is garbled. No warning, no message, just garbled noise when i play a mp3/mp4/mkv, etc.
The only solution i found so far is to execute these 2 commands: pulseaudio -k and pulseaudio --start.
After that, everything runs smooth again.
But now i’ve discovered MuseScore. (a very nifty peace of software for music). But whenever i use the play function the sound is garbled. And that affects all others too. (VLC player, browser…)

Distribution & Version: Linux Mint 20.3
Kernel information 5.4.0-107-generic
When did the issue start happening? Right after using MuseScore for the first time.
Did anything change that caused it? Installing MuseScore
What steps do you take that cause the problem? Play a tab in MuseScore

Has anybody come across this problem in the past? Anybody know of a way to fix this permanently?
I looked at TuxGuitar too, but that didn’t produce any sound at all.

Yup, I had these intermittent issues. Sometimes switching to another sound device from the tray icon and then back will fix the issue.

Tux guitar is a mess, I had the same problems and no amount of tweaking the output settings helped. I install the flatpak now and that seems to work more reliably.

I fixed these issues by switching to pipewire.

My brief sleuthing suggests there is a latency bug in musescore. The devs of pulseaudio and musescore seem to disagree with the exact details. The most common variation of this problem seems to happen after people install and use musecore so :person_shrugging:.

I’ve seen two different workarounds.

  1. set whatever launcher for musescore you use to launch with env PULSE_LATENCY_MSEC=30 mscore

or

  1. modify /etc/pulse/default.pa by changing load-module module-udev-detect to load-module module-udev-detect tsched=0

Unfortunately, I use pipewire so I couldn’t tell you if these workarounds … work around your issue.

Thank you both for the suggestions. I’ll try and see where that leads me. Sound always seems to be a problem in Linux, no? At least, that’s what i found.
On the other hand, with only a minor tweak, something like Ardour runs perfect.