Re: [ecasound] One chain, multiple "run" calls = bad output length

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

Subject: Re: [ecasound] One chain, multiple "run" calls = bad output length
From: Kai Vehmanen (kai.vehmanen_AT_wakkanet.fi)
Date: Tue Aug 24 2004 - 01:51:54 EEST


On Mon, 23 Aug 2004, Paul Winkler wrote:

>> Now if you issue 'cs-get-position' before the second run, you'll note that
>> the position is already 12345, and thus the second run stops immediately
>> Fortunately the fix is easy, just issue 'cs-set-position-samples 0' after
>> 'ao-add bar-out.wav', and ta-daa, it works as it should. :)
> Great... except it doesn't.
> I think if you think about which commands require the chainsetup
> to be connected and which require it to be disconnected, you will
> see why.

I just tested the following sequence and it provides 56k files foo-out.wav
and bar-out.wav:

sh> ecasound -c
cs-add main_chainsetup
c-add main_chain
ai-add foo.wav
ao-add foo-out.wav
cs-set-length-samples 12345
ai-select foo.wav
ai-set-position-samples 6789
cs-connect
run
cs-disconnect
ai-select foo.wav
ai-remove
ao-select foo-out.wav
ao-remove
ai-add foo.wav
ao-add bar-out.wav
cs-set-position-samples 0
cs-set-length-samples 12345
ai-select foo.wav
ai-set-position-samples 6789
cs-connect
run
cs-disconnect
ai-select foo.wav
ai-remove
ao-select foo-out.wav
ao-remove
c-select main_chain
c-remove

> command chainsetup connected?
> --------------------------------------------------------
> cs-set-position-samples Yes
[...]
> Which means, in order to extract sections of audio like I want,
> I can't follow your suggestion of putting cs-set-position-samples
> after ao-add bar-out.wav. That gives an error.

True, but it should still work (even if it gives the warning).
To avoid the error message, cs-connect after ao-add.

> ecasound ('h' for help)> cs-get-position-samples
> 7333888
> ecasound ('h' for help)> cs-set-position-samples 0
> ecasound ('h' for help)> cs-get-position-samples
> 7333888

Oops, now that's a bug. It turned out that even though engine is properly
exited after 'run' completes, not all state information is updated. The
iactive-mode side (incorrectly) notes that the real-time engine is still
active (=able to receive commands), and thus it sends the setpos, etc
command via the rt-route. But as there is nobody receiving the commands,
they are lost with no change to chainsetup status.

You can avoid this by doing a 'engine-halt' before issuing
'cs-set-position-samples'. Anyways, a proper fix is already committed to
CVS, so you can use that also. Thanks for bughunting help! :)

-- 
 http://www.eca.cx
 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 : Tue Aug 24 2004 - 01:53:42 EEST