[alsa-devel] [PATCH RFC 0/9] audio timestamping evolutions

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Fri Dec 12 16:28:46 CET 2014


>
> #define PERIOD 6000
>
> #define PLAYBACK_BUFFERS 4
>
> unsigned char buffer_p[PERIOD*4*4];
> unsigned char buffer_c[PERIOD*4*4];
>
> I don't understand why you hard coded PERIOD and PLAYBACK_BUFFERS
> when you use snd_pcm_set_params

Thanks for pointing this out. I have no idea what this is still there, i 
think the idea was to use a fixed-size buffer to make sure the timing is 
predictable, it's been that way for 2+ years. Will fix.

>
> since period size and buffer size can be obtained by
> snd_pcm_get_params() after calling snd_pcm_set_params()
>
> if ((err = snd_pcm_set_params(handle_p,
>                                SND_PCM_FORMAT_S16,
>                                SND_PCM_ACCESS_RW_INTERLEAVED,
>                                2,
>                                48000,
>                                0,
>                                500000)) < 0) { /* 0.5sec */
>



More information about the Alsa-devel mailing list