After some long runtime, the sound output in my AppVM is extremely “choppy” and “distorted” and “stutter-y”
It sounds like someone is doing a tapotement percussion massage (think “karate chops”) to my speaker’s back.
It used to be that I could just open the audio panel, and sound would work again. But I did a fresh install of Qubes on the same laptop, and that “workaround” no longer works.
I searched around these forums and GitHub looking for a command to just “restart” the audio services to fix this issue, but I didn’t find one.
What I did find, is that I can tail -f ~/.xsession-errors in dom0, and I get a flood of errors about audio streams starting & underrunning over-and-over
[user@dom0 ~]$ tail -f ~/.xsession-errors
1759329344.696772 Stream started.
1759329344.718357 Stream underrun.
...
I’m not asking for how to fix this long-term. I’m asking: how can I just restart all the audio-related services (and in which VM) to try to work around this issue when it happens.
Update: I found that I have choppy audio when I play a video in mpv, but not in vlc.
This command plays the video with the problematic “choppy” audio
user@host:$ mpv video.mp4
I can get a list of audio devices with the --audio-device=help command
user@host:$ mpv --audio-device=help
List of detected audio devices:
'auto' (Autoselect device)
'pipewire' (Default (pipewire))
'pipewire/qubes-sink' (Qubes Virtual Audio Sink)
'pulse/qubes-sink' (Qubes Virtual Audio Sink)
'alsa' (Default (alsa))
'alsa/lavrate' (Rate Converter Plugin Using Libav/FFmpeg Library)
'alsa/samplerate' (Rate Converter Plugin Using Samplerate Library)
'alsa/speexrate' (Rate Converter Plugin Using Speex Resampler)
'alsa/jack' (JACK Audio Connection Kit)
'alsa/oss' (Open Sound System)
'alsa/speex' (Plugin using Speex DSP (resample, agc, denoise, echo, dereverb))
'alsa/upmix' (Plugin for channel upmix (4,6,8))
'alsa/vdownmix' (Plugin for channel downmix (stereo) with a simple spacialization)
'jack' (Default (jack))
'sdl' (Default (sdl))
user@host:$
And, if I select the “pipewire” audio device, then I still have the problematic “choppy” audio
user@host:$ mpv video.mp4 --audio-device=pipewire
If, however, I select the alsa audio device, then the audio plays much, much better
user@host:$ mpv video.mp4 --audio-device=alsa
I don’t know the difference between pipewire or alsa, but I guess what I need to know is the commands to “reset” pipewire (and on which VM to execute this)
1 Like
Try to play it like this:
mpv --vo=x11 --profile=sw-fast video.mp4
$ systemctl --user restart pipewire
systemctl --user restart pipewire
That didn’t fix the choppy audio
mpv --vo=x11 --profile=sw-fast video.mp4
That didn’t fix the choppy audio.
mpv video.mp4 --audio-device=pulse
Sometimes this helped smooth-out the audio, but not always
Update: I found that if I suspend to RAM (and then wake it up again), videos again play with normal audio.
Not as quick of a solution as restarting some service with systemd, but 100x better than rebooting the computer in the middle of my work day…
1 Like
You can try to restart the qvm-start-daemon in dom0:
ps aux | grep qvm-start-daemon | head -n1 | awk '{print $2}' | xargs kill; /usr/bin/python3 /usr/bin/qvm-start-daemon --all --watch & disown
And maybe also try to restart the pipewire service in qubes/dom0.
The problem seems familiar to me.
Especially the first one has exact same solution as yours. Don’t know why these stuttering audio glitches appear, and whether it is being solved. Might be more apparent on low-end machines. Might be memory leakage problem on some audio services (cumulative over use time & “suspend to RAM - wake up” solves the issue). Anyways, I suspect the issue being on QubesOS’ side.
1 Like