Re: [ecasound] ecasound and lua?

From: Philipp Überbacher <hollunder@email-addr-hidden>
Date: Mon Jul 26 2010 - 17:47:17 EEST

Excerpts from Joel Roth's message of 2010-07-26 10:43:34 +0200:
> On Mon, Jul 26, 2010 at 12:59:21AM +0200, Philipp ??berbacher wrote:
> > The features I have planned at this time are:
> > 1) A fast 'takes' system
> > 2) simple recording
> > 3) simple playback
> >
> > 1) No major problems here, it should be a matter of a couple of string
> > operations. One thing I have yet to figure out is how to specify the
> > location of the file it records, it seems the home directory is the
> > default.
> If you specify "-o:foo.wav", I believe Ecasound will record
> foo.wav to whatever is the current directory in the shell
> where the Ecasound process is started up.
> If you specify "-o:/some/path/foo.wav", Ecasound will
> record exactly there.
> (As Ecasound IAM, probably "ao-add /some/path/foo.wav".)

Thanks, this seems to work fine, as long as the path already exists :)

> The Examples and User Manual docs are your best
> reference for common tasks. :-)

One thing I couldn't find: How do I quit ecasound via net-eci?
'quit' quits only the connection, that much it did tell me :)

> > 2) I have a hard time figuring out what's needed to prepare a chain
> > setup for recording.
> >
> > - a chain setup, selected
> > - a chain, selected
> > - input and output for the chain
> > - engine-launch
> > - start
> A chain needs to be selected only for adding/removing chain
> operators, adjusting chain operator parameters, etc.
> A newly created or loaded chain setup is automatically
> selected.
> Starting the engine automatically launches the engine
> if necessary.

I think I'll try to be verbose for now. At some point it may give more
control over what happens.

> > And for shutdown?
> > - stop
> > - and then? It seems my file wasn't properly closed.
> I believe stop should be enough for Ecasound to close
> the file.

A subsequent start seems to be able to continue with the same file

> > I do record from jack, but the bitdepth was set to 16bit. I couldn't
> > figure out how to change that.
> >
> >From the command line (or in a chain setup file):
> -i:jack,system -f:f32_le,1,44100 -o:foo.wav
> This records in 32-bit floating point format (same as JACK input)
> As an Ecasound IAM command, I believe the equivalent is:
> cs-set-audio-format f32_le,1,44100

Ah, yes, that works too :)
I most likely missed the _le part
I would have expected it to default to the input format, and I think I
read some piece of documentation somewhere that says it does.

> > There's also this line, from aio-status, which doesn't tell me a lot:
> > -> closed, audio format not available until object is opened.

This is still a bit confusing for me, no idea what it tries to tell me.

> > I don't have it in git or anything yet, that may happen after the
> > current deadline is reached. I attach the current version of the code
> > though, in case someone is interested.
> I am, lua (with your commenting :) is quite easy to read.

Criticism is very welcome. Questions as well. The code changes quickly
though, so a snippet might be necessary for me to be able to answer

I spent most of today to hunt and squash a single bug. Almost
frustrating :/
I did find the problem and a rather ugly solution that I don't fully
The issue I have is ecasounds response when I send it a String
containing nothing but "\r\n".
It seems to send two responses, first:
256 0 -

And then an empty string as a separate response. It may just be an
additional <crlf><crlf>. Anyway, the response is different from others.
My program assumes a single response in order to correlate the sent
message with the response, so this additional response confused it.
Well, did you experience something similar? Other responses work fine.

I guess those are the fine subtleties that make programming fun :)


"Wir stehen selbst enttäuscht und sehn betroffen / Den Vorhang zu
und alle Fragen offen." Bertolt Brecht, Der gute Mensch von Sezuan
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:;226879339;13503038;l?
Ecasound-list mailing list
Received on Mon Jul 26 20:15:02 2010

This archive was generated by hypermail 2.1.8 : Mon Jul 26 2010 - 20:15:02 EEST