mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-07 13:30:07 -05:00
pcm: dsnoop: Added "hw_ptr_alignment" option in configuration for slave pointer alignment
This change adapt the fix commit 6b058fda9d
("pcm: dmix: Add option to allow alignment of slave pointers")
for dsnoop plugin
Issue is that snd_pcm_wait() goes back to waiting because the hw_ptr
is not period aligned. Therefore snd_pcm_wait() will block for a longer
time as required.
With these rcar driver changes the exact position of the dma is returned.
During snd_pcm_start they read hw_ptr as reference, and this hw_ptr
is now not period aligned, and is a little ahead over the period while it
is read. Therefore when the avail is calculated during snd_pcm_wait(),
it is missing the avail_min by a few frames.
An additional option hw_ptr_alignment is provided to dsnoop configuration,
to allow the user to configure the slave application and hw pointer
alignment at startup
Signed-off-by: Vanitha Channaiah <vanitha.channaiah@in.bosch.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
7265e603bf
commit
3ab7980047
4 changed files with 33 additions and 2 deletions
|
|
@ -333,6 +333,7 @@ static int snd_pcm_dshare_reset(snd_pcm_t *pcm)
|
|||
snd_pcm_direct_t *dshare = pcm->private_data;
|
||||
dshare->hw_ptr %= pcm->period_size;
|
||||
dshare->appl_ptr = dshare->last_appl_ptr = dshare->hw_ptr;
|
||||
dshare->slave_appl_ptr = dshare->slave_hw_ptr = *dshare->spcm->hw.ptr;
|
||||
snd_pcm_direct_reset_slave_ptr(pcm, dshare);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -342,6 +343,7 @@ static int snd_pcm_dshare_start_timer(snd_pcm_t *pcm, snd_pcm_direct_t *dshare)
|
|||
int err;
|
||||
|
||||
snd_pcm_hwsync(dshare->spcm);
|
||||
dshare->slave_appl_ptr = dshare->slave_hw_ptr = *dshare->spcm->hw.ptr;
|
||||
snd_pcm_direct_reset_slave_ptr(pcm, dshare);
|
||||
err = snd_timer_start(dshare->timer);
|
||||
if (err < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue