pcm: Fix snd_pcm_status() for dmix & co

Fetch the timestamp and other status fields by issuing
snd_pcm_status() for the slave PCM.  Also, fill the delay field
properly.  This should fix longstanding PA's complaints.

Reported-by: Dan Hordern <danhordern@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2015-06-02 16:47:50 +02:00
parent a5e5e3cd3c
commit 18ce3ec9ca
3 changed files with 6 additions and 3 deletions

View file

@ -187,13 +187,14 @@ static int snd_pcm_dsnoop_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
break;
}
memset(status, 0, sizeof(*status));
snd_pcm_status(dsnoop->spcm, status);
state = snd_pcm_state(dsnoop->spcm);
status->state = state == SND_PCM_STATE_RUNNING ? dsnoop->state : state;
status->trigger_tstamp = dsnoop->trigger_tstamp;
status->tstamp = dsnoop->update_tstamp;
status->avail = snd_pcm_mmap_capture_avail(pcm);
status->avail_max = status->avail > dsnoop->avail_max ? status->avail : dsnoop->avail_max;
dsnoop->avail_max = 0;
status->delay = snd_pcm_mmap_capture_delay(pcm);
return 0;
}