After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 794497 - wasapisink: Sound has glitches
wasapisink: Sound has glitches
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.14.0
Other Linux
: Normal normal
: 1.14.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-03-19 20:28 UTC by Xavier Claessens
Modified: 2018-04-18 11:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't derive device period from latency time (2.22 KB, patch)
2018-03-21 09:26 UTC, Nirbheek Chauhan
committed Details | Review
wasapi: Only use audioclient3 when low-latency (2.33 KB, patch)
2018-04-06 17:41 UTC, Nirbheek Chauhan
committed Details | Review

Description Xavier Claessens 2018-03-19 20:28:38 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.
Comment 1 Nirbheek Chauhan 2018-03-21 00:06:27 UTC
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.
Comment 2 Nirbheek Chauhan 2018-03-21 08:45:11 UTC
I can reproduce this if the VM is allocated just one CPU.
Comment 3 Nirbheek Chauhan 2018-03-21 09:26:48 UTC
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?
Comment 4 Xavier Claessens 2018-03-21 14:44:18 UTC
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.
Comment 5 Nirbheek Chauhan 2018-04-06 17:06:06 UTC
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.
Comment 6 Nirbheek Chauhan 2018-04-06 17:41:56 UTC
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.
Comment 7 Nirbheek Chauhan 2018-04-06 17:44:26 UTC
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
Comment 8 Nicolas Dufresne (ndufresne) 2018-04-06 19:00:33 UTC
Looks all reasonable, thanks !