Migration dom0 audio from pulseaudio to pipewire available for testing

Recent updates include a migrating audio in dom0 from pulseaudio to pipewire. It should improve audio quality, especially for qubes already using pipewire too (all Fedora, and newer Debian). Related issue: Audio underruns in dom0 soon after uncorking stream · Issue #8955 · QubesOS/qubes-issues · GitHub. In theory the switch should be seamless and everything should remain working as it was,
but since it’s rather drastic change it needs some more testing.

The switch is implemented in qubes-dom0-update command that is in current-testing repository for now. Running a normal update with the updated command should switch to pipewire the first time it’s called. But it’s also possible to switch back and forth manually:

  • qubes-dom0-update --switch-audio-server-to=pipewire
  • qubes-dom0-update --switch-audio-server-to=pulseaudio

In theory it should automatically restart relevant services and no extra action should be needed, but in practice it may sometimes require either restarting some qubes or logging out of dom0 and logging back in.

Please check if audio (playing, recording etc) works correctly after the switch.

7 Likes

I tested and I didn’t see issues:

  • installation : pipewire installed and dom0 switched from Pulseaudio to PipeWire
  • playing
    • with an audio file player (mocp) /w debian-12
    • in a web browser with 3 video stream platforms /w fedora-39 and debian-12
  • recording : I don’t use, I did only a very basic voice record with Audacity /w fedora-39

Before the installation, pulseaudio is running in dom0 :

[user@dom0 ~]$ ps fauxwww | grep audio
user        5537  0.0  0.9 943292 36544 ?        Sl   06:36   0:17          |   \_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libpulseaudio-plugin.so 7 16777228 pulseaudio PulseAudio Plugin Adjust the audio volume of the PulseAudio sound system
user        5564  0.7  0.6 1700052 25344 ?       S<sl 06:36   2:15  \_ /usr/bin/pulseaudio --daemonize=no --log-target=journal
user       15300  0.0  0.0 222020  2176 pts/6    S+   11:58   0:00  |   \_ grep --color=auto audio

gui-daemon installation:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing --action=upgrade qubes-audio-daemon qubes-audio-dom0 qubes-desktop-linux-common qubes-gui-daemon  qubes-gui-dom0 qubes-menus

core-admin-linux installation:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing --action=upgrade qubes-core-dom0-linux qubes-core-dom0-linux-kernel-install

meta-packages installation:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing --action=upgrade qubes-dom0-meta-packages qubes-dom0-unwanted-packages
meta-packages installation useful output

Partial output:

...
Upgraded:
  qubes-dom0-meta-packages-4.2.11-1.fc37.noarch                 qubes-dom0-unwanted-packages-4.2.11-1.fc37.noarch                

Complete!
Switching from Pulseaudio to PipeWire
...
Installed:
  libldac-2.0.2.3-11.fc37.x86_64                               libsbc-1.5-4.fc37.x86_64                                         
  pipewire-0.3.84-1.fc37.x86_64                                pipewire-alsa-0.3.84-1.fc37.x86_64                               
  pipewire-jack-audio-connection-kit-0.3.84-1.fc37.x86_64      pipewire-jack-audio-connection-kit-libs-0.3.84-1.fc37.x86_64     
  pipewire-libs-0.3.84-1.fc37.x86_64                           pipewire-pulseaudio-0.3.84-1.fc37.x86_64                         
  wireplumber-0.4.14-1.fc37.x86_64                             wireplumber-libs-0.4.14-1.fc37.x86_64                            
Removed:
  paprefs-1.2-3.fc37.x86_64         pulseaudio-16.1-4.fc37.x86_64         pulseaudio-module-gsettings-16.1-4.fc37.x86_64        

Complete!
Audio daemon switched to PipeWare, you can undo it with qubes-domo0-update --switch-audio-server-to=pulseaudio
...

After the installation, pulseaudio is no more running and pipewire is running:

[user@dom0 ~]$ ps fauxwww | grep audio
user        5537  0.0  0.9 812220 36388 ?        Sl   06:36   0:18          |   \_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libpulseaudio-plugin.so 7 16777228 pulseaudio PulseAudio Plugin Adjust the audio volume of the PulseAudio sound system
user       17048  0.0  0.0 222020  2160 pts/6    S+   12:21   0:00  |   \_ grep --color=auto audio
user       16236  0.0  0.2 232652 11436 pts/7    Sl+  12:05   0:00  |   \_ vim logbook/2024-04-07_dom0_update_audio-testing.md
[user@dom0 ~]$ ps fauxwww | grep wire
user       17021  0.0  0.3 325592 12976 ?        S<sl 12:19   0:00  \_ /usr/bin/pipewire
user       17022  0.1  0.4 545916 19112 ?        S<sl 12:19   0:00  \_ /usr/bin/wireplumber
user       17023  0.0  0.2 317116 11236 ?        S<sl 12:19   0:00  \_ /usr/bin/pipewire-pulse
user       17054  0.0  0.0 222020  2232 pts/6    S+   12:21   0:00  |   \_ grep --color=auto wire
[user@dom0 ~]$ ls -al /var/lib/qubes/
...
-rw-r--r--  1 root qubes      2 Apr  7 12:19 .audio-switch-done
...
2 Likes

the migration worked fine here, but the thing I keep running into is that the watch daemon (in either dom0 or sys-audio) doesn’t always pick up on new VMs, especially after you restart that VM. I often have to kill and restart the daemon, then restart the pipewire service on the restarted audio source VM to get it to work again.

1 Like