ecasound channel time allignment off by buffer time

I'm using ecasound for active 3-way filters based on Richard Taylor's work.

Using the command below the mid and tweeter are delayed from the woofer by the length of the ecasound buffer. It sounds really weird with buffers approaching 200ms.

Code:
ecasound -z:mixmode,sum -x -z:nodb -b:ecasound_buffer_size 
-a:pre1 -f:16,2,44100 -i stdin -pf:pre1-3way.ecp -o:loop,1 
-a:pre2,woofer -i:loop,1 
-a:pre2 -pf:pre2-3way.ecp -o loop,2 
-a:mid,tweeter -i:loop,2 
-a:woofer -pf:woofer.ecp -chorder:1,2,0,0,0,0,0,0 
-a:mid -pf:mid.ecp -chorder:0,0,1,2,0,0,0,0 
-a:tweeter -pf:tweeter.ecp -chorder:0,0,0,0,0,0,1,2 
-a:woofer,mid,tweeter -f:s16,8,44100 -o:stdout

Removing use of loops following Charley Laub's example makes the problem go away.

Code:
ecasound -B:rt -z:mixmode,sum -z:nodb -b:ecasound_buffer_size  
-a:woofer,mid,tweeter -f:16,2,44100 -i stdin 
-a:woofer -pf:woofer.ecp -chorder:1,2,0,0,0,0,0,0 
-a:mid -pf:mid.ecp -chorder:0,0,1,2,0,0,0,0 
-a:tweeter -pf:tweeter.ecp -chorder:0,0,0,0,0,0,1,2 
-a:woofer,mid,tweeter -f:s16,8,44100 -o:stdout

So for now I'm happy. I'm just curious what I'm doing wrong with the loops in case I need them in the future.

Some application specific stuff:
I'm using stdin and stdout to get data in and out because my multiroom implementation requires direct control of the soundcard to extract the needed timestamp information. This ultimately goes to a 7.1 receiver over HDMI which is why there are 8 channels. Center and Sub are the two unused channels. Using small buffers makes the problem less perceptible, but doesn't fix the problem. It also seems to extend processing time which causes other issues for me. I haven't even begun to actually measure the drivers yet, that's next.

Thanks,
Mike
 
Last edited:
Just recalling off of the top of my head, but somewhere in the ecasound man pages it mentions that each loop is executed in a processing cycle (I forget the exact words). If you look at how you are using the loops, the woofer runs thru loop 1 but the mid and tweeter run through loop 1 AND loop 2. This means that the woofer will emerge 1 processing cycle before the mid and tweeter, just as you have observed.

I can try to pin down where this is mentioned in the manpages if you can't find a mention of it.