Inaccurate reporting of length

View: New views
3 Messages — Rating Filter:   Alert me  

Inaccurate reporting of length

by linux media 4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I see you may be ready for another release soon. I was hoping to have
this squeezed in.

This may not seem important, but it is if you're building a Front End.

If you run...
ecasound -c -f:16,1,44100 -i:jack,system -f:16,1,44100 -o:test.wav

Then do...
ecasound ('h' for help)> t
ecasound ('h' for help)> s

Then do...
ecalength test.wav
It shows an inaccurate length

But when you either quit ecasound or do Chainsetup/remove/add/connect,
ecalength shows the accurate length.

I've been working with this for a while and I'm certain that the length
that 'ecalength' shows once the chainsetup is removed is correct. And
the difference can be large.

Again... this can be troublesome if you are writing a Front End and need
an updated length without interrupting the chainsetup.

Thanks,
Rocco

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Ecasound-list mailing list
Ecasound-list@...
https://lists.sourceforge.net/lists/listinfo/ecasound-list

Re: Inaccurate reporting of length

by Kai Vehmanen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On Fri, 2 Oct 2009, linux media 4 wrote:

> I see you may be ready for another release soon. I was hoping to have
> this squeezed in.

well, at least hoping to get one out. :)

> If you run...
> ecasound -c -f:16,1,44100 -i:jack,system -f:16,1,44100 -o:test.wav
>
> Then do...
> ecasound ('h' for help)> t
> ecasound ('h' for help)> s
>
> Then do...
> ecalength test.wav
> It shows an inaccurate length

Hmm, this is actually a feature. Duration of RIFF WAVE files is stored in
the file header. Ecasound updates this header only when the file is closed
(e.g. 'cs-disconnect' or when terminating ecasound).

So if you use an external program (e.g. ecalength) to check the file
length, the result will be incorrect until ecasound updates the header
(e.g. 'cs-disconnect').

> Again... this can be troublesome if you are writing a Front End and need
> an updated length without interrupting the chainsetup.

Couldn't you use ai-get-length/ao-get-length commands to get the file
length (these don't depend on updating the RIFF header)?

Alternatively ecasound could update all file headers anytime transport is
stopped, but this is not entirely trivial to implement (e.g. in case
ecasound is trying to chase the JACK transport position, this could result
in quite frequent header updates -- I'm sure there are other similar
cornercases that need to be considered).

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Ecasound-list mailing list
Ecasound-list@...
https://lists.sourceforge.net/lists/listinfo/ecasound-list

Re: Inaccurate reporting of length

by linux media 4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>> If you run...
>> ecasound -c -f:16,1,44100 -i:jack,system -f:16,1,44100 -o:test.wav
>>
>> Then do...
>> ecasound ('h' for help)> t
>> ecasound ('h' for help)> s
>>
>> Then do...
>> ecalength test.wav
>> It shows an inaccurate length

> Hmm, this is actually a feature. Duration of RIFF WAVE files is stored
> in the file header. Ecasound updates this header only when the file is
> closed (e.g. 'cs-disconnect' or when terminating ecasound).
>
> So if you use an external program (e.g. ecalength) to check the file
> length, the result will be incorrect until ecasound updates the header
> (e.g. 'cs-disconnect').

>> Again... this can be troublesome if you are writing a Front End and need
>> an updated length without interrupting the chainsetup.

> Couldn't you use ai-get-length/ao-get-length commands to get the file
> length (these don't depend on updating the RIFF header)?
>
> Alternatively ecasound could update all file headers anytime transport
> is stopped, but this is not entirely trivial to implement (e.g. in case
> ecasound is trying to chase the JACK transport position, this could
> result in quite frequent header updates -- I'm sure there are other
> similar cornercases that need to be considered).

Yeah, that would be making things work harder than they need to. I had
already worked a solution. I just thought that a bug crept up related to
the workaround, but I think I fixed it. I don't think it was related to
the workaround.

Anyways, things work fine now.

Thanks,
Rocco

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Ecasound-list mailing list
Ecasound-list@...
https://lists.sourceforge.net/lists/listinfo/ecasound-list