gstreamer/ext/alsa
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
..
gstalsa.c alsa: Add mapping for PCM F32/F64 formats 2017-05-17 10:33:52 -04:00
gstalsa.h alsasink: Accept MPEG 1 layer 3 version 2.5 2017-05-16 15:37:16 -04:00
gstalsadeviceprovider.c alsadeviceprovider: Remove redundant start function 2020-07-20 21:12:54 +00:00
gstalsadeviceprovider.h alsa: Implement a DeviceProvider 2019-06-04 14:07:37 +00:00
gstalsaelement.c alsa: element_init returns void 2021-03-16 17:59:00 +00:00
gstalsaelements.h alsa: element_init returns void 2021-03-16 17:59:00 +00:00
gstalsamidisrc.c Use g_memdup2() where available and add fallback for older GLib versions 2021-06-02 14:21:02 +00:00
gstalsamidisrc.h alsamidisrc: unlock create function on shutdown 2017-12-08 10:35:43 +00:00
gstalsaplugin.c alsa: allow per feature registration 2020-12-10 13:01:57 +00:00
gstalsasink.c ext: alsa: Fix fallback paths for setting buffer and period times 2021-08-17 19:52:59 +00:00
gstalsasink.h alsasink: pause/resume 2019-09-27 05:34:57 +00:00
gstalsasrc.c ext: alsa: Fix fallback paths for setting buffer and period times 2021-08-17 19:52:59 +00:00
gstalsasrc.h alsasrc: added option for chosing timestamps 2019-04-29 11:23:45 +02:00
meson.build alsa: allow per feature registration 2020-12-10 13:01:57 +00:00