GNOME Bugzilla – Bug 794497
wasapisink: Sound has glitches
Last modified: 2018-04-18 11:30:12 UTC
I cross build gstreamer master in cerbero, then on windows 10 VM I run this: gst-launch.exe audiotestsrc ! wasapisink The audio is "crackling". With use-audioclient3=false it's perfect.
Could you paste the debug log GST_DEBUG=wasapi*:4 for the following configurations: use-audioclient3=true use-audioclient3=false use-audioclient3=false low-latency=true Also, what are you using to run the VM and what sound card does it use? How many CPUs have you allocated to the VM? What CPU usage does the pipeline show? Can you also try with the cerbero binary release? 1.13.91 will suffice.
I can reproduce this if the VM is allocated just one CPU.
Created attachment 369945 [details] [review] Don't derive device period from latency time This fixes the glitches for me. Can you try and see if it works for you too?
I'm using VirtualBox, Win10, 1 CPU. Not ideal case I admit. Your patch makes it better but still as soon as I click on anything the sound start crackling again. Clearly it has too small buffers and it miss deadlines when the CPU has any load. With directsoundsink I can put a lot of load and it still play perfect audio.
We can't really do anything else to improve things with audioclient3 since we have much less control over the buffer sizes allocated by the audio engine. I guess we could enable audioclient3 by default (if unset) only when low-latency=true.
Created attachment 370605 [details] [review] wasapi: Only use audioclient3 when low-latency Causes glitches on very slow CPU machines or VMs, and our out-of-the-box experience should be good.
Pushed these two patches, should fix everything. The second patch makes the first patch redundant (since that codepath will not be hit anymore), but someone might need that path anyway, to target Windows Store apps or similar. We can re-visit this then. Attachment 370605 [details] pushed as b765392 - wasapi: Only use audioclient3 when low-latency
Looks all reasonable, thanks !