mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: try to recover when mmap_begin fails
In case the get_avail call did not catch the device error, handle the error and try to recover in the mmap_begin call instead. See #3315
This commit is contained in:
parent
39165a8471
commit
b32715ba41
1 changed files with 2 additions and 0 deletions
|
|
@ -2263,6 +2263,7 @@ again:
|
|||
if (SPA_UNLIKELY((res = snd_pcm_mmap_begin(hndl, &my_areas, &offset, &frames)) < 0)) {
|
||||
spa_log_error(state->log, "%s: snd_pcm_mmap_begin error: %s",
|
||||
state->props.device, snd_strerror(res));
|
||||
alsa_recover(state, res);
|
||||
return res;
|
||||
}
|
||||
spa_log_trace_fp(state->log, "%p: begin offset:%ld avail:%ld threshold:%d",
|
||||
|
|
@ -2500,6 +2501,7 @@ int spa_alsa_read(struct state *state)
|
|||
if ((res = snd_pcm_mmap_begin(hndl, &my_areas, &offset, &to_read)) < 0) {
|
||||
spa_log_error(state->log, "%s: snd_pcm_mmap_begin error: %s",
|
||||
state->props.device, snd_strerror(res));
|
||||
alsa_recover(state, res);
|
||||
return res;
|
||||
}
|
||||
spa_log_trace_fp(state->log, "%p: begin offs:%ld frames:%ld to_read:%ld thres:%d", state,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue