[ardour-dev] Strange Issue WIth Automation in ardour-0.9_beta11

Geoffrey Wossum geoffrey at pager.net
Wed Feb 25 07:27:51 PST 2004


On Wednesday 25 February 2004 07:19 am, Paul Davis wrote:

> how many tracks are you using? a PIII-450 is not a particularly speed
> machine, and it *is* possible that automation is bogging you
> down. however, the problems you mentioned above are not related to
> automation in any direct sense.

I'm also having problems with automation.  I posted a bug about in Mantis (ID 
#277).  My problems are happening with 8 tracks on a P4 2.8 GHz machine.  My 
particular problem is recording automation, though.  Recording automation 
worked fine a while back for me, but now I'm wondering if I recorded as much 
automation as I'm recording now, as the problem only occurs after a couple of 
minutes.

I did some more investigation of the problem last night.  The CPU usage starts 
bursting up to 50% or so pretty soon after starting the automation record 
(from beginning of session, BTW).  The bursts last longer and longer, until 
at about 2 minutes the CPU is constantly being used.  The burstiness starts 
quickly, and then slowly ramps up, and it seems like it hits plateaus as it 
goes.  After a little bit of this, I stopped recording automation at this 
point, saved the session, and looked at the automation file.  There were 
around 1100 control points in the file, for both pan and gain.

So then I started rummaging around the source.  Since this was my first 
adventure looking at the ardour source code, I may be off in the weeds on 
this, apologies in advance!  I started looking in 
libs/ardour/automation_event.cc at AutomationList::add(ControlEvent *, 
iterator, bool).  In it, it appears to make a call to lower_bound() on the 
entire automation event list at line 182.  lower_bound() is implemented 
essentially as a binary search, so its efficiency is lg(n).  So this might 
explain the behavior I was seeing.  It would of hit 1024 automation points 
shortly before I stopped recording the automation, which would correspond to 
an increase in the number of steps required for lower_bound() at about the 
point my CPU finally got wholly consumed.  It would also explain the slow 
ramping and plateaus in CPU usage.  Not that you would think that little 
amount of increase in work would cause all my CPU to get consumed, nor would 
it explain the burstiness of the CPU usage.

To test my hypothesis, I then shut down ardour, and hand edited the automation 
file.  Most of the events were for setting the same value over and over 
(maybe this is a problem?).  After a little hand editing, it was now down to 
a couple of hundred control points for panning, and just 10 for gain.  
Restart ardour, move the playback head to where I left off recording the 
automation, and started recording automation.  Almost immediately my CPU 
usage spiked back up to near 100%.  Stop recording.  Save.  Look at 
automation file.  No new automation events added to file.  So maybe it had 
more to do with the absolute position I at was at in the session rather than 
the number of events.

In the end, I really didn't figure anything conclusive out, but maybe this 
will help someone else.

---
Geoffrey




More information about the Ardour-Dev mailing list