Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 734854 - app-emulation/qemu-5.0.0-r1 USE=pulseaudio - stuttering/lag during audio playback
Summary: app-emulation/qemu-5.0.0-r1 USE=pulseaudio - stuttering/lag during audio play...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Matthias Maier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-31 04:32 UTC by david van rood
Modified: 2021-04-28 18:52 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log.xz,41.78 KB, application/x-xz)
2020-07-31 04:32 UTC, david van rood
Details

Note You need to log in before you can comment on or make changes to this bug.
Description david van rood 2020-07-31 04:32:22 UTC
Created attachment 651740 [details]
build.log

upon upgrading this week from app-emulation/qemu-4.2.0-r6 to qemu-5.0.0-r1 i noticed two new issues with a windows guest:

* popping and clicking every 5-15 seconds when playing back audio in the gues
* audio began to lag behind what was shown on the screen (youtube, games, etc) 

to the former, sliding the master volume control in windows while audio was playing introduced tons of pops and clicks, similar to if the sample rates were not the same between guest and host;
To the latter, I've always noticed a slight (100-300ms) delay in audio to video played on a windows guest in qemu, and became used to it. However, with the 5.0.0-r1 upgrade, the audio starts out "fine" (close enough) and slowly starts to lag behind the video until it's close to 1000ms out of sync.

Since i performed a kernel upgrade, from 5.3.7 to 5.4.48, (gentoo-sources) i tried rebooting into 5.3.7, and the problem persisted.

I upgraded from qemu-5.0.0-r1 to ~amd64 app-emulation/qemu-5.0.0-r2 and the 'random' pops and clicks as well as most of the very obvious audio desync stopped. Moving the main volume control slider on windows guest still causes pops and clicks, where it did not in qemu-4.2.0-r6 (and going back to qemu-4.1.0, at least)

I will continue to determine if this is a pulseaudio issue or a qemu-5.0.0-r1 issue if needed.

For those aware of audio artifacts, the popping and clicking is like a buffer issue on a windows machine, and the desync is just plain strange, but it is possible it's an issue with the windows driver. It is possible that qemu-5.0.0-r2 is stable enough to work until upstream qemu-5.1.0 makes it into gentoo.

Mostly, i wanted to say that r2 is good for now. Thank you.

Let me know if i can aid in anything,

Genewitch on freenode; #gentoo


