Re: [ecasound] Alsa input sample rate puzzle

From: Andrew Lees <andrewl.oz@email-addr-hidden>
Date: Fri Jun 20 2008 - 03:24:05 EEST


On Fri, 2008-06-20 at 01:07 +0300, Kai Vehmanen wrote:

> Hi,
> 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 ...

Which is exactly what I did to get the 48000 rate, with 44100 not being
supported by arecord. So for example, this is a session:

~/Audio $ arecord -D hw:1,0 -f cd xxx.wav
Recording WAVE 'xxx.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Warning: rate is not accurate (requested = 44100Hz, got = 48000Hz)
         please, try the plug plugin
~/Audio $ arecord -D hw:1,0 -f dat xxx.wav
Recording WAVE 'xxx.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo

Happy at 48000, unhappy at 44100. The same for other formats, and the
converse of the situation with ecasound. Is there some setup that
configurs the card to do one rate vs another? I can sample at integer
multiples and ratios of 44100 with ecasound, and similarly wrt 48000
with arecord, so some basic parameter of the card must be being set up
differently in the two cases, perhaps?

> 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).

OK, that make sense.

By the way, I am using ecasound to record my LPs, and I've patched the
amplitude gate (ge) to take an optional loop count argument, so that I
can record multiple sides into one wav file with the gate opening and
closing as required. Any interest in the patch?

Thanks for the assistance, but still puzzled!

> --

Check out the new Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.

Ecasound-list mailing list
Received on Fri Jun 20 04:15:03 2008

This archive was generated by hypermail 2.1.8 : Fri Jun 20 2008 - 04:15:03 EEST