[alsa-devel] Noisy audio - ALSA Configuration
m-iovescu1 at ti.com
Thu Aug 16 01:27:00 CEST 2007
>> Does anyone have examples or documentation on how to configure
>> frames and buffers for various sample rates? I am writing a
>> route a mp3 decoder output to ALSA on an ARM processor, and I
>> audio. For a CD quality stream (S16_LE, 44100 kHz, Stereo, 128
bps) I am
>> using an output buffer of 44100 bytes, a period of
>>Be careful about the distinction between bytes and frames (i.e.
>>a frame of stereo S16 is 4 bytes)
>Start with the period
>1024 frames = 4096 bytes
>then make your buffer at least 2x this:
> (I'm not an app developer, so others may jump in with a better
>Did you look at the code in alsa-lib/test?
Thanks Eliot, I will try this buffer size.
I did look at alsa tests, but I was not too convinced, as when I run
those apps I still got plenty of short writes. Would someone please
explain why do these 'short writes' occur?
>> a buffer this big, I do not get underruns, but I do get all
short writes. I
>> have not been able to find the right configuration to avoid
>> and more importantly, to get good quality audio. What do
'short writes' (I
>> am using writei) really mean? Is this a performance issue in
the driver, or
> is mainly because of buffer setup? I would really appreciate
any help with
More information about the Alsa-devel