Hi guys,

About a month ago, RJ slapped together a "tiling" waveform renderer
that pre-renders the waveform in chunks to disk. Displaying the
waveform then becomes reading a bunch of saved images and just
blitting them to various positions. I believe the current waveform
renderer that we have in 1.7 and 1.8/trunk draws directly on the
screen, but because we're using OpenGL, it's normally very fast.

However, we've got OpenGL problems all over the place. For some
people, Mixxx's waveform views are corrupt when used with compositing
window managers and common NVIDIA and ATI videocards. For other
people, the waveform is inexplicably taxing - Their videocards report
that they have direct rendering enabled, but the waveform eats up CPU
as if that weren't the case. These problems affect at least Linux and
OS X, and I wouldn't be surprised if there were cases where Windows
users are suffering performance problems or artifacts too.

Anyways, some of the guys and I spent some time trying to find various
fixes and workarounds to our problems. I was trying to solve
corruption of the first player on Linux, which I thought had something
to do with X not letting us do real direct rendering. RJ originally
wrote his tiling renderer code to see if he could solve a performance
problem on OS X that Jus had, but it didn't seem to make a difference.
However, after about a few hours of trying random things, I decided to
try the tiling renderer with our regular QWidget-based waveform
viewer, not our OpenGL one.

The result? I have the exact same performance on my desktop Linux
machine (Core 2 Duo E8500, ATI HD4850) with OpenGL/trunk as I do
without OpenGL using the new tiling renderer. That's very good news.
(For reference, trunk with the non-GL widget has very high CPU usage,
something like > 75%, while I get about 16% with trunk and with my
patch for features_waveform.)

I think we might have an escape plan from these increasing number of
problems with OpenGL - ie. Don't use it. :)

If anyone wants to play with this and see if it has any impact on
performance, I've attached a patch that should be applied to the
features_waveform branch on Launchpad. There's still some rough edges
with the code, so please feel free to dig in and fix things that are
broken! (eg. the beat markers sliding when the pitch is changed.)

Thanks,
Albert
=== modified file 'mixxx/src/waveform/waveformrendersignaltiles.cpp'
--- mixxx/src/waveform/waveformrendersignaltiles.cpp	2010-03-11 01:05:01 +0000
+++ mixxx/src/waveform/waveformrendersignaltiles.cpp	2010-04-06 05:12:15 +0000
@@ -33,6 +33,7 @@
 
 void WaveformRenderSignalTiles::newTrack(TrackInfoObject* pTrack) {
     m_pTrack = pTrack;
+    resetTiles();
 }
 
 void WaveformRenderSignalTiles::setup(QDomNode node) {
@@ -113,6 +114,8 @@
 }
 
 void WaveformRenderSignalTiles::resetTiles() {
+    m_qTileMap.clear();
+    m_qTiles.clear();
 }
 
 void WaveformRenderSignalTiles::drawTile(Tile* tile, QVector<float>* buffer) {

=== modified file 'mixxx/src/waveformviewerfactory.cpp'
--- mixxx/src/waveformviewerfactory.cpp	2009-04-15 01:40:11 +0000
+++ mixxx/src/waveformviewerfactory.cpp	2010-04-06 04:43:35 +0000
@@ -32,6 +32,7 @@
         bVisualWaveform = false;
     }
 
+    /*
     if(bVisualWaveform) {
         
         qDebug() << "WaveformViewerFactory :: Creating new visual waveform";
@@ -64,15 +65,15 @@
                 delete visual;
             visual = NULL;
 
-            /*qDebug() << "Making a nongl viewer";
-            WWaveformViewer *nongl = new WWaveformViewer(group,pWaveformRenderer,parent);
-            m_visualViewers.append(nongl);
-            m_viewers.append(nongl);
-            ret = WAVEFORM_WIDGET;
-            *target = nongl;*/
-        }
+        } 
         
-    }
+    }*/
+    qDebug() << "Making a nongl viewer";
+    WWaveformViewer *nongl = new WWaveformViewer(group,pWaveformRenderer,parent);
+    m_visualViewers.append(nongl);
+    m_viewers.append(nongl);
+    ret = WAVEFORM_WIDGET;
+    *target = nongl;
 
     // WTF: Intentionally separate from previous block.
     if(!bVisualWaveform) {

=== modified file 'mixxx/src/widget/wwaveformviewer.cpp'
--- mixxx/src/widget/wwaveformviewer.cpp	2010-02-24 12:53:50 +0000
+++ mixxx/src/widget/wwaveformviewer.cpp	2010-04-06 04:41:24 +0000
@@ -28,7 +28,7 @@
 
     // Start a timer based on our desired FPS
     // TODO Eventually make this user-configurable.
-    int desired_fps = 1;
+    int desired_fps = 20;
     int update_interval = 1000 / desired_fps;
     m_iTimerID = startTimer(update_interval);
 

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to