[alsa-devel] Discarding the first few frames inside the kernel
Takashi Sakamoto
o-takashi at sakamocchi.jp
Thu Jan 21 03:18:44 CET 2016
Hi,
On Jan 21 2016 02:24, Ankhit Vivekananda wrote:
> I am not sure as to how the wait for 4.5ms can be applied there?
I think you asked about the way to achieve the idea.
Call kernel's process scheduler in the .prepare() implementation of your
driver. For example, msleep() in <linux/delay.h> (More geneous logic is
preferrable, I think.)
Don't do this in .trigger() implementation, because this can be called
in interrupt context, or between
spin_lock_irqsave()/spin_lock_irqstore() in process context.
> Alternatively, does calling snd_pcm_format_set_silence(), be a safe
> method to silence the first few samples coming out of the buffer?
I don't know exactly because I have no supplemental information about
your driver and hardware design.
Regards
Takashi Sakamoto
More information about the Alsa-devel
mailing list