Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 1886 - Sluggish behaviour caused by the large time taken to draw the Track Control Panel
Sluggish behaviour caused by the large time taken to draw the Track Control P...
Status: RESOLVED QUICKFIXED
Product: Audacity
Classification: Unclassified
Component: User Interface
2.3.0
Per OS Windows 10
: P1 RepeatableAll
Assigned To: Default Assignee for New Bugs
: Slow
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-06-08 03:35 UTC by David Bailes
Modified: 2018-08-20 11:45 UTC (History)
6 users (show)

See Also:
Steps To Reproduce:
Create a project with about five tracks. The following are sluggish 1. drag a time selection using the mouse 2. Holding down an arrow key to move the cursor. 3. Holding down shift + arrow key to select a time range. 4. Pressing down/up arrow to move to next/previous track 5. Clicking in a track to set the cursor position and select the track. 6. Recording 7. Timer Record Progress dialogs
Release Note:
First Git SHA:
Group: ---
Workaround:
Closed: 2018-08-20 00:00:00
james.k.crook: Regression+
petersampsonaudacity: Test‑OK‑Win+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Bailes 2018-06-08 03:35:31 UTC
The sluggish behaviour make the example tasks in the steps to reproduce effectively unusable.

This behvaviour was introduced by the switch to wxWidgets 3.1.1

I've profiled the example of holding down an arrow key to move the cursor and results indicate that a very large amount of time is taken up by the wxWidgets function AlphaBlt(), in src/msw/dc.cpp. This function is called by a number of functions that draw the TCP.

I googled the issue, and came across this thread:
https://trac.wxwidgets.org/ticket/14403

Right at the end of the thread, there is the suggestion to comment out part of AlphaBlt(). I've tried that, and that seems to have solved the speed problem, although I have not thoroughly checked for any display problems that may have resulted from this.

There may well be other ways round this problem other than having to patch wxWidgets.
Comment 1 David Bailes 2018-06-08 04:24:16 UTC
Additional information.
Up until the following commit, holding down the arrow key to move the cursor didn't involve the TCP being redrawn.

Author:			Paul Licameli <paul.licameli@audacityteam.org>
Author date:	2 years ago (23/05/2016 22:56:06)
Commit date:	2 years ago (23/05/2016 23:37:42)
Commit hash:	ba883cbcf46242e9ebc6e15b38f60cc7d871947b
Children:		44650ef053 74c8dcf8d3
Parent(s):		5b05f6038d

Improve responsiveness of drag seek during click-scrub...

.. by refreshing the TrackPanel window less often.

But sorting this out would solve to sluggishness of the other example tasks in steps to reproduce.
Comment 2 David Bailes 2018-06-08 04:26:26 UTC
Peter, why did you change "track control panel" to "track panel" in the title? The problem is specifically the time take to draw the track control panel.
Comment 3 Peter Sampson 2018-06-08 04:34:09 UTC
Because the Track Control Panel is specifically the block to the left of the waveform (i,e, the panel that contains the track name, the pan&gain sliders and the mute&solo buttons) - that does not get re-drawn when you make the drags and selections in the waveform

The panel that contains the waveforms/selections (that gets re-drwan by the Steps) is called the "Track Panel" AFAIK
Comment 4 David Bailes 2018-06-08 04:40:22 UTC
(In reply to Peter Sampson from comment #3)
> Because the Track Control Panel is specifically the block to the left of the
> waveform (i,e, the panel that contains the track name, the pan&gain sliders
> and the mute&solo buttons) - that does not get re-drawn when you make the
> drags and selections in the waveform

It gets redrawn. If it didn't get redrawn, there would not be a problem.

> 
> The panel that contains the waveforms/selections (that gets re-drwan by the
> Steps) is called the "Track Panel" AFAIK
Comment 5 David Bailes 2018-06-08 05:24:55 UTC
(In reply to David Bailes from comment #4)
> (In reply to Peter Sampson from comment #3)
> > Because the Track Control Panel is specifically the block to the left of the
> > waveform (i,e, the panel that contains the track name, the pan&gain sliders
> > and the mute&solo buttons) - that does not get re-drawn when you make the
> > drags and selections in the waveform
> 
> It gets redrawn. If it didn't get redrawn, there would not be a problem.

I've therefore reverted your change

> 
> > 
> > The panel that contains the waveforms/selections (that gets re-drwan by the
> > Steps) is called the "Track Panel" AFAIK
Comment 6 David Bailes 2018-06-12 09:31:21 UTC
(In reply to David Bailes from comment #1)
> Additional information.
> Up until the following commit, holding down the arrow key to move the cursor
> didn't involve the TCP being redrawn.
> 
> Author:			Paul Licameli <paul.licameli@audacityteam.org>
> Author date:	2 years ago (23/05/2016 22:56:06)
> Commit date:	2 years ago (23/05/2016 23:37:42)
> Commit hash:	ba883cbcf46242e9ebc6e15b38f60cc7d871947b
> Children:		44650ef053 74c8dcf8d3
> Parent(s):		5b05f6038d
> 
> Improve responsiveness of drag seek during click-scrub...
> 
> .. by refreshing the TrackPanel window less often.
> 
> But sorting this out would solve to sluggishness of the other example tasks
> in steps to reproduce.

The last sentence is wrong. I meant to type:
But sorting this out would not solve the sluggishness of the other example tasks
in steps to reproduce.

Though this commit does mean that unnecessary drawing is done when holding down shift + left/right arrow, as the associated command already calls refresh.
Comment 7 David Bailes 2018-06-13 11:15:34 UTC
Added another two examples in the steps to reproduce.
Comment 8 James Crook 2018-06-14 10:27:41 UTC
Marked as regression and raised to P1.
Comment 9 Peter Sampson 2018-08-03 04:37:57 UTC
Following on from a comment to me from James fron TR testing - I tested Recording and playback in this use case with 5 pre-existing tracks - testing on my powerful high-spec SSD laptop

1) The visuals for recording (cursor/waveform) are noticeably more jerky than fresh recording of a single track - but the recording is made intact without apparent dropouts.

2) Playback appears unaffected: normal Play, Scrubbing and TQP all OK
Comment 10 Peter Sampson 2018-08-03 05:33:28 UTC
(In reply to Peter Sampson from comment #9)
Also with Timer Record on my high-spec laptop with 5 pre-existing tracks teh progress counters are a little erratic missing seconds occasionally - always smooth every second with TR with no pre-existing tracks,

The Waiting to start countdown timer is not so affected.
Comment 11 James Crook 2018-08-03 13:39:25 UTC
DEVEL - FIX MADE
https://github.com/audacity/audacity/commit/4318cb67808461acccd01b6956c57eff08506da7

I confirm the problem in AlphaBlt, and found a fix of setting 24 bit bitmaps, where previously we just used defaults (32 bit).  This means we do not need to hack away at wxWidgets to 'fix' the issue.  Confirmed that 1-7 are now back to the speed I would expect.

I also noticed that start up is snappier.
Comment 12 Peter Sampson 2018-08-04 10:46:29 UTC
(In reply to James Crook from comment #11)
Testing on W10 with audacity-2.3.0-alpha-64-dcd9368af0a20a500cd338917a2a1e32aedecc8e

All 7 Steps to reproduce now work fine for more with smooth slick updates to the visuals.

I would prefer David (as the OP) to also test and comment before closing off this bug.
Comment 13 David Bailes 2018-08-06 05:49:48 UTC
(In reply to Peter Sampson from comment #12)
> (In reply to James Crook from comment #11)
> Testing on W10 with
> audacity-2.3.0-alpha-64-dcd9368af0a20a500cd338917a2a1e32aedecc8e
> 
> All 7 Steps to reproduce now work fine for more with smooth slick updates to
> the visuals.
> 
> I would prefer David (as the OP) to also test and comment before closing off
> this bug.

It looks fine,
thanks,
David.