Sound (?) makes VM crashing

Been using VM for long time now, and didn’t have any issues.I was using ICH9 sound model, and my sound device on host is a SoundBlaster G6 connected via USB (not passthrough).In the VM I am running Windows 10 x64, with only few games and I have enabled passthrough for few devices such as Nvidia 1080ti, 2xSSDs, PCI LAN card.On Monday I removed my G6, connected it to a laptop with W10 and updated its firmware.Put it back on my Manjaro. No problems at all.

However, when I was running the VM, and tried to play any game, it started gradually to play harsh sound, stutter and after 1-2 minutes the OS is completely unresponsive. I couldn’t even send Ctrl+Alt+Del from host to open task manager.

Tried the above scenario many times, with different games, and always the same problem.

Tried to update my W10 system. Didn’t help.Re-install (clean setup) W10. Didn’t help.Changed VM settings to:ICH6 > Same behavior

Tried to change Audio Profile on host to different options (Digital Stereo, Analog Stereo, Both, etc). This made a small difference, as with “Digital Stereo (IEC958) Output”, the problem takes longer to appear, but it does.

Here is my setup:

System: Host: wizzy-desk-manjaro Kernel: 5.6.11-1-MANJARO x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: KDE Plasma 5.18.5
Distro: Manjaro Linux
Machine: Type: Desktop System: Micro-Star product: MS-7B51 v: 1.0 serial:
Mobo: Micro-Star model: MPG Z390 GAMING PLUS (MS-7B51) v: 1.0 serial: UEFI: American Megatrends
v: 1.80 date: 12/26/2019
Battery: Device-1: hidpp_battery_0 model: Logitech G305 Lightspeed Wireless Gaming Mouse charge: 100% (should be ignored)
status: Discharging
CPU: Topology: 8-Core model: Intel Core i9-9900K bits: 64 type: MT MCP arch: Kaby Lake rev: C L2 cache: 16.0 MiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 115232
Speed: 4751 MHz min/max: 800/5000 MHz Core speeds (MHz): 1: 4757 2: 4789 3: 4801 4: 4781 5: 4800 6: 4799 7: 4776
8: 4795 9: 4793 10: 4790 11: 4719 12: 4798 13: 4796 14: 4794 15: 4786 16: 4802
Graphics: Device-1: Intel UHD Graphics 630 vendor: Micro-Star MSI driver: i915 v: kernel bus ID: 00:02.0
Device-2: NVIDIA GP102 [GeForce GTX 1080 Ti] vendor: EVGA. driver: vfio-pci v: 0.2 bus ID: 01:00.0
Display: x11 server: XOrg 1.20.8 driver: intel unloaded: modesetting resolution: 2560x1440~60Hz, 1920x1200~60Hz
OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.0.6 direct render: Yes
Audio: Device-1: Intel Cannon Lake PCH cAVS vendor: Micro-Star MSI driver: snd_hda_intel v: kernel bus ID: 00:1f.3
Device-2: NVIDIA GP102 HDMI Audio vendor: EVGA. driver: vfio-pci v: 0.2 bus ID: 01:00.1
Device-3: Logitech HD Pro Webcam C920 type: USB driver: snd-usb-audio,uvcvideo bus ID: 1-1.1:9
Device-4: Creative Sound BlasterX G6 type: USB driver: hid-generic,snd-usb-audio,usbhid bus ID: 1-5:6
Sound Server: ALSA v: k5.6.11-1-MANJARO
Network: Device-1: Intel Ethernet I219-V vendor: Micro-Star MSI driver: e1000e v: 3.2.6-k port: efa0 bus ID: 00:1f.6
IF: eno1 state: up speed: 1000 Mbps duplex: full mac: 00:d8:61:0e:75:90
Device-2: Broadcom and subsidiaries NetXtreme BCM5751 Gigabit Ethernet PCI Express driver: vfio-pci v: 0.2
port: 3000 bus ID: 04:00.0
IF-ID-1: virbr0 state: down mac: 52:54:00:d0:66:b3
IF-ID-2: virbr0-nic state: down mac: 52:54:00:d0:66:b3
Drives: Local Storage: total: 8.19 TiB used: 1.56 TiB (19.0%)
ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 970 EVO 250GB size: 232.89 GiB
ID-2: /dev/nvme1n1 vendor: Samsung model: SSD 970 EVO 500GB size: 465.76 GiB
ID-3: /dev/sda vendor: Samsung model: SSD 850 EVO 500GB size: 465.76 GiB
ID-4: /dev/sdb vendor: Samsung model: SSD 840 EVO 250GB size: 232.89 GiB
ID-5: /dev/sdc vendor: Toshiba model: HDWE140 size: 3.64 TiB
ID-6: /dev/sdd vendor: Toshiba model: HDWE140 size: 3.64 TiB
RAID: Hardware-1: Intel SATA Controller [RAID mode] driver: ahci v: 3.0 bus ID: 00:17.0
Device-1: md126 type: mdraid status: active Components: online: sdc~c1 sdd~c0
Info: raid: mirror blocks: 3907015680 report: 2/2 UU chunk size: N/A
Device-2: md127 type: mdraid status: inactive Components: online: N/A spare: sdc~c0
Info: raid: sdd1 blocks: 5808 report: N/A chunk size: N/A
Partition: ID-1: / size: 146.65 GiB used: 22.23 GiB (15.2%) fs: ext4 dev: /dev/nvme1n1p3
ID-2: /home size: 246.31 GiB used: 46.76 GiB (19.0%) fs: ext4 dev: /dev/nvme1n1p4
ID-3: swap-1 size: 64.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/nvme1n1p2
Sensors: System Temperatures: cpu: 57.0 C mobo: N/A
Fan Speeds (RPM): N/A
Info: Processes: 360 Uptime: 1h 14m Memory: 31.33 GiB used: 4.80 GiB (15.3%) Init: systemd Compilers: gcc: 9.3.0
Shell: bash v: 5.0.16 inxi: 3.0.37

There were some updates last week, but didn’t happen then. I had to change the path to 2 files (/usr/share/**edk2-**ovmf/x64/OVMF_CODE.fd:/usr/share/edk2-ovmf/x64/OVMF_VARS.fd).

I read in another site that ICH6/9 can cause this, so I tried with AC97. Unfortunately I am having the same behavior.

Today I deleted the VM files (xml config etc) and create it from scratch by trying to make small changes like:Video QXL > Virtio

SCSI lsilogic > Virtio (updated driver in Windows too)

Nothing helped…

Any suggestions?

Found the solution. It turns out that versions up until 5.0.0.5 contain a bug that causes this behavior with the sound. The offending code is disabled in 5.0.0.6.

You can see your version by running: pacman -Qi qemu

Arch has an updated version, build date for 5.0.0.6:

Build Date : Sat 09 May 2020 11:14:33 PM CEST

Seems like the Manjaro repo does not have that version yet. Therefore I went here:

hxxps://www.archlinux.org/packages/extra/x86_64/qemu/

and clicked on the “Download from Mirror” link on the right. Then I installed the resulting package with

sudo pacman -U qemu-5.0.0-6-x86_64.pkg.tar.zst

After I ran “sudo mkinitcpio -P” and rebooted.
Works ok now, no stutter in the sound with ICH9 and no performance issues.