Re: [LAU] ecasound/jack records empty files

From: Joel Roth <joelz@email-addr-hidden>
Date: Tue May 17 2011 - 07:39:28 EEST

On Mon, May 16, 2011 at 11:41:53AM -0700, Eric Steinberg wrote:
> Hi all,
>
> I'm trying to build a recorder that makes a 24 hour long audio recording,
> with multiple channels. So far, I can start jackd:
>
> $sudo jackd -d firewire
>
> and start ecasound:
>
> $sudo ecasound -a:1,2,3,4,5,6,7,8 -f:s16_le,8,44100 -i jack,system -a:1 -o
> channelone.mp3 -a:2 -o channeltwo.mp3 -a:3 -o channelthree.mp3 -a:4 -o
> channelfour.mp3 -a:5 -o channelfive.mp3 -a:6 -o channelsix.mp3 -a:7 -o
> channelseven.mp3 -a:8 -o channeleight.mp3

> ...this starts recording without problems. However, when I stop recording
> by issuing ctrl-c to ecasound and then start recording again, the files
> created now have zero bytes. If I stop and restart the jack server, then
> recording works normally. I would expect ecasound to overwrite the files
> and record new files; why must I restart jackd for audio to be recorded?
> Thanks for any info.
> -Steiny

Hi Eric,

Julien mentioned the issue of the selection and channel count of the
output channels.

Here are two (untested) ways to deal with it.

First of all, with -f:s16_le,8,44100, it looks like
you are declaring the input signal to be 16-bit.

In fact, JACK's internal format is floating 32-bit, so you
probably want -f:f32_le,8,44100.

Also -f specifies the format for *all subsequent input and
output signals*, so you'll need a -f:s16_le,1,44100 before the
outputs.

Since each chain gets a copy of the 8-channel signal, you'll
have to move the channel you want to channel 1 using
the -chmove operator.

ecasound -f:f32_le,8,44100 \
-a:1,2,3,4,5,6,7,8 -i jack,system \
-f:s16_le,1,44100 \
-a:1 -o channelone.mp3 \
-a:2 -chmove:2,1 -o channeltwo.mp3 \
-a:3 -chmove:3,1 -o channelthree.mp3 \
-a:4 -chmove:4,1 -o channelfour.mp3 \
-a:5 -chmove:5,1 -o channelfive.mp3 \
-a:6 -chmove:6,1 -o channelsix.mp3 \
-a:7 -chmove:7,1 -o channelseven.mp3 \
-a:8 -chmove:8,1 -o channeleight.mp3

Just for interest. Here is another way to do it:

ecasound \
-a:1 -f:f32_le,1,44100 -i jack_multi,system:capture_1 \
     -f:s16_le,1,44100 -o channelone.mp3 \
-a:2 -f:f32_le,1,44100 -i jack_multi,system:capture_2 \
     -f:s16_le,1,44100 -o channeltwo.mp3 \
....

However, there appears to be another wrinkle. According
to 'man ecasoundrc', ecasound will output a *stereo*
signal to lame:

    ext-cmd-mp3-output
        Command for starting mp3 output. Ecasound will write
    stereo, signed, 16bit, little-endian samples to standard
    output. Sample rate is configurable. Before execution, %f is
    replaced with path to the output mp3, %S with sample rate in
    kHz, and %B with encoding bitrate in kbps. Double-quotes and
    backslash-espacing can be used to include white-space to
    individual parameters. By default Ecasound will try to
    launch lame. As a special exception (added to Ecasound
    2.7.0), if the output program is "lame" and options include
    "--big-endian", Ecasound will detect this and output
    big-endian samples

So you may want to tell LAME to record in mono:

.ecasoundrc:

ext-cmd-mp3-output=lame -m m - %f

Regarding zero-length file, I will defer to the other
experts about which of Ecasound's JACK transport modes
you will want to use. There aren't that many, so you
could try them all, using the -G option, i.e.

ecasound -G:jack,system,notransport # ignore transport seek

I also wonder if you might get better behavior by
terminating Ecasound differently, for example with
a TERM signal, or via Ecasound-interactive mode
commands.

Regards,

Joel

-- 
Joel Roth
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Tue May 17 08:15:01 2011

This archive was generated by hypermail 2.1.8 : Tue May 17 2011 - 08:15:01 EEST