diff options
| author | Michael Forney <mforney@mforney.org> | 2021-02-26 20:05:16 -0800 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2021-03-02 16:20:18 -0800 |
| commit | b7872f76ea1238add98024442dec443e34aba6fc (patch) | |
| tree | 3305e0edc6b47175e00e907ea148faececa8ee2f /pkg/sndio | |
| parent | d95cf9fbc10110f1512b183ee22183a420645a72 (diff) | |
sndio: Fix for Linux 5.11 USB audio
Diffstat (limited to 'pkg/sndio')
| -rw-r--r-- | pkg/sndio/patch/0003-alsa-remove-existing-hardware-config-before-setting-.patch | 40 | ||||
| -rw-r--r-- | pkg/sndio/ver | 2 |
2 files changed, 41 insertions, 1 deletions
diff --git a/pkg/sndio/patch/0003-alsa-remove-existing-hardware-config-before-setting-.patch b/pkg/sndio/patch/0003-alsa-remove-existing-hardware-config-before-setting-.patch new file mode 100644 index 00000000..9bdb5266 --- /dev/null +++ b/pkg/sndio/patch/0003-alsa-remove-existing-hardware-config-before-setting-.patch @@ -0,0 +1,40 @@ +From 82a55b09bd247594a34bbc2fc08a3f129b3b4343 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Fri, 26 Feb 2021 15:03:35 -0800 +Subject: [PATCH] alsa: remove existing hardware config before setting a new + one + +In Linux 5.11, a behavior change for USB audio devices was introduced[0] +that prevents changing parameters such as sample rate or period +size once they are initially set without a snd_pcm_hw_free in +between. This causes sndio to get forced to 48000 Hz and and a +period size of 4800, since those are the parameters set during +sio_open. + +To fix this, call snd_pcm_hw_free at the start of sio_alsa_setpar_hw +to remove any previous configuration before setting a new one. + +[0] https://bugzilla.kernel.org/show_bug.cgi?id=211941 +--- + libsndio/sio_alsa.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/libsndio/sio_alsa.c b/libsndio/sio_alsa.c +index c544c4a..7ae69c2 100644 +--- a/libsndio/sio_alsa.c ++++ b/libsndio/sio_alsa.c +@@ -554,6 +554,11 @@ sio_alsa_setpar_hw(snd_pcm_t *pcm, snd_pcm_hw_params_t *hwp, + + req_rate = *rate; + ++ err = snd_pcm_hw_free(pcm); ++ if (err < 0) { ++ DALSA("couldn't reset hw configuration", err); ++ return 0; ++ } + err = snd_pcm_hw_params_any(pcm, hwp); + if (err < 0) { + DALSA("couldn't init pars", err); +-- +2.30.0 + diff --git a/pkg/sndio/ver b/pkg/sndio/ver index e773687a..3d3ddc97 100644 --- a/pkg/sndio/ver +++ b/pkg/sndio/ver @@ -1 +1 @@ -1.7.0-18-gae7637d r0 +1.7.0-18-gae7637d r1 |
