Hello Jaroslav-san, Takashi-san,
Which hardware exactly? The hw_ptr should be reset when the streaming starts. It appears that the problem is specific to the direct plugins only when the period wakeups are a bit different than for the direct hardware access.
Firstly, sorry for late reply.
Issue is seen in RCar Kingfischer H3 es2.0 target.
The issue was seen during the below commit : commit 07b7acb51d283d8469696c906b91f1882696a4d4 ("ASoC: rsnd: update pointer more accurate") https://patchwork.kernel.org/patch/9772671/
There could be a non-uniform jitter exists between when interrupt raised [rcar_dmac_isr_channel(), rcar_dmac_isr_channel_thread()] and the interrupt is processed to read/calculate the DMA position [dma_set_residue()] This could result in unaligned hw_ptr reported at user-space alsa lib.
Best regards, Vanitha Channaiah RBEI/ECF3
Tel. +91 80 6136-4436
-----Original Message----- From: Jaroslav Kysela perex@perex.cz Sent: Thursday, May 16, 2019 11:05 PM To: Channaiah Vanitha (RBEI/ECF3) Vanitha.Channaiah@in.bosch.com; Takashi Iwai tiwai@suse.de Cc: Wischer Timo (ADITG/ESS) twischer@de.adit-jv.com; alsa-devel@alsa-project.org Subject: Re: [alsa-devel] [PATCH v2 6/6] pcm: Update pcm->avail_min with needed_slave_avail_min, after reading unaligned frames
Dne 16. 05. 19 v 19:26 Channaiah Vanitha (RBEI/ECF3) napsal(a):
Hello Takashi-san,
Can we avoid adding such a hack in the core code? Basically the issue is very specific to direct-plugins, so this sort of workaround should be implemented locally there instead. I guess we can do similar tricks by overriding the calls in the callbacks.
Issue can be seen without direct plugins too with involvement of only hw which reports unaligned hw ptr. As I have explained in below detailed description: "Also, this issue can be seen without dsnoop plugin, when HW reports unaligned hw_ptr For e.g. "
Which hardware exactly? The hw_ptr should be reset when the streaming starts. It appears that the problem is specific to the direct plugins only when the period wakeups are a bit different than for the direct hardware access.
Jaroslav
-- Jaroslav Kysela <perex@perex.czmailto:perex@perex.cz> Linux Sound Maintainer; ALSA Project; Red Hat, Inc.