Skip to contentSkip to conversation

Strange behaviour with varying frame sizes on read

DISCUSSION Metathronius Galabant 1 participant 1 message Jul 29, 2009

lore
Share & tools
lore
#0 lore raw

Hi all,

please consider the following:
Period size is 80 frames, buffer size is 320 frames. For all 3 tests I have 240 frames ready to read. snd_pcm_avail_update() confirms this.

Outcome of my tests:
1) I want to read 80 frames, and get 80 frames. - OK, this is really basic.
2) I want to read 81 frames, and get 80 frames. - FAIL.
3) I want to read 80 frames, and get 80 frames. Then I read 1 frame, and get 1 frame. - HUH?

I've both tested snd_pcm_readi() and snd_pcm_mmap_readi() - both have the same semantic.
Is there any explanation for this kind of illogical behaviour (I have version 1.0.14, which might be a bit old, but still)?
I should be able to read rather arbitrary amounts from a software buffer, don't I?

Cheers,
M.