[Ardour-Dev] Rewaveview branch

Tim Mayberry mojofunk at gmail.com
Sun Apr 2 21:43:52 PDT 2017

I have pushed a branch called rewaveview to origin(official ardour
that started out initially as an effort to address the long standing bug

In trying to understand the issue/s there were a number of things I thought
could be improved so I ended up rewriting/redesigning some of the aspects of
rendering the canvas and waveforms.

I have not been able to reproduce the crashing issue in the rewaveview
as I can(eventually) in master, but as it is fairly hard to reproduce I
like some further testing and feedback on the branch before hopefully
proceeding to merge/commit to the master branch after working through any
(hopefully minor) issues. As although I've done many hours of testing it is
fair bit of new code so there is the potential for a different set of issues
and or simple typos/oversights etc.

The first main change is to coalesce changes to the canvas. Mouse and Key
driven events have a higher priority than rendering the canvas so if there
is a
consecutive sequence of events that result in a change in state of the
then rendering the result of those changes is often blocked until a pause in
the event stream and sometimes in the case of a series of mouse driven
until after the last event, even though the last state is the only state
gets rendered.

This results in a lot of superfluous processing taking place in
Editor::visual_changer and it is noticable in the jumps for instance when
holding down the -/+ keys to zoom, zooming with the mouse wheel or using
drag zoom. Coalescing further canvas changes after the first is rendered and
then processing those changes once(and re-rendering) results in a much
and predictable canvas zooming/scrolling experience and a noticably higher
frame rate when performing those operations.

The other main change is to introduce an interface that canvas items can
implement so they will be notified when a change to the canvas or items
and they are determined to be located in the visible canvas area. This is
implemented for WaveView at the moment and it allows the waveform to be
in another thread/s much earlier than previously, so that by the time the
canvas renders for display the image is usually finished and you don't get
much flickering of the audio regions.

The design and implementation of the WaveView class has changed a fair
The waveform drawing itself should be unchanged but the handling of threaded
drawing and the supporting classes are different.

The caching of images in WaveView was improved so that all caching
are in constant time. I thought this was necessary as in the master branch
the cache is full(which it becomes quite quickly) as it can slow rendering
enough that it was worth fixing.

Another change I made to the caching of images is being able to add them to
cache as soon as the request is made and they are unfinished, as it means
usually only one image is drawn for WaveViews with similar properties and
it reduces the amount of drawing for loop/clip based compositions for

There are a few more optimizations/tricks included in the changes and when
threaded rendering is enabled it will use cpus/cores - 1 threads for
drawing which is useful in some circumstances to reduce draw time and

I'm going to be travelling for the next 10 days, so I may not have much
opportunity to respond to feedback/issues until after I get back but I have
created a report in the bug tracker to track any issues:


I attached to the report some logging/trace output of various of my testing
scenarios for master and rewaveview that can be analyzed with
chrome/ium://tracing if anyone is interested in those.

There are a few further changes that will help to improve canvas performance
that I know of, but this is a very good start I think.

Depending on how testing of the branch goes, we can discuss when/if it can
merged into master after I get back, I just didn't want to sit on this code
there is a possibility of fixing #6478 before the next release.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ardour.org/pipermail/ardour-dev-ardour.org/attachments/20170403/2e2085e2/attachment.html>

More information about the Ardour-Dev mailing list