mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
pcm: Fix secondary retry in dsnoop and dshare
The commit [fdba9e1bad: pcm: Fallback open as the first instance for
dmix & co] introduced a mechanism to retry the open of slave PCM for
the secondary streams, but this also introduced a regression in dsnoop
and dshare plugins: since the retry goto-tag was placed at a wrong
position, it retries to re-fetch the shm unnecessarily and eventually
leads to the fatal error.
The bug can be easily reproduced by starting arecord and killing it
via SIGKILL, then starting arecord again. The second arecord fails.
The fix is obviously to move the wrong retry goto-tags to the right
positions.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
d942498bfb
commit
2fa36eb03c
2 changed files with 2 additions and 2 deletions
|
|
@ -690,7 +690,6 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name,
|
|||
break;
|
||||
}
|
||||
|
||||
retry:
|
||||
first_instance = ret = snd_pcm_direct_shm_create_or_connect(dshare);
|
||||
if (ret < 0) {
|
||||
SNDERR("unable to create IPC shm instance");
|
||||
|
|
@ -705,6 +704,7 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name,
|
|||
dshare->max_periods = opts->max_periods;
|
||||
dshare->sync_ptr = snd_pcm_dshare_sync_ptr;
|
||||
|
||||
retry:
|
||||
if (first_instance) {
|
||||
/* recursion is already checked in
|
||||
snd_pcm_direct_get_slave_ipc_offset() */
|
||||
|
|
|
|||
|
|
@ -583,7 +583,6 @@ int snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name,
|
|||
break;
|
||||
}
|
||||
|
||||
retry:
|
||||
first_instance = ret = snd_pcm_direct_shm_create_or_connect(dsnoop);
|
||||
if (ret < 0) {
|
||||
SNDERR("unable to create IPC shm instance");
|
||||
|
|
@ -598,6 +597,7 @@ int snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name,
|
|||
dsnoop->max_periods = opts->max_periods;
|
||||
dsnoop->sync_ptr = snd_pcm_dsnoop_sync_ptr;
|
||||
|
||||
retry:
|
||||
if (first_instance) {
|
||||
/* recursion is already checked in
|
||||
snd_pcm_direct_get_slave_ipc_offset() */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue