update to 1.2.5.1

Resolves: rhbz#1977253
This commit is contained in:
Jaroslav Kysela 2021-07-29 15:17:41 +02:00
parent e2a98f67dc
commit f50c1ab3ca
3 changed files with 229 additions and 7 deletions

View File

@ -0,0 +1,219 @@
From e47c11822d6b459a9b3704b3ee6a4a5c9a1b85be Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 29 Jun 2021 18:02:27 +0200
Subject: [PATCH 1/2] control: remap - assign right name to the child handle
for no-op
Fixes: https://github.com/alsa-project/alsa-utils/issues/100
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/control/control_remap.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/control/control_remap.c b/src/control/control_remap.c
index a85c1725..81524014 100644
--- a/src/control/control_remap.c
+++ b/src/control/control_remap.c
@@ -1173,6 +1173,10 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema
/* no-op check, remove the plugin */
if (priv->map_items == 0 && priv->remap_items == 0) {
remap_free(priv);
+ free(child->name);
+ child->name = name ? strdup(name) : NULL;
+ if (name && !child->name)
+ return -ENOMEM;
*handlep = child;
return 0;
}
--
2.31.1
From 23a191a82c693456e61431ab699cddc1e5782a26 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 29 Jun 2021 19:31:28 +0200
Subject: [PATCH 2/2] control: remap - assign right name to the child handle
for no-op (2nd case)
Fixes: https://github.com/alsa-project/alsa-utils/issues/100
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/control/control_remap.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/control/control_remap.c b/src/control/control_remap.c
index 81524014..4914f960 100644
--- a/src/control/control_remap.c
+++ b/src/control/control_remap.c
@@ -1154,6 +1154,10 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema
snd_ctl_t *ctl;
int result, err;
+ /* no-op, remove the plugin */
+ if (!remap && !map)
+ goto _noop;
+
priv = calloc(1, sizeof(*priv));
if (priv == NULL)
return -ENOMEM;
@@ -1173,6 +1177,7 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema
/* no-op check, remove the plugin */
if (priv->map_items == 0 && priv->remap_items == 0) {
remap_free(priv);
+ _noop:
free(child->name);
child->name = name ? strdup(name) : NULL;
if (name && !child->name)
@@ -1316,11 +1321,6 @@ int _snd_ctl_remap_open(snd_ctl_t **handlep, char *name, snd_config_t *root, snd
err = _snd_ctl_open_child(&cctl, root, child, mode, conf);
if (err < 0)
return err;
- /* no-op, remove the plugin */
- if (!remap && !map) {
- *handlep = cctl;
- return 0;
- }
err = snd_ctl_remap_open(handlep, name, remap, map, cctl, mode);
if (err < 0)
snd_ctl_close(cctl);
--
2.31.1
From dd609ef9684987d3ca61d5c5cc3c77589ff9c29f Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Mon, 21 Jun 2021 09:28:41 +0200
Subject: [PATCH] pcm: direct plugins - fix hw_ptr in the status callback
The parent hw_ptr may be in another range (boundary limit).
Set the correct value for the caller.
BugLink: https://github.com/alsa-project/alsa-lib/issues/155
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_dmix.c | 1 +
src/pcm/pcm_dshare.c | 1 +
src/pcm/pcm_dsnoop.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c
index 0d0d0bff..94dbb1e0 100644
--- a/src/pcm/pcm_dmix.c
+++ b/src/pcm/pcm_dmix.c
@@ -491,6 +491,7 @@ static int snd_pcm_dmix_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
}
status->state = snd_pcm_dmix_state(pcm);
+ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */
status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */
status->trigger_tstamp = dmix->trigger_tstamp;
status->avail = snd_pcm_mmap_playback_avail(pcm);
diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c
index a918512b..01814dc8 100644
--- a/src/pcm/pcm_dshare.c
+++ b/src/pcm/pcm_dshare.c
@@ -243,6 +243,7 @@ static int snd_pcm_dshare_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
break;
}
status->state = snd_pcm_dshare_state(pcm);
+ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */
status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */
status->trigger_tstamp = dshare->trigger_tstamp;
status->avail = snd_pcm_mmap_playback_avail(pcm);
diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c
index 2c3b9f43..3f28df99 100644
--- a/src/pcm/pcm_dsnoop.c
+++ b/src/pcm/pcm_dsnoop.c
@@ -193,6 +193,7 @@ static int snd_pcm_dsnoop_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
snd_pcm_status(dsnoop->spcm, status);
state = snd_pcm_state(dsnoop->spcm);
status->state = state == SND_PCM_STATE_RUNNING ? dsnoop->state : state;
+ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */
status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */
status->trigger_tstamp = dsnoop->trigger_tstamp;
status->avail = snd_pcm_mmap_capture_avail(pcm);
--
2.31.1
From e0e084659083c2ab75d5c894f24227ea2f67010f Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Mon, 21 Jun 2021 15:14:18 +0200
Subject: [PATCH] pcm: direct plugins - fix bad memory access when channel
bindings do not match hw
Fix and cleanup snd_pcm_direct_check_interleave() function.
Add requested / hardware channel check and use goto when the interleaved
Fixes: https://github.com/alsa-project/alsa-lib/issues/117
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_direct.c | 40 +++++++++++++++++-----------------------
1 file changed, 17 insertions(+), 23 deletions(-)
diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
index d50503e3..90417b2f 100644
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -1627,43 +1627,37 @@ int snd_pcm_direct_set_timer_params(snd_pcm_direct_t *dmix)
int snd_pcm_direct_check_interleave(snd_pcm_direct_t *dmix, snd_pcm_t *pcm)
{
unsigned int chn, channels;
- int bits, interleaved = 1;
+ int bits;
const snd_pcm_channel_area_t *dst_areas;
const snd_pcm_channel_area_t *src_areas;
bits = snd_pcm_format_physical_width(pcm->format);
if ((bits % 8) != 0)
- interleaved = 0;
+ goto __nointerleaved;
channels = dmix->channels;
+ if (channels != dmix->spcm->channels)
+ goto __nointerleaved;
dst_areas = snd_pcm_mmap_areas(dmix->spcm);
src_areas = snd_pcm_mmap_areas(pcm);
for (chn = 1; chn < channels; chn++) {
- if (dst_areas[chn-1].addr != dst_areas[chn].addr) {
- interleaved = 0;
- break;
- }
- if (src_areas[chn-1].addr != src_areas[chn].addr) {
- interleaved = 0;
- break;
- }
+ if (dst_areas[chn-1].addr != dst_areas[chn].addr)
+ goto __nointerleaved;
+ if (src_areas[chn-1].addr != src_areas[chn].addr)
+ goto __nointerleaved;
}
for (chn = 0; chn < channels; chn++) {
- if (dmix->bindings && dmix->bindings[chn] != chn) {
- interleaved = 0;
- break;
- }
+ if (dmix->bindings && dmix->bindings[chn] != chn)
+ goto __nointerleaved;
if (dst_areas[chn].first != chn * bits ||
- dst_areas[chn].step != channels * bits) {
- interleaved = 0;
- break;
- }
+ dst_areas[chn].step != channels * bits)
+ goto __nointerleaved;
if (src_areas[chn].first != chn * bits ||
- src_areas[chn].step != channels * bits) {
- interleaved = 0;
- break;
- }
+ src_areas[chn].step != channels * bits)
+ goto __nointerleaved;
}
- return dmix->interleaved = interleaved;
+ return dmix->interleaved = 1;
+__nointerleaved:
+ return dmix->interleaved = 0;
}
/*
--
2.31.1

View File

@ -2,14 +2,14 @@
#define prever_dot .rc3
#define postver a
%define version_alsa_lib 1.2.4
%define version_alsa_ucm 1.2.4
%define version_alsa_tplg 1.2.4
%define version_alsa_lib 1.2.5.1
%define version_alsa_ucm 1.2.5.1
%define version_alsa_tplg 1.2.5
Summary: The Advanced Linux Sound Architecture (ALSA) library
Name: alsa-lib
Version: %{version_alsa_lib}
Release: 6%{?prever_dot}%{?dist}
Release: 1%{?prever_dot}%{?dist}
License: LGPLv2+
URL: http://www.alsa-project.org/
@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h
%{_datadir}/alsa/topology
%changelog
* Thu Jul 29 2021 Jaroslav Kysela <perex@perex.cz> - 1.2.5.1-1
- update to 1.2.5.1
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 1.2.4-6
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937

View File

@ -1,3 +1,3 @@
SHA512 (alsa-lib-1.2.4.tar.bz2) = 12086952dc8f16f1cb6946517858e17b1c3276aeda9ff5703a84bb38aa78eb4c4e9cb4485c5b3f21f174fdbd976b3bcbbc481e85cb2460652858490df51ae844
SHA512 (alsa-ucm-conf-1.2.4.tar.bz2) = 9043460e92b2ed44757b08b9faca888e8bfae40d84e4ad7e7df44df2bb3b0617e86ef23783973accd62fb6681788262e67212e2bf67178d75781e57a0fa346d2
SHA512 (alsa-topology-conf-1.2.4.tar.bz2) = e5b367a23f42ed2c2a83f3dd9df264b4e054f5ba7c4be98520418598f0b06a11627498a8a6ef943522b209951645f83bbbbfb32db7c9c8260aa5db08358970cb
SHA512 (alsa-lib-1.2.5.1.tar.bz2) = 01998ffa449e925ff552c13aea47f9540903afdc533086067c78dcaba4d239c347180d3d28bb0000e6d19b7779c7249fcc77a30057930ca22d18ba55e163fa1c
SHA512 (alsa-ucm-conf-1.2.5.1.tar.bz2) = 774d6da1a0ee6fb1fcd764c1d4b3eb5812a35508cf27db71f6c82784f125eca207992da9081d25783fecb31e548d8b34124d4b3b3d506e33215b76ea48f71012
SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51