[vfio-users] crackling sound on i440fx-3.1+ and conversion attempts to q35

Ivan Volosyuk ivan.volosyuk at gmail.com
Sat Mar 21 12:35:24 UTC 2020


I ended up with a script which generates something like that. It
should be q35-4.0.1 AFAIU, but here it is if it useful. I tried to
mimic hardware IDs of my host machine at some point, but it should
probably be irrelevant. Works fine for Win10. Some of the env are
unused on the stock version of qemu-4.2.0 I use this days. The sound
is mostly crackle free except when it is initialized in VM. You would
need 2 ide-cds to install windows on it, one with
virtio-win-0.1.171.iso other with installation media.

export QEMU_AUDIO_DRV=pa
export QEMU_PA_SAMPLES=2048
export PULSE_COOKIE=/home/ivan/.config/pulse/cookie
export PULSE_SERVER=unix:/home/ivan/.pulse_server
export QEMU_AUDIO_TIMER_PERIOD=250
export QEMU_PA_BUFFER_SIZE_OUT=512
export QEMU_PA_TLENGTH=451
export QEMU_PA_MAXLENGTH_OUT=902
export QEMU_PA_ADJUST_LATENCY_OUT=1

/usr/bin/qemu-system-x86_64
-overcommit
mem-lock=on
-mem-path
/dev/qemu-mem
-device
virtio-balloon
-m
16384
-cpu
host,kvm=off,hv-vendor-id=servo,hv-vpindex,hv-reset,vme=on,ss=on,f16c=on,rdrand=on,hypervisor=on,arat=on,tsc_adjust=on,umip=on,xsaveopt=on,pdpe1gb=on,abm=on,hv_time,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff
-smp
10,sockets=1,cores=5,threads=2
-machine
pc-q35-4.0.1,accel=kvm,usb=off,vmport=off,dump-guest-core=off
-enable-kvm
-nodefaults
-global
ICH9-LPC.disable_s3=1
-global
ICH9-LPC.disable_s4=1
-boot
strict=on
-device
pcie-root-port,port=1,slot=0,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x1c.0
-device
pcie-root-port,port=2,slot=1,chassis=2,id=pci.2,bus=pcie.0,addr=0x1c.1
-device
pcie-root-port,port=3,slot=2,chassis=3,id=pci.3,bus=pcie.0,addr=0x1c.2
-device
qemu-xhci,p2=15,p3=15,id=usb,bus=pcie.0,addr=0x14
-drive
if=pflash,format=raw,readonly,file=/home/ivan/win10/edk2-ovmf-git-20190219/OVMF_CODE.fd,format=raw
-drive
if=pflash,format=raw,file=/home/ivan/win10/tmp3.vars,format=raw
-device
usb-kbd,bus=usb.0,port=1
-device
usb-mouse,bus=usb.0,port=2
-device
usb-host,vendorid=0x0461,productid=0x4d15,bus=usb.0
-device
usb-host,vendorid=0x29ea,productid=0x0102,bus=usb.0
-device
vfio-pci,host=01:00.0,multifunction=on,bus=pci.1,addr=0.0
-device
vfio-pci,host=01:00.1,bus=pci.1,addr=0.1
-device
vfio-pci,host=01:00.2,bus=pci.1,addr=0.2
-device
vfio-pci,host=01:00.3,bus=pci.1,addr=0.3
-nographic
-vga
none
-device
virtio-scsi-pci,id=vv,disable-modern=off,disable-legacy=on,bus=pci.2,addr=0
-drive
file=/dev/zvol/ssd/win10b,format=raw,id=disk,if=none,cache=none,aio=threads,discard=unmap
-device
scsi-hd,drive=disk,bootindex=2,logical_block_size=512,physical_block_size=8192
-drive
file=/archive/system/qemu/games/games.raw,format=raw,id=games_disk,if=none,cache=none,aio=threads,discard=unmap
-device
scsi-hd,drive=games_disk
-drive
file=/ssd/games_300/games_300.raw,format=raw,id=games_raw_ssd_disk,if=none,cache=none,aio=threads,discard=unmap
-device
scsi-hd,drive=games_raw_ssd_disk
-device
virtio-net-pci,netdev=eth0,mac=DE:AD:BE:EF:CE:B9,bus=pci.3,disable-modern=off,disable-legacy=on
-netdev
bridge,br=brkvm,id=eth0
-device
ich9-intel-hda,id=sound0,bus=pcie.0,addr=0x1b
-device
hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0
-no-hpet
-rtc
base=utc,driftfix=slew
-global
kvm-pit.lost_tick_policy=discard

On Sat, Mar 21, 2020 at 10:57 PM Patrick O'Callaghan <poc at usb.ve> wrote:
>
> On Sat, 2020-03-21 at 12:10 +0100, Jiri Novak wrote:
> > after some time, iv;e decided to try again gpu passthrough. i tried to
> > resue my old vm, which was done on i440fx-2.1, but had issue with
> > crackling audio, apart from that, it works fine. as upgrade to 3.0 break
> > windows license, i;ve decided to do it anew on q35, but more on that
> > later. i;ve went back to some experineting with the i440fx and with
> > recent qemu, 4.2, kernel 5.4 (debian bullseye), i have clear audio on
> > i440fx-3.0, but it breaks again on 3.1. same on 4.2 any ideas?
>
> You might take a look at:
>
> https://juho.tykkala.fi/Pulseaudio-and-latency#positive-effect-on-latency
>
> which has some suggestions regarding buffering and latency. I haven't
> got round to trying any of this yet, but I intend to at some point.
>
> poc
>
> _______________________________________________
> vfio-users mailing list
> vfio-users at redhat.com
> https://www.redhat.com/mailman/listinfo/vfio-users
>





More information about the vfio-users mailing list