gstreamer/ext
Devarsh Thakkar 297b1e68e2 ext: alsa: Fix fallback paths for setting buffer and period times
Below fallback paths were introduced in
9759810d82
if setting period time after buffer time failed :
1) Set period time and then buffer time if it doesn't work
2) Set only buffer time
3) Set only period time

These all were not functioning properly since they were using old
copy of snd_pcm_hw_params_t which already had some fields set
as per previous try and this was causing issues as driver was
referring to that old value while trying to set them again in
fallback paths.

So now we always use the initial copy of snd_pcm_hw_params_t
for every fallback  and same is also being done at
557c429510

Also we change the sequence to set period time earlier than
buffer time since period bytes being the smaller unit, most of the times
if underlying alsa device has a dependency then it is of period bytes
to be a multiple of some value (as per underlying DMA constraint)
and rest of the parameters like buffer bytes need to be adjusted
as per period bytes.

The same sequence is also followed in alsa-utils at
9b621eeac4

Fix 2) and 3) scenarios by returning success if the exclusive setting is passed
and not doing any further setting for buffer time or period time.

Add new fallback path of not setting any buffer time and period time
if all above fallback paths fail. The same is also being
followed at aforementioned pulseaudio commit.

In case of alsasink, remove the retry goto label, since it is not
required anymore as fallback paths take care of setting default
values if driver is not accepting any of the fallback paths.

Use separate label for exit to free params structs and return err
code. This also fixes leak in no_rate goto path in alsasink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1212>
2021-08-17 19:52:59 +00:00
..
alsa ext: alsa: Fix fallback paths for setting buffer and period times 2021-08-17 19:52:59 +00:00
cdparanoia cdparanoiasrc: allow per feature registration 2021-03-16 17:58:59 +00:00
gl gldownload: use the GstGLSyncMeta in all cases 2021-07-27 13:30:56 +10:00
libvisual libvisual: workaround clang warning 2020-12-14 11:37:56 +00:00
ogg oggdemux: fix a race in push mode when performing the duration seek 2021-06-23 05:09:41 +00:00
opus opusdec: Add Converter class to hint gst-validate 2021-05-11 15:06:39 -04:00
pango basetextoverlay: add debug category 2021-05-17 10:20:05 +00:00
theora theora: allow per feature registration 2021-03-16 17:58:59 +00:00
vorbis vorbis: avoid duplicate symbols 2021-04-21 12:40:53 +02:00
meson.build meson: Remove outdated msvc-specific disabling code 2019-02-21 19:19:09 +05:30