diff options
author | Olivier Langlois <olivier@trillion01.com> | 2014-01-22 19:04:45 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-01-23 09:42:01 +0100 |
commit | e51cd448971c472d75dd700b0000988f6197b4da (patch) | |
tree | ee551bd65c7e4e2715863062de16456137b44b83 /src/pcm/pcm_dmix.c | |
parent | 336dc58beba0ca7cf5650dc12ed3eb72d61ac6d3 (diff) | |
download | alsa-lib-e51cd448971c472d75dd700b0000988f6197b4da.tar.gz |
pcm: initialize pcm_dmix monotonic field
not doing so, leaves the pcm object in an inconsistent state since
'info' field is copied from the slave which is then used when
snd_pcm_hw_params_is_monotonic() is called.
For instance, when using dmix with aplay and an underrun is occuring, the following
info is returned:
underrun!!! (at least 1248687948.256 ms long)
Status:
state : XRUN
trigger_time: 1390347762.628483000
tstamp : 1390347766.184350000
delay : -635
avail : 15687
avail_max : 15675
now is computed from CLOCK_MONOTONIC while pcm status tstamps are from gettimeofday().
After the fix, underruns are still occuring on my setup but at least the displayed info
is correct:
underrun!!! (at least 7630.409 ms long)
Status:
state : XRUN
trigger_time: 7652.739201431
tstamp : 7660.369600636
delay : -624
avail : 15676
avail_max : 15664
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'src/pcm/pcm_dmix.c')
-rw-r--r-- | src/pcm/pcm_dmix.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c index 2bd5d398..4aa6d4ea 100644 --- a/src/pcm/pcm_dmix.c +++ b/src/pcm/pcm_dmix.c @@ -1104,7 +1104,7 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name, pcm->poll_fd = dmix->poll_fd; pcm->poll_events = POLLIN; /* it's different than other plugins */ - + pcm->monotonic = spcm->monotonic; pcm->mmap_rw = 1; snd_pcm_set_hw_ptr(pcm, &dmix->hw_ptr, -1, 0); snd_pcm_set_appl_ptr(pcm, &dmix->appl_ptr, -1, 0); |