Accepting request 866049 from home:tiwai:branches:multimedia:libs

- Yet more fixes for the crash with dmix plugin (bsc#1181194):
  0045-pcm-direct-Fix-the-missing-appl_ptr-update.patch
  0046-pcm-ioplug-Pass-appl_ptr-and-hw_ptr-in-snd_pcm_statu.patch
  0047-pcm-null-Pass-appl_ptr-and-hw_ptr-in-snd_pcm_status.patch
  0048-pcm-share-Pass-appl_ptr-and-hw_ptr-in-snd_pcm_status.patch

OBS-URL: https://build.opensuse.org/request/show/866049
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=293
This commit is contained in:
Takashi Iwai 2021-01-22 15:15:25 +00:00 committed by Git OBS Bridge
parent 2d37bad8df
commit db906bd962
6 changed files with 168 additions and 0 deletions

View File

@ -0,0 +1,61 @@
From 8e15c712ed96ea8d1314e94b15a946916394b17b Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Fri, 22 Jan 2021 15:37:08 +0100
Subject: [PATCH 45/48] pcm: direct: Fix the missing appl_ptr update
A snd_pcm_status() call for the direct plugins receives the status
from the slave PCM, but this doesn't contain a valid appl_ptr, since
the slave PCM for the direct plugins is in a free-wheel mode, hence
the appl_ptr is always zero. This result in the inconsistent
status->appl_ptr and pcm->appl.ptr, hitting the recently introduced
assert() call.
Fix it by transferring the plugin's appl_ptr to the upper caller.
BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1181194
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
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 be2675aff0f3..d8495065d5d7 100644
--- a/src/pcm/pcm_dmix.c
+++ b/src/pcm/pcm_dmix.c
@@ -495,6 +495,7 @@ static int snd_pcm_dmix_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
}
status->state = snd_pcm_dmix_state(pcm);
+ 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);
status->avail_max = status->avail > dmix->avail_max ? status->avail : dmix->avail_max;
diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c
index 10243013714d..dccb137be253 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->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);
status->avail_max = status->avail > dshare->avail_max ? status->avail : dshare->avail_max;
diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c
index c6e8cd279b53..695bf4aa340e 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->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);
status->avail_max = status->avail > dsnoop->avail_max ? status->avail : dsnoop->avail_max;
--
2.26.2

View File

@ -0,0 +1,31 @@
From 2c57c2c959941de50a4492f151cfd9973c46d41e Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Fri, 22 Jan 2021 15:41:15 +0100
Subject: [PATCH 46/48] pcm: ioplug: Pass appl_ptr and hw_ptr in
snd_pcm_status()
The snd_pcm_status() of the ioplug doesn't return the current
positions of hw_ptr and appl_ptr as advertised. Fix it by copying the
current values stored in the plugin data.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_ioplug.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/pcm/pcm_ioplug.c b/src/pcm/pcm_ioplug.c
index e141b1f98da7..a1463bf6b50a 100644
--- a/src/pcm/pcm_ioplug.c
+++ b/src/pcm/pcm_ioplug.c
@@ -133,6 +133,8 @@ static int snd_pcm_ioplug_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
gettimestamp(&status->tstamp, pcm->tstamp_type);
status->avail = snd_pcm_mmap_avail(pcm);
status->avail_max = io->avail_max;
+ status->appl_ptr = *pcm->appl.ptr;
+ status->hw_ptr = *pcm->hw.ptr;
if (snd_pcm_ioplug_delay(pcm, &sd) < 0)
sd = snd_pcm_mmap_delay(pcm);
status->delay = sd;
--
2.26.2

View File

