Skip to contentSkip to conversation

snd_pcm_runtime.buffer_size question

DISCUSSION Tim Blechmann 2 participants 2 messages Feb 11, 2009

lore
Share & tools
lore
#0 lore raw

hi all,
i am currently fighting with the snd_pcm_runtime.buffer_size. how is the value defined?

i would expect:
channels * periods * period_size * sample_bits/8
(in my case 64*5*128*3)

however in the code, i am working on, it seems to be:
periods * period_size
(in my case 5*128)

am i missing something obvious?

thanks, tim

Signature · 5 lines
[email protected]
http://tim.klingt.org

Just what the hell is the experimental tradition?
  Morton Feldman

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#1 lore raw

At Wed, 11 Feb 2009 18:21:11 +0100,

Quoted 9 lines · Tim Blechmann

hi all,
i am currently fighting with the snd_pcm_runtime.buffer_size. how is the value defined?

i would expect:
channels * periods * period_size * sample_bits/8
(in my case 64*5*128*3)

Quoted 5 lines

however in the code, i am working on, it seems to be:
periods * period_size
(in my case 5*128)

am i missing something obvious?

There is a difference between buffer_size and buffer_bytes. The former is in "frame" unit while the latter is in bytes. In ALSA, 1 frame corresponds to (channels*sample_bits/8) bytes.

Takashi