On Tue, 30 Apr 2019 09:38:41 +0200, vanitha.channaiah@in.bosch.com wrote:
From: Vanitha Channaiah vanitha.channaiah@in.bosch.com
snd_pcm_wait() is waiting for longer time more than two periodic size as avail is less than avail_min by few frames. This is because the hw_ptr read from the kernel during snd_pcm_start() is not period aligned which is ahead of few (Nperiod + 1)frames.
Signed-off-by: Vanitha Channaiah vanitha.channaiah@in.bosch.com
Ditto as patch 2, the description is too ambiguous, and the update of documentation is missing.
And...
--- a/src/pcm/pcm_direct.c +++ b/src/pcm/pcm_direct.c @@ -2043,11 +2043,12 @@ int snd_pcm_direct_parse_open_conf(snd_config_t *root, snd_config_t *conf,
void snd_pcm_direct_reset_slave_ptr(snd_pcm_t *pcm, snd_pcm_direct_t *dmix) {
- dmix->slave_appl_ptr = dmix->slave_hw_ptr = *dmix->spcm->hw.ptr;
- /* For buffer size less than two period size, the start position
* of slave app ptr is rounded up in order to avoid xruns
if (dmix->hw_ptr_alignment == SND_PCM_HW_PTR_ALIGNMENT_ROUNDUP || (dmix->hw_ptr_alignment == SND_PCM_HW_PTR_ALIGNMENT_AUTO &&*/
pcm->buffer_size <= pcm->period_size * 2))
dmix->slave_appl_ptr = ((dmix->slave_appl_ptr + dmix->slave_period_size - 1) / dmix->slave_period_size) * dmix->slave_period_size;pcm->buffer_size < pcm->period_size * 2))
It's not good to change the helper function semantics out of sudden, even without any description.
thanks,
Takashi