wasapi: Try to use latency-time and buffer-time
authorNirbheek Chauhan <nirbheek@centricular.com>
Tue, 6 Feb 2018 23:18:58 +0000 (04:48 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Thu, 8 Feb 2018 08:59:58 +0000 (14:29 +0530)
commit4dbca8df0939c5388bc4b59a64085ab76588edc4
tree89b6c5cc83cfc171d6c572399e031affb0af9c30
parent624de04fdb730fd87eead407651172a7acb1d16b
wasapi: Try to use latency-time and buffer-time

So far, we have been completely discarding the values of latency-time
and buffer-time and trying to always open the device in the lowest
latency mode possible. However, sometimes this is a bad idea:

1. When we want to save power/CPU and don't want low latency
2. When the lowest latency setting causes glitches
3. Other audio-driver bugs

Now we will try to follow the user-set values of latency-time and
buffer-time in shared mode, and only latency-time in exclusive mode (we
have no control over the hardware buffer size, and there is no use in
setting GstAudioRingBuffer size to something larger).

The elements will still try to open the devices in the lowest latency
mode possible if you set the "low-latency" property to "true".

https://bugzilla.gnome.org/show_bug.cgi?id=793289
sys/wasapi/gstwasapisink.c
sys/wasapi/gstwasapisink.h
sys/wasapi/gstwasapisrc.c
sys/wasapi/gstwasapisrc.h
sys/wasapi/gstwasapiutil.c
sys/wasapi/gstwasapiutil.h