emerge --info app-emulation-qemu:
Portage 2.3.103 (python 3.7.8-final-0, default/linux/amd64/17.1/desktop/gnome, gcc-9.3.0, glibc-2.30-r8, 5.4.48-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.4.48-gentoo-x86_64-AMD_Ryzen_7_3700X_8-Core_Processor-with-gentoo-2.6
KiB Mem:    65792120 total,   5236704 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Fri, 31 Jul 2020 01:30:01 +0000
Head commit of repository gentoo: bcda8316c49482170d79386e6d2eefdb50bfeb29
Head commit of repository steam-overlay: b8fc2697aadc252bcd8c229ef24db59fd67728f4

sh bash 5.0_p17
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
app-shells/bash:          5.0_p17::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r1::gentoo, 3.7.8-r2::gentoo, 3.8.4-r1::gentoo
dev-util/cmake:           3.16.5::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            8.4.0-r1::gentoo, 9.3.0-r1::gentoo
sys-devel/gcc-config:     2.3.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1

steam-overlay
    location: /usr/local/portage/steam-overlay
    sync-type: git
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="http://gentoo.mirrors.tds.net/gentoo http://gentoo.mirrors.easynews.com/linux/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j17"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli colord crypt cups dbus dri dts dvd dvdr eds elogind emboss encode evo exif flac fortran gdbm gif gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk iconv icu introspection ipv6 jpeg lcms ldap libnotify libsecret libtirpc mad mng mp3 mp4 mpeg multilib nautilus ncurses nls nptl nvidia ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt5 readline sdl seccomp spell split-usr ssl startup-notification svg tcpd tiff tracker truetype udev udisks unicode upower usb vdpau vorbis wxwidgets x264 xattr xcb xml xv xvid xvmc zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

app-emulation/qemu-5.0.0-r2::gentoo was built with the following:
USE="aio alsa bzip2 caps curl fdt filecaps gtk jpeg ncurses nls opengl oss pin-upstream-blobs png pulseaudio sdl seccomp slirp spice ssh usb usbredir vhost-net virtfs vnc xattr xkb -accessibility -capstone -debug -doc -glusterfs -gnutls -infiniband -io-uring -iscsi -jemalloc -lzo -multipath -nfs -numa -plugins -python -rbd -sasl -sdl-image (-selinux) -smartcard -snappy -static -static-user -systemtap -tci -test -vde -vhost-user-fs -virgl -vte -xen -xfs -zstd" ABI_X86="(64)" PYTHON_TARGETS="python3_7 -python3_6 -python3_8" QEMU_SOFTMMU_TARGETS="x86_64 -aarch64 -alpha -arm -cris -hppa -i386 -lm32 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -moxie -nios2 -or1k -ppc -ppc64 -riscv32 -riscv64 -rx -s390x -sh4 -sh4eb -sparc -sparc64 -tricore -unicore32 -xtensa -xtensaeb" QEMU_USER_TARGETS="-aarch64 -aarch64_be -alpha -arm -armeb -cris -hppa -i386 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -mipsn32 -mipsn32el -nios2 -or1k -ppc -ppc64 -ppc64abi32 -ppc64le -riscv32 -riscv64 -s390x -sh4 -sh4eb -sparc -sparc32plus -sparc64 -tilegx -x86_64 -xtensa -xtensaeb"
FEATURES="config-protect-if-modified strict binpkg-logs protect-owned unmerge-orphans distlocks qa-unresolved-soname-deps sfperms binpkg-dostrip sandbox binpkg-docompress fixlafiles news preserve-libs unmerge-logs userfetch usersync ipc-sandbox xattr ebuild-locks assume-digests network-sandbox parallel-fetch unknown-features-warn userpriv usersandbox pid-sandbox multilib-strict merge-sync"

>>> Attempting to run pkg_info() for 'app-emulation/qemu-5.0.0-r2'
Using:
  app-emulation/spice-protocol-0.14.1
  sys-firmware/edk2-ovmf-201905
    USE=binary
  sys-firmware/ipxe-1.0.0_p20190728
  sys-firmware/seabios-1.12.0
    USE=binary
  sys-firmware/sgabios-0.1_pre8-r1

------------------------------------------------------


my qemu-system-x86_64 command line to start the windows guest:
nohup \
qemu-system-x86_64 -enable-kvm -m 47866 \
-cpu host,kvm=off,+vmx -smp 8,sockets=1,cores=8,threads=1 \
-device virtio-scsi-pci,id=scsi0 \
-device vfio-pci,host=0b:00.0,x-vga=on \
-device vfio-pci,host=0b:00.1 \
-drive if=pflash,format=raw,readonly,file=/mnt/1tb/ovmf/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/mnt/1tb/ovmf/OVMF_VARS.fd \
-drive file=/mnt/1tb/qemu/windows10-01.img,id=disk,format=raw,if=none,index=0 \
-drive file=/mnt/1tb/qemu/windows10-02.qcow2,id=disk2,if=none,index=1 \
-device scsi-hd,drive=disk \
-device scsi-hd,drive=disk2 \
-device qemu-xhci,id=xhci,bus=pci.0,addr=0x9 \
-soundhw hda \
-vga none \
-device virtio-mouse-pci,id=input0,bus=pci.0 \
-device virtio-keyboard-pci,id=input1,bus=pci.0 \
-device virtio-net,netdev=vmnic \
-netdev tap,id=vmnic,ifname=tap0,script=no,downscript=no \
-object input-linux,id=kbd,evdev=/dev/input/by-id/usb-Logitech_USB_Keyboard-event-kbd,grab_all=on,repeat=on \
-object input-linux,id=mouse,evdev=/dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse \
-object input-linux,id=trackball,evdev=/dev/input/by-path/pci-0000\:08\:00.3-usb-0\:5\:1.1-event-mouse \
-audiodev pa,id=pa1,server=`pactl info | grep 'Server String' | awk '{print $3}'` \
&

--------------------------------------------------
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2020-09-05 08:39:44 UTC
The issue sounds complicated. We'll probably won't be able to help much.

I suggest filing upstream bug and try to talk to upstream directly on tips how to debug it.