@ -0,0 +1,29 @@
From 440c42ec5c90e3e345dd72c6c1d604a30b6a8e94 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Fri, 22 Jan 2021 15:42:38 +0100
Subject: [PATCH 47/48] pcm: null: Pass appl_ptr and hw_ptr in snd_pcm_status()
Just like the previous fix for ioplug, the null plugin also misses the
appl_ptr and hw_ptr updates for snd_pcm_status(). Fix it as well.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_null.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/pcm/pcm_null.c b/src/pcm/pcm_null.c
index 1d81548569f0..c8ea9b38785f 100644
--- a/src/pcm/pcm_null.c
+++ b/src/pcm/pcm_null.c
@@ -96,6 +96,8 @@ static int snd_pcm_null_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
memset(status, 0, sizeof(*status));
status->state = null->state;
status->trigger_tstamp = null->trigger_tstamp;
+ status->appl_ptr = *pcm->appl.ptr;
+ status->hw_ptr = *pcm->hw.ptr;
gettimestamp(&status->tstamp, pcm->tstamp_type);
status->avail = snd_pcm_null_avail_update(pcm);
status->avail_max = pcm->buffer_size;
--
2.26.2

View File

@ -0,0 +1,30 @@
From 1705e7c0aba0a9e010e55c8e76851fe57e1e3c70 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Fri, 22 Jan 2021 15:43:28 +0100
Subject: [PATCH 48/48] pcm: share: Pass appl_ptr and hw_ptr in
snd_pcm_status()
This one also has the same problem as others; the appl_ptr and hw_ptr
of share plugin aren't updated in snd_pcm_status() call. Fix it.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_share.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/pcm/pcm_share.c b/src/pcm/pcm_share.c
index bff9507d6422..72509491b366 100644
--- a/src/pcm/pcm_share.c
+++ b/src/pcm/pcm_share.c
@@ -711,6 +711,8 @@ static int snd_pcm_share_status(snd_pcm_t *pcm, snd_pcm_status_t *status)
_notrunning:
status->delay = sd + d;
status->state = share->state;
+ status->appl_ptr = *pcm->appl.ptr;
+ status->hw_ptr = *pcm->hw.ptr;
status->trigger_tstamp = share->trigger_tstamp;
_end:
Pthread_mutex_unlock(&slave->mutex);
--
2.26.2

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Fri Jan 22 15:50:07 CET 2021 - tiwai@suse.de
- Yet more fixes for the crash with dmix plugin (bsc#1181194):
0045-pcm-direct-Fix-the-missing-appl_ptr-update.patch
0046-pcm-ioplug-Pass-appl_ptr-and-hw_ptr-in-snd_pcm_statu.patch
0047-pcm-null-Pass-appl_ptr-and-hw_ptr-in-snd_pcm_status.patch
0048-pcm-share-Pass-appl_ptr-and-hw_ptr-in-snd_pcm_status.patch
-------------------------------------------------------------------
Thu Jan 21 09:36:12 CET 2021 - tiwai@suse.de

View File

@ -95,6 +95,10 @@ Patch41: 0041-conf-USB-add-Xonar-U7-MKII-to-USB-Audio.pcm.iec958_d.patch
Patch42: 0042-pcm_plugin-set-the-initial-hw_ptr-appl_ptr-from-the-.patch
Patch43: 0043-pcm-dmix-dshare-delay-calculation-fixes-and-cleanups.patch
Patch44: 0044-topology-fix-parse_tuple_set-remove-dead-condition-c.patch
Patch45: 0045-pcm-direct-Fix-the-missing-appl_ptr-update.patch
Patch46: 0046-pcm-ioplug-Pass-appl_ptr-and-hw_ptr-in-snd_pcm_statu.patch
Patch47: 0047-pcm-null-Pass-appl_ptr-and-hw_ptr-in-snd_pcm_status.patch
Patch48: 0048-pcm-share-Pass-appl_ptr-and-hw_ptr-in-snd_pcm_status.patch
# rest suse fixes
Patch101: alsa-lib-ignore-non-accessible-ALSA_CONFIG_PATH.patch
BuildRequires: doxygen
@ -226,6 +230,10 @@ This package contains the library for ALSA topology support.
%patch42 -p1
%patch43 -p1
%patch44 -p1
%patch45 -p1
%patch46 -p1
%patch47 -p1
%patch48 -p1
%patch101 -p1
%build