You are not logged in.

#1 2016-01-16 06:03:16

Cadeyrn
Member
Registered: 2013-04-06
Posts: 170

libvirt & KVM/QEMU: PCI passthrough: HDMI audio not working on Arch

So, I have 2 virtual machines that I pass a real video card into for gaming, and it works really great. One is Windows 10, and the other is Arch Linux (because there seems to be no way to put a video card into vfio-pci and still use it on the host without a reboot). Yes, the host and the problematic guest are both Arch Linux. In fact, they share the same home folders and the same pacman cache.

They both get audio through the video card's (NVidia GTX 660) HDMI output. Windows 10 works perfectly fine, but the Arch guest's audio only *almost* works. It's running Openbox and the pulseaudio systemd service is enabled (and PulseAudio is configured properly, too). Here's the weird part: it has two issues, both skipping, but different kinds of skipping.

Whether PulseAudio is installed or not, ALSA's problem is the same (if PulseAudio's running, this problem only applies to programs that use ALSA through PulseAudio without themselves having any interface with PulseAudio). ALSA has extreme hard skipping--that is, if I try to play a sound, the audio moves in EXTREME slow motion and discrete chunks. Instead of skipping the way a CD does--by repeating the last sound bit over and over--it skips by just going through the audio output THAT slowly. I tried mplayer to make sure it wasn't some weird RAM issue somehow, and mplayer spit out constant complaints that the audio device got stuck as it chugged along.

For sound going through PulseAudio, such as most of the games I've tried and that "pop" in pavucontrol, I get soft repeated skipping. The sound works absolutely completely fine, except every time any sound happens, there's about a 7/10 chance that it will get stuck in a repeat loop and keep repeating OVER other sounds that can still happen. This loop goes on forever until either that sound happens again, and this time the 7/10 chance fails, or until I exit the program that created the sound, and THEN relaunch the program again. It keeps going with the program turned off until it's relaunched.

I've tried everything I could find by Googling, which is a pitiful total of two fixes: tsched=0 and muting all of the unused HDMI ports in alsamixer. Neither fix worked. I can't find any more, because this issue is so specific and so similar to extremely common sound issues in Linux that have nothing to do with mine.

Offline

#2 2018-08-07 14:41:12

cmsigler
Member
Registered: 2013-11-18
Posts: 35

Re: libvirt & KVM/QEMU: PCI passthrough: HDMI audio not working on Arch

Hi,

I'm just getting up to speed myself on qemu/kvm for near-host speed Windows guests.  I've read there are environment variables to control behind-the-scenes sound settings under qemu.  Here's a good webpage I found which uses libvirt to adjust these:

http://mathiashueber.com/virtual-machin … o-working/

A reddit page which is the immediate source for the above:

https://www.reddit.com/r/VFIO/comments/ … crackling/

Note that there are LOTS of other env. vars. you can experiment with that control qemu's sound handling.  Ref. this one:

https://www.redhat.com/archives/vfio-us … 00073.html

Finally, here's one that's much more general in scope, so it may be less helpful (but might help others?):

https://askubuntu.com/questions/719819/ … host-audio

Thought I'd post these since you've received no other (more expert) replies.  HTH.

Clemmitt Sigler

Offline

Board footer

Powered by FluxBB