[alsa-devel] [PATCH 2/2] alsa-lib: bring pcm.h and pcm.c in sync with the kernel list
zonque at gmail.com
Sat Apr 6 19:58:34 CEST 2013
On 06.04.2013 19:52, Jussi Laako wrote:
>> All audio formats are specified in *bytes* for sample and buffer sizes,
>> so we will also keep it that way for DSD.
> Umm, IIRC, all the ALSA PCM API snd_pcm_*_period_size() stuff is in
> number of frames? (number of samples per channel)
I was talking about the SND_PCM_FORMAT_ definitions that I augmented.
What they denote is bytes per sample frame, not bits.
> Thus size of the
> buffer is period size * sample size * channels (* nperiods). So if we
> would use 2.8 MHz as sampling rate for DSD, then buffer size would be
> period size * 1/8 * channels, since one sample of DSD is eight' of a byte.
No, you would choose 1/8 of the actual sample rate, because the actual
transport goes in multiple of 8 bits.
> And sampling rate is number of frames per second. So it is quite clear
> and non-confusing.
... and one frame is also just 8 bits (or 16, for the second format). I
think that matches the logic quite well.
More information about the Alsa-devel