Re: Alsa input sample rate puzzle
Kai Vehmanen <kvehmanen <at> eca.cx>
2008-06-19 22:07:08 GMT
On Tue, 17 Jun 2008, Andrew Lees wrote:
> trying ecasound. I have a slight puzzle though. I am using an Audigy
> NX external USB card, and other recording software (arecord, audacity,
> for example) seem to think that the card supports an input side sample
> rate of 48000 s/s, but not 44100, while ecasound thinks it supports a
> 44100 rate but not 48000. Both camps are set in their ways, and will
> ecasound -f:s24_le,2,44100 -i:alsahw,1,0 -t:1800 -ge:5,0.02 -B:nonrt -o
> side2-2.wav (currently lockup are making me wary about rt modes)
> whereas ecasound -f:s24_le,2,48000 -i:alsahw,1,0 ... will not work.
that would suggest the card natively supports only 44100. Arecord should
behave similarly if you pass it:
arecord -D hw:1,0 ...
If you use the ALSA plugin layer (arecord without extra options, or
ecasound with "-i:plughw:1,0"), alsa-lib will resample the audio for you.
But usually (and especially when recording) it's better to record in the
native sample rate supported by HW (so 44100 in this case).
> Also arecord requires a -f S24_3LE option rather than a -f S24_LE option
> (which it says is not supported), while ecasound will not work with a
> -f:s24_3le, option - all very curious.
Yes, ecasound does not recognize '-f:s24_3le'. This is quite complicated
in fact... if you use the ALSA plug layer (-i:plughw:1,0 or arecord -D
plughw:1,0), alsa-lib will make the conversion for you, but otherwise you
need to understand what is going on. Basicly ALSA's S24_3LE is same as
ecasound's '-f:s24_le'. ALSA's S24_LE is in fact a 32bit sample, with
least-significant byte zeroed (so 24bit of information, stored in 32bits).
The latter one is much more common. In ecasound, you can use '-f:s32_le'
for both ALSA types S24_LE and S32_LE (because ecasound doesn't care
whether the lower bits are zeroed out or have valid info).
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
Ecasound-list mailing list
Ecasound-list <at> lists.sourceforge.net