No sound in VM with Fedora 41, strange errors from pipewire service

Today I did an upgrade to my 40 but I was having issues with the sound in my virtual machines (no sound, no errors)
I did some troubleshooting but since it wasn’t working, I decided to do a fresh install with 41. After I finished my main setup, and VirtualMachine settings, I tried to open one of my VMs (Win10) and had no sound.

While I was trying to find the issue, I found an online tutorial, where they are setting VMs to use pipewire (for better latency).

Now, my VM is not even booting… Just 2-3 seconds after I see the boot screen, it crashes and shuts down. Plasma crashes too, and I am getting a popup to submit the error report. Tried to see if pipewire is working, but I am getting strange behavior…

systemctl --user status pipewire-pulse.service

 pipewire-pulse.service - PipeWire PulseAudio
     Loaded: loaded (/usr/lib/systemd/user/pipewire-pulse.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/user/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Wed 2024-10-30 20:31:53 GMT; 31min ago
 Invocation: 2f7d048f6305446d87b2f4ede6ee0ca4
TriggeredBy: ● pipewire-pulse.socket
   Main PID: 2371 (pipewire-pulse)
      Tasks: 3 (limit: 75823)
     Memory: 15.5M (peak: 16.3M)
        CPU: 99ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire-pulse.service
             └─2371 /usr/bin/pipewire-pulse

Oct 30 20:31:53 wizzy-fedora41-kde systemd[2072]: Started pipewire-pulse.service - PipeWire PulseAudio.

However, if I run: sudo systemctl restart pipewire-pulse I am getting

Failed to restart pipewire-pulse.service: Unit pipewire-pulse.service not found.

Any ideas what is wrong with it?

Try without sudo while using --user like:

systemctl --user restart pipewire-pulse

This works, thanks.

However, I still don’t have sound from my VMs…

I have the exact same problem. I updated to f41 and my many VMs went from perfect sound to no sound at all to sporadic sound with no rhyme or reason. I’ll post here if I ever solve the issue, and I’d really appreciate it if you did the same.

What are the VM’s you are using? Managing them with virt-manager?

I keep VMs for different projects that need to be separate. They are largely various Linux distros. I have tested Fedora 41, Fedora 40, Ubuntu 22.04.1LTS so far. They all have sound issues. I do use virt-manager, yes.

Seams to be a bug in qemu: Qemu 9.1.1-1 breaks virt-viewer audio output through spice / Kernel & Hardware / Arch Linux Forums

Could you please check which version you are using on F41? I am still on F40.

sudo dnf info qemu

Version: 9.1.1
Release 1.fc41

I think that’s exactly it. Thank you very much, at least I know what’s causing this. I am working on a workaround which I will post, should it actually work, of course.

1 Like

I have a workaround that lets the system work as before (actually, better: I used to get crackles during the startup of other VMs and this doesn’t appear to have this issue). I have not tested it extensively, but I suspect that it will only need to tide us over until they patch QEMU to fix this issue.

So the trick is to use PipeWire’s PulseAudio compatibility layer and target it directly from QEMU. To do this, you will first have to start a server that listens to VM connections:

pactl load-module module-native-protocol-tcp auth-cookie-enabled=0 auth-ip-acl=127.0.0.1

Now do note that this is imperfectly secure since anyone connecting from localhost can listen in to your audio in its entirety. Consider your threat model and act accordingly.

Once you have done this you will need to edit the XML of your VM. The audio section should read a little something like:

    <sound model="ich9">
      <codec type="micro"/>
      <audio id="1"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>
    </sound>
    <audio id="1" type="pulseaudio" serverName="127.0.0.1"/>

This appears to work reasonably well.

2 Likes

Although I am running in a “safe” environment (local LAN), I was a bit concerned about the security issue. So, I changed it to this:

    <sound model="ich9">
      <codec type="micro"/>
      <audio id="1"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>
    </sound>
    <audio id="1" type="pipewire" runtimeDir="/run/user/1000">
      <input name="qemuinput"/>
      <output name="qemuoutput"/>
    </audio>

Sound works fine.

1 Like

Interesting! I considered doing it like that but there are issues with ownership. Do you run your QEMU as your local user, e.g. UID 1000?

Yes, I have my user in qemu.conf and also a group “kvm”

Yeah, I considered exactly that approach. I was worried about security of not keeping QEMU in its own user, but I guess it is a tradeoff either way.

Ok, today I lost my sound again…

First of all, I had my card setup as “Pro Audio”. Today, when I booted up my system, it was reverted to “Analog Duplex” and all my other audio devices (on board, webcam, etc) were re-activated. Turned them all off, changed my card to “Digital Stereo Duplex” and then I tried to open one of my VMs.

Unfortunately, no sound coming out from it again…

A quick look at journal, gave me this:

09:28:34.095 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-KTMicro_USB_Audio_Device_214b206000000178-00.analog-stereo"
09:28:34.095 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-KTMicro_USB_Audio_Device_214b206000000178-00.analog-stereo"
09:28:34.095 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-KTMicro_USB_Audio_Device_214b206000000178-00.analog-stereo"
09:28:34.096 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-KTMicro_USB_Audio_Device_214b206000000178-00.analog-stereo"
.....
10:10:10.663 UTC user@1000.service org.kde.plasma.pulseaudio: Settings schema org.freedesktop.pulseaudio.module-group is not installed
10:10:10.663 UTC user@1000.service org.kde.plasma.pulseaudio: Settings schema org.freedesktop.pulseaudio.module-group is not installed
10:10:10.663 UTC user@1000.service org.kde.plasma.pulseaudio: Settings schema org.freedesktop.pulseaudio.module-group is not installed
10:10:10.938 UTC user@1000.service qrc:/kcm/kcm_pulseaudio/main.qml:291: ReferenceError: sourceModel is not defined
10:10:27.620 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-Creative_Technology_Ltd_Sound_Blaster_X5_9BE3ADD73F9BB8AD-03.analog-stereo"
10:10:27.620 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-Creative_Technology_Ltd_Sound_Blaster_X5_9BE3ADD73F9BB8AD-03.analog-stereo"
10:10:27.620 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-Creative_Technology_Ltd_Sound_Blaster_X5_9BE3ADD73F9BB8AD-03.analog-stereo"
10:10:27.621 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-Creative_Technology_Ltd_Sound_Blaster_X5_9BE3ADD73F9BB8AD-03.analog-stereo"
10:10:27.642 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-Creative_Technology_Ltd_Sound_Blaster_X5_9BE3ADD73F9BB8AD-03.analog-stereo"
10:10:27.684 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-Creative_Technology_Ltd_Sound_Blaster_X5_9BE3ADD73F9BB8AD-03.analog-stereo"
10:10:27.748 UTC user@1000.service qrc:/kcm/kcm_pulseaudio/main.qml:291: ReferenceError: sourceModel is not defined
10:10:27.754 UTC user@1000.service QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
10:10:27.759 UTC user@1000.service QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
10:10:34.021 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-KTMicro_USB_Audio_Device_214b206000000178-00.analog-stereo"
10:10:34.022 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-KTMicro_USB_Audio_Device_214b206000000178-00.analog-stereo"
10:10:34.022 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-KTMicro_USB_Audio_Device_214b206000000178-00.analog-stereo"
10:10:34.022 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-KTMicro_USB_Audio_Device_214b206000000178-00.analog-stereo"
10:10:34.047 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-KTMicro_USB_Audio_Device_214b206000000178-00.analog-stereo"
10:10:34.091 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_output.usb-KTMicro_USB_Audio_Device_214b206000000178-00.analog-stereo"
10:10:34.738 UTC user@1000.service qrc:/kcm/kcm_pulseaudio/main.qml:291: ReferenceError: sourceModel is not defined
10:10:34.762 UTC user@1000.service QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
10:10:34.767 UTC user@1000.service QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
10:10:38.324 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_input.usb-046d_HD_Pro_Webcam_C920_DBEEDE1F-02.analog-stereo"
10:10:38.324 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_input.usb-046d_HD_Pro_Webcam_C920_DBEEDE1F-02.analog-stereo"
10:10:38.338 UTC user@1000.service org.kde.pulseaudio: No object for name "alsa_input.usb-046d_HD_Pro_Webcam_C920_DBEEDE1F-02.analog-stereo"
10:10:38.733 UTC user@1000.service qrc:/kcm/kcm_pulseaudio/main.qml:291: ReferenceError: sourceModel is not defined
10:10:38.755 UTC user@1000.service QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
10:10:38.760 UTC user@1000.service QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
10:10:51.579 UTC user@1000.service No object for name "alsa_output.usb-Creative_Technology_Ltd_Sound_Blaster_X5_9BE3ADD73F9BB8AD-03.iec958-stereo"
10:10:51.579 UTC user@1000.service No object for name "alsa_output.usb-Creative_Technology_Ltd_Sound_Blaster_X5_9BE3ADD73F9BB8AD-03.iec958-stereo"
10:10:51.579 UTC user@1000.service No object for name "alsa_input.usb-Creative_Technology_Ltd_Sound_Blaster_X5_9BE3ADD73F9BB8AD-03.iec958-stereo"

This is very annoying behaviour…

Any ideas?