Re: Buffer size calculation based on period size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



noman pouigt wrote:
> I am using tinycap to capture the audio and
> setting below settings:
> bitwidth =  16
> rate =  16000
> channel =  1
> period_size =  320
> period_count = 2
>
> I am wondering how is below
> period_size and buffer_size calculated?
>
> Shouldn't period_size of 320 bytes and
> period_count of 2 fail?

>From the tinyalsa source code:

    param_set_min(&params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, config->period_size);

So it uses either the supplied value, or if that is too small, the
smallest allowed value.

> cat sub0/hw_params
>
> access: RW_INTERLEAVED
> format: S16_LE
> subformat: STD
> channels: 1
> rate: 16000 (16000/1)
> period_size: 2042
> buffer_size: 4084

The actual values of period_size and period_count are returned by
pcm_open().


Regards,
Clemens
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux