Re: [ecasound] flac support problems -- ecasound-2.3.4-pre20040819

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [ecasound] flac support problems -- ecasound-2.3.4-pre20040819
From: Kai Vehmanen (
Date: Mon Sep 06 2004 - 02:28:22 EEST

On Sun, 5 Sep 2004, Eric Dantan Rzewnicki wrote:

> Thanks Kai. This new pre-release works fine for that. One little bit of
> weirdness on playback, though. alsa output doesn't seem to want to be
> told the format. The following commandline gives an error:

This snapshot release also contained a minor bugfix to ALSA support
which could cause changes in behaviour (from NEWS):

        - fixed: ecasound sample formats s24_le/_be were mapped
                 to 4-byte ALSA formats S24_LE/_BE; now mapped
                 to the correct 3-byte S24_3LE/_3BE formats

> ecasound -f:24,1,48000 -i:2004-0905-house.flac \
> -f:32,1,48000 -o:alsahw,0,0
> (eca-control) ERROR: Connecting chainsetup failed: "Enabling
> chainsetup: AUDIOIO-ALSA: Channel count 1 is out of range!"

When you use 'alsahw', ecasound talks directly to the ALSA hw-pcm
interface. This means that the automatic format conversions offered by
alsa-lib are not used. Instead, the audio format given with ecasound's -f
option must be supported natively by the soundcard. Some cards support
only a very limited set of parameters.

So in this case, 32bit-1ch-48khz is not supported by your soundcard. If
you replace 'alsahw,0,0' with 'alsa', the above command probably works.
Unless you've modified your ~/.asoundrc, '-o:alsa' accesses the soundcard
via the plugin layer (alsa-lib makes the necessary conversions if needed).

Other option is to modify the -f option until you find a combination that
is natively supported by your hardware. In theory there is a small
performance hit in utilizing the alsa-lib layer, but in many cases the
difference is barely noticable.

> similar error occurs with -f:32,2,48000 for the output. i.e. "Channel
> count 2 ... !"

The same reasons apply.

> If I specify 24 bits with -f:24,1,48000 I get this error:
> (eca-control) ERROR: Connecting chainsetup failed: "Enabling
> chainsetup: AUDIOIO-ALSA: Audio format not supported."

This is expected. Ecasound's -f:24,... refers to the 24bit-in-3bytes
sample format while most soundcards only understand 24bit-in-4bytes
variant (closest matching ecasound option is -f:32). The abovementioned
bugfix makes sure ecasound and alsa-lib speak the same "language" in all

> However, if I just leave the output format unspecified playback works
> fine like this:
> ecasound -f:24,1,48000 -i:2004-0905-house.flac -o:alsahw,0,0

Now this doesn't make sense. The above is equal to:

ecasound -f:24,1,48000 -i:2004-0905-house.flac -f:24,1,48000 -o:alsahw,0,0

... which -- based on earlier examples -- should not work. Anyway, I
recommend using the alsa-lib plugin layer. I.e. the following should
work with all soundscards:

ecasound -f:24,1,48000 -i:2004-0905-house.flac -o:alsa

> In general I've been having trouble figuring out when I need to specify
> the output format and when I don't. Sometimes it seems to be required

Basicly -f is a sticky option -- it applies to all inputs and outputs on
the command-line, until a new -f is given. Ecasound parses the
command-line options left-to-right, so order definitely counts. If no -f
is given on the command-line, ecasound uses the default audio format
(specified in ~/ecasound/ecasoundrc, defaults to -f:s16_le,2,44100).

You'll need to specify -f if...

a) you have specified the format for the input (or some earlier) object,
   but you want to use different format for the output object

b) you do not want to use the default audio-format (see above)

Additionally, ecasound contains header parsing code for some audio file
formats (wav, most formats supported by libsndfile and libaudiofile, mp3,
...). With these formats, ecasound will parse the audio format parameters
from the file header, and -f option is not needed. But ecasound does not
have header parsers for example for flac, ogg and m4a files, so -f must be
specified. And of course, when creating new files, header parsing won't
help -- the user has to specify in which format the file should be
created. :)

 Audio software for Linux!

New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon Sep 06 2004 - 02:30:09 EEST