adafruit / Adalight

http://ladyada.net/make/adalight/
GNU General Public License v3.0
212 stars 131 forks source link

Extremely slow framerate on Linux #2

Closed shanet closed 12 years ago

shanet commented 12 years ago

When running the Adalight sketch on Linux (Kubuntu 11.10 and Linux Mint 12) framerates average around 3-4 FPS while the C Colorswirl framerate averages 140 FPS and the Java Colorswirl framerate averages 40 FPS.

If someone knows of a way to make this run better on Linux, but doesn't have the time to work on it, let me know and I'd be happy to try to implement it. Would it be possible/feasible to re-write the Adalight sketch in C?

PaintYourDragon commented 12 years ago

The performance (or sometimes lack of) Adalight is predominantly a function of the video hardware and drivers. Unfortunately, Linux drivers often lag behind the Windows equivalents because they're designed without access to privileged information. But sometimes even with the best drivers it's just slow...Atom processors and Intel GMA graphics come to mind...so I can't guarantee that the investment in C development will pay off. It may just be a bottleneck of the way Adalight operates, doing continual full-screen captures. A couple things worth trying: change 'useFullScreenCaps' to 'false,' or second, rather than having Adalight repeatedly capture the screen to access another program's output...instead, eliminate a step and alter the other program to incorporate the Adalight downsampling and serial output directly (as I believe the 'Boblight' plug in for XBMC does). This avoids the slow round trip to and from the frame buffer.

shanet commented 12 years ago

I see. I tried changing "useFullScreenCaps" to no avail. It's frustrating because I'm running the proprietary ATI driver on a pretty high end GPU from just a few months ago. I start out at ~10 FPS and then continually decrease until the framerate stabilizes at around 1.5 FPS all while Java uses up 20% CPU. I briefly looked into what it would take to use the Xlib library to grab screen captures directly from X, but that's all over my head for the time being. I'm probably just going to fork and play with the Colorswirl demo.