Re: [Qemu-discuss] "main-loop: WARNING: I/O thread spun for 1000 iterations" when playing audio

2016-09-25 Thread Aleksei
If I understand ALSA correctly, not using dmix will cause 
sound-producing applications to grab the sound card exclusively if it 
doesn't support HW mixing. I would try it in any case, if only to 
eliminate problems on the host side.


System-wide ALSA config is /etc/asound.conf, user-specific is 
~/.asoundrc. The syntax is not intuitive, to say the least.


See here: 
https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture#Dmix



/--Regards, Aleksei/



*From:* Holger Wünsche
*Sent:* Sunday, September 25, 2016 5:40PM
*To:* Aleksei
*Subject:* Re: [Qemu-discuss] "main-loop: WARNING: I/O thread spun for 
1000 iterations" when playing audio


On 25 September 2016 15:57:23 CEST, Aleksei  wrote:


Hi,

I didn't have this issue, so here are my wild pointers :)

Do you have pulseaudio on the host?


No I only use alsa and it is not installed.


Have you tried other soundhw models ("qemu-system-x86_64 -soundhw help" will 
tell you what's available).


Yes, I tried some and they did not fix the problem.


What does your .asoundrc look like? Do you use ALSA's dmix?


As far as I can see dmix should not be used. (I might miss something, but I 
could not find any '*asound*' on my drive. Not in /etc/ nor in my home 
directory. Also it is not shown when I type aplay -lL)


/--Regards, Aleksei/




Holger Wünsche




Re: [Qemu-discuss] "main-loop: WARNING: I/O thread spun for 1000 iterations" when playing audio

2016-09-25 Thread Aleksei

Hi,

I didn't have this issue, so here are my wild pointers :)

Do you have pulseaudio on the host?

Have you tried other soundhw models ("qemu-system-x86_64 -soundhw help" 
will tell you what's available).


What does your .asoundrc look like? Do you use ALSA's dmix?


/--Regards, Aleksei/



*From:* Holger Wünsche
*Sent:* Sunday, September 25, 2016 4:36PM
*To:* Qemu-discuss
*Subject:* [Qemu-discuss] "main-loop: WARNING: I/O thread spun for 1000 
iterations" when playing audio

I have a Windows7-VM with GPU-passthrough running under qemu(2.7.0)/kvm and it
works without problems as long as I do not enable the sound device (hda). As
soon as sound is beeing played the system freezes for seconds or even longer
than 5 minutes. The sound also is very bad, which might be caused by small
freezes. The first time it freezes I get this message in my terminal:

main-loop: WARNING: I/O thread spun for 1000 iterations

I have not found any other trace of related problems in any other log-file
(maybe I missed an important one?). The command used to start this VM is:

qemu-system-x86_64 \
-m 6G \
-machine type=pc,accel=kvm \
-drive file=/vm/win7.qcow2 \
-L /usr/share/qemu/bios.bin \
-net user \
-soundhw hda \
-net nic,model=rtl8139 \
-smp cores=2,threads=2,sockets=1 \
-rtc base=localtime \
-device vfio-pci,host=01:00.0,romfile=/vm/Club3D.HD7850.2048.rom \
-device vfio-pci,host=01:00.1 \
-display gtk

QEMU_AUDIO_DRV is set to 'alsa' (without quotes).

I do not want to to use any hardware-passthrough, because I intend to run
multiple VMs at the same time all with sound capabilities (these VMs will be
linux). I am not using ac97, because I have trouble inding a driver for
Windows7 ( the one on the realtek-homepage is for Vista only). I also tried to
solve this problem compiling qemu from source with the patch in vl.c explained
in this github-issue: https://github.com/riscv/riscv-qemu/issues/3.
(setting nonblocking to 0;)

Any help or pointer in the right direction would be greatly appreciated.



Holger Wünsche