[alsa-devel] A question about period

Takashi Iwai tiwai at suse.de
Fri Aug 3 09:31:25 CEST 2018


On Fri, 03 Aug 2018 08:28:37 +0200,
Yu-hsuan Hsu wrote:
> 
> Hi all,
> 
> I have a question about the period we set in hw_params. I found different
> boards may have different explanations about it. I have two guesses about
> its meaning.
> 
> 1. The period_size is the size of each hardware's consumption. If we set
> period size to N, the pcm will consume N frames each time.
> 
> 2. The period_size is the size to control when hardware call interrupt. If
> we set period size to N, the pcm consume frames in its step. When the
> number of frames it consumes more than N, it will call interrupt.

2 is the correct answer.


HTH,

Takashi

> We can use snd_pcm_avail function to check the real available frames in
> the device. If guess 1 is correct, the size of consumption should be fixed.
> Else, setting period_size is nothing to do with hardware's
> consumption. I've checked some boards and found that each board has
> different behavior (Most of them meet guess 2). I'm confuse which one is
> correct. Thanks!
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 


More information about the Alsa-devel mailing list