mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: with IRQ we can use avail_update()
It does not need an ioctl because the driver already updated the info before waking us up from poll.
This commit is contained in:
parent
1f1c308c97
commit
354ee6fd96
1 changed files with 10 additions and 2 deletions
|
|
@ -1992,15 +1992,23 @@ recover:
|
||||||
return do_start(state);
|
return do_start(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline snd_pcm_sframes_t alsa_avail(struct state *state)
|
||||||
|
{
|
||||||
|
if (state->disable_tsched)
|
||||||
|
return snd_pcm_avail_update(state->hndl);
|
||||||
|
else
|
||||||
|
return snd_pcm_avail(state->hndl);
|
||||||
|
}
|
||||||
|
|
||||||
static int get_avail(struct state *state, uint64_t current_time, snd_pcm_uframes_t *delay)
|
static int get_avail(struct state *state, uint64_t current_time, snd_pcm_uframes_t *delay)
|
||||||
{
|
{
|
||||||
int res, suppressed;
|
int res, suppressed;
|
||||||
snd_pcm_sframes_t avail;
|
snd_pcm_sframes_t avail;
|
||||||
|
|
||||||
if (SPA_UNLIKELY((avail = snd_pcm_avail(state->hndl)) < 0)) {
|
if (SPA_UNLIKELY((avail = alsa_avail(state)) < 0)) {
|
||||||
if ((res = alsa_recover(state, avail)) < 0)
|
if ((res = alsa_recover(state, avail)) < 0)
|
||||||
return res;
|
return res;
|
||||||
if ((avail = snd_pcm_avail(state->hndl)) < 0) {
|
if ((avail = alsa_avail(state)) < 0) {
|
||||||
if ((suppressed = spa_ratelimit_test(&state->rate_limit, current_time)) >= 0) {
|
if ((suppressed = spa_ratelimit_test(&state->rate_limit, current_time)) >= 0) {
|
||||||
spa_log_warn(state->log, "%s: (%d suppressed) snd_pcm_avail after recover: %s",
|
spa_log_warn(state->log, "%s: (%d suppressed) snd_pcm_avail after recover: %s",
|
||||||
state->props.device, suppressed, snd_strerror(avail));
|
state->props.device, suppressed, snd_strerror(avail));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue