High CPU usage when using Waveform display

Bug #535594 reported by jus
46
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Medium
RJ Skerry-Ryan
1.8
Fix Released
Medium
RJ Skerry-Ryan

Bug Description

Tested on OSX 10.5 (INTEL GMA 950) C2Duo& 10.6 (Nvidia GeForce 9400M) C2Duo

Depending on what is selected in the preferences Mixxx eats significant more CPU.

Waveform display : Simple
10-12% CPU when idle.
18-20% CPU when playing 2 mp3 at standard pitch.

Waveform display : Waveform
14-16% CPU when idle.
85-90% CPU when playing the same 2 mp3 at standard pitch.

i compared the 2 Sessions with the Shark Profiler:
1st Mixxx with waveform Display playing 2 mp3
2nd Mixxx without waveform display playing the same 2 mp3.

The report shows in detail the differences between the 2 sessions.

Tags: waveform
Revision history for this message
jus (jus) wrote :
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Hey Jus,

We've had this CPU issue for a while -- some people's computers just go crazy due to the way we render our waveform. I'm working on a fix in the features_waveform branch. If you have a chance, could you give it a try? It works when the rate is normal, but if you change the rate slider it will make the waveform act funny, but you can use it to judge if the CPU usage settled down or not.

Thanks,
RJ

Changed in mixxx:
status: New → Confirmed
assignee: nobody → RJ Ryan (rryan)
milestone: none → 1.8.0
importance: Undecided → Medium
Revision history for this message
jus (jus) wrote :

No change to the better at all.

1*MacBook Pro 2,26GHZ C2D, NVIDIA GeForce 9400M , Mac OS 10.6.2
2*MacBook 1,83GHZ CD, Intel GMA 950 , Mac OS 10.5.8

CPU Usage in % ,the same 2 mp3 at standard pitch simultaneously played.

Waveform Display: Waveform / Simple

    Macbook Pro Macbook
Mixxx 1.7.1 25/34 33/45
Mixxx 1.7.2 25/100 33/46
Mixxx 1.8b1 24/90 35/48
Mixxx 1.8b2 r2363* 30/100 40/56

*self-compiled

Please also see https://bugs.launchpad.net/mixxx/+bug/503435 , maybe a dupe

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Sorry Jus, I meant the features_waveform branch, not trunk. Did you try this on that branch?

Thanks,
RJ

Revision history for this message
jus (jus) wrote :

Tested Mixxx 1.8b2 r2363 , the one with numbered waveform tiles.

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Also, jus what version of Qt are you using? I noticed a large CPU spike when the waveform is on since I upgraded to Qt 4.6 on my Linux machine. Using Qt 4.5 causes it to return to normal.

Revision history for this message
Albert Santoni (gamegod) wrote : Re: [Bug 535594] Re: High CPU usage when using Waveform display

(We already know this is related to Qt 4.6.... it's just that the
OpenGL code is so inconsistent in Qt and keeps breaking that we want
to move away from it, to the tiling non-GL renderer.)

On Fri, May 28, 2010 at 5:58 AM, Pegasus <email address hidden> wrote:
> Also, jus what version of Qt are you using? I noticed a large CPU spike
> when the waveform is on since I upgraded to Qt 4.6 on my Linux machine.
> Using Qt 4.5 causes it to return to normal.
>
> --
> High CPU usage when using Waveform display
> https://bugs.launchpad.net/bugs/535594
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
>

Revision history for this message
jus (jus) wrote :

Yes, please make it happen, the bugged waveform is a real showstopper. And toss the gradient waveform background too, eats also mucho CPU cycles (and looks like 1999 ;-).

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Not going to be fixed for 1.8.0 I don't think...

Changed in mixxx:
milestone: 1.8.0 → 1.8.1
Revision history for this message
RAFFI TEA (raffitea) wrote :

It's a pity because we face similar problems on Windows. So please compile not against Qt 4.6.3. Qt 4.5.4 works best, however, library is broken for some reasons, see https://bugs.launchpad.net/bugs/586729

Revision history for this message
RAFFI TEA (raffitea) wrote :

Ups, I mean Qt 4.5.3 works best ...

Revision history for this message
hiend (hippako) wrote :

Is it possible to port at least the waveforms to WxWidgets instead of Qt?, because is much less resource hungry. Just for comparison, in Audacity the CPU is always at 20-25% no matter how many songs I have opened.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Porting to wxWidgets is possible, though we don't want to add more dependencies. Audacity is different though -- they do not show such a close zoomed view of the waveform, rather they show the waveform all the way zoomed out. Our waveform overview widgets (the zoomed out ones) take virtually no CPU to draw.

Revision history for this message
Albert Santoni (gamegod) wrote :

Just to add to what RJ wrote, we also have plans to change the way we
render the waveform to a different approach which doesn't require
OpenGL, and aims to either speed things up or at least provide
consistent performance.

On Thu, Jul 1, 2010 at 11:29 AM, RJ Ryan <email address hidden> wrote:
> Porting to wxWidgets is possible, though we don't want to add more
> dependencies. Audacity is different though -- they do not show such a
> close zoomed view of the waveform, rather they show the waveform all the
> way zoomed out. Our waveform overview widgets (the zoomed out ones) take
> virtually no CPU to draw.
>
> --
> High CPU usage when using Waveform display
> https://bugs.launchpad.net/bugs/535594
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
>

Revision history for this message
Pako (elektrobank01) wrote :

You can actually zoom in Audacity but yes, you are right, I didn't noticed that instead of moving the waveforms in Audacity are fixed and that's quite different. Thanks!

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Ahh, didn't know that. What does the CPU usage look like when you zoom close
in on a waveform?

On Thu, Jul 1, 2010 at 2:58 PM, Pako <email address hidden> wrote:

> You can actually zoom in Audacity but yes, you are right, I didn't
> noticed that instead of moving the waveforms in Audacity are fixed and
> that's quite different. Thanks!
>
> --
> High CPU usage when using Waveform display
> https://bugs.launchpad.net/bugs/535594
> You received this bug notification because you are a bug assignee.
>

Revision history for this message
Albert Santoni (gamegod) wrote :

It's still just rendering once per zoom level, and each time you
scroll it renders a new chunk. It doesn't do smooth scrolling like
Mixxx's waveform, so it's not constantly repainting.

On Thu, Jul 1, 2010 at 12:10 PM, RJ Ryan <email address hidden> wrote:
> Ahh, didn't know that. What does the CPU usage look like when you zoom close
> in on a waveform?
>
> On Thu, Jul 1, 2010 at 2:58 PM, Pako <email address hidden> wrote:
>
>> You can actually zoom in Audacity but yes, you are right, I didn't
>> noticed that instead of moving the waveforms in Audacity are fixed and
>> that's quite different. Thanks!
>>
>> --
>> High CPU usage when using Waveform display
>> https://bugs.launchpad.net/bugs/535594
>> You received this bug notification because you are a bug assignee.
>>
>
> --
> High CPU usage when using Waveform display
> https://bugs.launchpad.net/bugs/535594
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
>

Revision history for this message
jus (jus) wrote :

Imho Qtraktor has the best scrollable/zoomable waveform display around.
Qtraktor is GPL and it even uses QT4 :-)

http://qtractor.sourceforge.net/qtractor-index.html

Revision history for this message
RAFFI TEA (raffitea) wrote :

Just a comparison on CPU usage with Traktor.

Disabling effects and key lock Traktor shows a CPU usage of less than 10% on my old system while playing two tracks at 5ms latency. This increases to ~60% if and only if Traktor analyses a song to be loaded. The waveforms are enabled.

It would be great if prospective Mixxx versions use a CPU usage of around 20%. Bear in mind that prospective features like shoutcast and MP3 recording will raise CPU usage by at least 10 to 20 points.

Revision history for this message
hiend (hippako) wrote :

I took another test with TerminatorX. In the screenshots below you can clearly see that the peaks are more emphasized, there is a big contrast between middle tones and the beats, providing a clear picture of the beat even at 85% zoom, and more importantly it uses only 12-22% of CPU with two songs activated and no OpenGL, actually I'm using nouveau driver. Screenshots attached in three phases. 85%, 90% and 100% zoomed.

Revision history for this message
Msieur Piero (pierre-blanco) wrote :

Also affected me... I have the same CPU/GPU (INTEL GMA 950) C2Duo... Strange isn't it... Not on Mac OSX but on ubuntu 10.04...
I'm gonna try to build mixxx from source with CPU optimisation, in order to see if it changes something.

Revision history for this message
Msieur Piero (pierre-blanco) wrote :

It changes nothing. Things just gets worst... Keep in touch.

Changed in mixxx:
milestone: 1.8.1 → none
Revision history for this message
djomegarush (djomegarush) wrote :

I submitted a different bug report. Might help you guys. I'm using the Beta. I noticed that when you start mixxx, and start a track, the visuals are choppy as all goat butt. I've noticed if you change the skin (without restarting mixxx), waveforms and the interface are REALLY smooth....

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

I just made some fixes in the 1.8 branch that may make some progress on this bug. I have seen a massive reduction in CPU usage while using the waveform displays. My usage went on average from 60% down to 20%. When I go with simple waveforms I see around 15% so it's a pretty significant reduction. Albert reports that the changes did not affect his computer at all, so it might have to do with graphics drivers and features they support. I suggest to everyone in this bug capable of building from the lp:mixxx/1.8 branch, try it out!

RJ

Revision history for this message
gimmeapill (gimmeapill) wrote :

RJ Ryan:
As of trunk 1.8 r2845, I saw the same kind of performance improvement you describe (huge)
Thanks for your work!

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

I wonder if this means that we are able to package with Qt 4.6 for 1.8.0 instead of going with 4.5 which was mentioned earlier in the bug. In Debian/Ubuntu, we don't have a choice -- they ship with 4.6.

Tentatively marking this fixed. Jus has mentioned that this causes an improvement for him as well. I'd be interested to see a breakdown like in the bug description to see if the GL waveforms are taking an acceptable amount of CPU compared to the Simple mode.

Changed in mixxx:
status: Confirmed → Fix Committed
Revision history for this message
jus (jus) wrote :

Tested with Mixxx 1.8.0 "(bzr r2567; built on: Sep 13 2010 ; flags: hifieq vinylcontrol midiscript optimize=2 qdebug)
on same laptop (INTEL GMA 950 OSX 10.5) like in #1 with latency 11ms

Waveform display : off
10% CPU when idle.
30% CPU when playing 2 mp3 at standard pitch.
36% CPU when playing 2 mp3 at +90% pitch.

Waveform display : on
15% CPU when idle.
41% CPU when playing the same 2 mp3 at standard pitch.
54% CPU when playing 2 mp3 at +90% pitch.

RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5359

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.