OSDN Git Service

pcm: dmix: Add option to allow alignment of slave pointers
authorLaxmi Devi <Laxmi.Devi@in.bosch.com>
Tue, 13 Nov 2018 07:43:00 +0000 (08:43 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 13 Nov 2018 14:18:40 +0000 (15:18 +0100)
commit6b058fda9dce8f416774ae54975f5706f3f5a6da
treedf5ee0c59d2e566e71f81d7121f6c539f5d24e81
parent178fe66bc88c6ccdd3b90195e7178293d368a83b
pcm: dmix: Add option to allow alignment of slave pointers

These changes are required due to the kernel
commit 07b7acb51d283d8469696c906b91f1882696a4d4
("ASoC: rsnd: update pointer more accurate")

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 dmix configuration,
to allow the user to configure the slave application and hw pointer
alignment at startup

[ Slight indentation and parentheses removals by tiwai ]

Signed-off-by: Laxmi Devi <Laxmi.Devi@in.bosch.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_direct.c
src/pcm/pcm_direct.h
src/pcm/pcm_dmix.c