60 fps and then some
Phew, what a ride the last 5 days have been! While working on the cairo-dock code some more, I got an eMail from Karl Lattimer asking if he can take over my code, once I’ve done my experimenting, to make a full dock-like application out of it. I surely welcome this! Furthermore he suggested to get in touch with Alex Graveley (main developer behind gimmie), beause the project wants/needs some cairo-love. Oh and Karl already registered and setup a site for his planned effort. See…
I then did get in contact with Alex pointing him to the cairo-dock experiment, which happended with some funky timing, as Alex was about to email me about it *g* Then I got a first tweaked version from Behdad Esfahbod tuneing icon-placement, event-throttleing and font-rendering. I merged that with my stuff. In the mean time David Turner, who just recently wrote some great patches for cairo, xft and freetype beautifying subpixel font-rendering, writes on on the cairo mailing-list about some profiling he did with the cairo-dock code resulting some some optimizing patches for cairo. Those patches were happily accepted by Carl Worth, main master behind cairo itself. And if this wasn’t enough David Reveman, whom everybody should know by now from glitz/Xgl/compiz, sent me a patched version of cairo-dock adding glitz- and benchmarking support. Merged that too. Somewhere in between Jono Bacon does some pimping for me and - like Alex - wonders why I don’t show up at Guadec. Well, the main reason is the lack of cash. I’ll already burn everything in spare for going to LUGradio Live. I didn’t ever consider going to Guadec because it is too big/serious/over-my-head. Or put in another way… LUGRadio seems less intimidating to me. So the two poke me to at least try to ask Qium Gil if I can get in somehow. It turns out Qium also would like to see me hit Guadec. Sadly he has to turn my request for sponsorship down. Which I can surely understand. But I got flights covered via other means now and only need some place to sleep. Anybody got some square-feet free in their bungalows for a sleeping-sofa?
Guess what, I’m not done yet. Kristian “krh” Hoegsberg, chief of the wobbly windows among other things, pointed me towards some cairo-dock derived experiments he did with his new akamaru-engine. Check out the resulting dock binary after you compiled the stuff, which can be obtained there (Kristian just told me, that this tarball gets automatically regenerated as soon as he pushes changes to his repository):
people.freedesktop.org/~krh/akamaru.tar.gz
And just a couple of minutes ago Behdad told me on IRC, that he also did the same thing, merging code-stuff with David Reveman’s bits and pieces and asked for my latest version *sigh* I deeply regret to still not have setup my own public (git-) repository at people.freedesktop.org/~macslow. This would have made all this much easier.
Hot damn… what a ride sofar! OpenSource rocks plain hard!!! If you ever need a vivid and current example at OpenSource-magic at work. This is it *g*
Oh, I bet you want to see a current screencast and some code. No problem…

crisp and fast (click to play back, ogg/theora, ~2.5 MBytes)
BTW, that’s the first screencast, where I tried to record 20 fps with gvidcap and it did not crash on me *Strike*!
Some current code. You’ll need glitz-enabled cairo 1.1.6 for this. Also running under a composited environment (Xgl/compiz, xcompmgr, AIGLX etc.) would be nice. I’ve only tested this with plain Xorg/xcompmgr and Xgl/compiz under Gnome 2.14.1. Your mileage may vary, if you are running KDE, XFCE or else. The fastest and best looking way to start cairo-dock is to use this command:
./cairo-dock —glitz —surface-buffering
A word of caution though. I see rendering-artefacts when using —glitz in combination with —surface-buffering. I should try this with glitz from CVS-head maybe. Also be sure to checkout the —benchmark option, to see how fast cairo-dock can go without any throttleing (this will hammer your CPU of course). I get about 400-500 fps that way. If I disable the rendering of the text-labels, which are not surface-buffered, I get something around 1700 fps. Also check the cairo-mailinglist for some benchmarks David Reveman did, using a more current and tuned version of Xgl (improved server-side gradients and software-scaleing).
I hope this will start to make an end to complains about cairo and related libraries to be slow. They way it presents itself now is cool already. Just some code-example used to learn and better understand cairo/glitz/librsvg was enough to bring performance-tuneing and profiling to the surface (more public awareness) again. The main developers behind those mentioned libraries (btw, Dominic Lachowicz also did his part on working out some tuneing inside librsvg in those magical 5 days) know for sure what they are doing and have the right ideas what to optimize and how. But they need help and feedback… and no trolling. For example I picked up some discussion from Carl Worth and David Turner sparked by my questions on the mailing-list. They identified some “low hanging fruit”-optimizations. Carl will also do some major work on the cairo-core for tuneing the tesselator over the summer. David Turner will look into this too, if I recall correctly. I never want to hear that “it’s too slow”-crap again. Those “moaners” should better stand up and get their hands dirty, write some code, try out stuff, ask questions, look for help etc. Just don’t be lazy and help to make that difference now!
To Karl Lattimer: While I still have to setup (learn) git at people.freedesktop.org/~macslow (I’ll also finally put the official cairo-clock repository there) Behdad is about to put the most recent code for cairo-dock in his git-tree (that’s at people.freedesktop.org/~behdad/cairo-dock.git I believe). So Karl, I’d suggest you’ll grab stuff from there, and inject it in the svn-repo at www.gnome-dock.org to jumpstart the beginnings of gnome-dock.
June 13th, 2006 at 3:42 am
fwiw, under AIGLX I had to remove the –glitz option (else it’s just a big solid rectangle).
./cairo-dock –surface-buffering
Maxes out at 62fps.
Very exciting work.
June 13th, 2006 at 4:47 am
I’ll mention it here too in addition to IRC. For some reason I’m getting a BadLength X error on the glitz_surface_create call. I checked the width & height its asking for (1600×150), which sounds right, so I’m not sure what the problem is. Any ideas?
June 13th, 2006 at 6:26 am
I just tried this out on Xgl/Compiz. I had to remove –glitz or else I get between 1-2 fps. But withou I’m around 25-32. Very smooth here with my 192 megs of ram
Nice work to you and everyone else. This is very nice.
June 13th, 2006 at 9:28 am
For me the last Code is really slow
Here is the Output:
"$ ./cairo-dock –surface-buffering
(cairo-dock:10703): Gdk-CRITICAL **: gdk_drawable_set_colormap: assertion `cmap == NULL || gdk_drawable_get_depth (drawable) == cmap->visual->depth’ failed
(cairo-dock:10703): Gdk-CRITICAL **: gdk_window_set_back_pixmap: assertion `pixmap == NULL || gdk_drawable_get_depth (window) == gdk_drawable_get_depth (pixmap)’ failed
1 fps, 0 events
0 fps, 0 events
0 fps, 0 events
0 fps, 0 events
0 fps, 0 events
0 fps, 0 events"
I tried all Parameters mentioned here, maybe the Output helps u
June 13th, 2006 at 10:21 am
–glitz doesn’t work here (big solid rectangle with random colors), but with ./cairo-dock –surface-buffering I get ~35-38 fps, that is very fast and smooth
PS. I’ve got an almost-five-year-old athlon xp 1700 with a radeon 7500 (xorg 7.1 + aiglx, but currently I’m using xcompmgr)
June 13th, 2006 at 12:06 pm
Wow that looks amazing!
I’m running it under AIGLX without –glitz option (same problem as above) it’s really beautiful and smooth, it claims to draw at around 38-40fps.
It’s incredibly beautiful on a Centrino 1,1Ghz comp’ with an i915GM graphic chip.
You rock man! Thanks for all your amazing work!
June 13th, 2006 at 12:06 pm
@Quinn
I am seeing this on Ubuntu Dapper with XGL/Compiz and Nvidia binary driver.
The program ‘cairo-dock’ received an X Window System error.
This probably reflects a bug in the program.
The error was ‘BadLength (poly request too large or internal Xlib length erro’.
June 13th, 2006 at 1:03 pm
You’ve priced me out of the market!!!
I only have cairo 1.0.4! LoL!
Looks like the status is that we can put some extra work into the algorithm and start adding features! Yay! I’ll be building a new cairo RPM tonight to do some testing and syncing the changes into the repository. I’ll get some work done on the trac once I’ve played with it, I think some intial front page stuff and a list of things mentioned as features should be added.
Nice work Mac
Lets just see where it goes. BTW I may see you at lugradio live, I’m considering going…
June 13th, 2006 at 1:33 pm
Nice work!
June 13th, 2006 at 4:03 pm
Hi, works fine here. But glitz and surface-buffering looks strange as said. But in both situations (glitz alone and both together), there is promted "Xlib: extension "XFree86-DRI" missing on display ":1.0".". But it works then.
BTW: Don’t forget to use double-hyphen before "glitz" or "surface-buffering". Otherwise i may be very slow ;D.
June 13th, 2006 at 5:34 pm
Hi,
it works for me without –glitz! With it- same prob as Qinn said!
Great work.
June 13th, 2006 at 9:22 pm
It works ok for me with just –surface-buffering, but I wish I could have it glitz-accelerated. nvidia binary driver here as well, if it matters
June 13th, 2006 at 9:30 pm
I’ve tested your dock and the ond from akamaru.
The one form Akamaru is incredibly fast, but with your dock I can only get 18fps
June 13th, 2006 at 9:43 pm
[...] Bene, sembra che il codice di MacSlow sia piaiuto a molti! Stanno arrivando tante patch e sono in corso grandiosi miglioramenti! Oggi lui stesso ha descritto la floridissima situazione nel suo blog, sono arrivati numerosi contributi eccellenti, sottoforma di patch, incoraggiamenti, proposte di collaborazione. Tra le cose più importanti per come la vedo io ci sono queste tre: [...]
June 14th, 2006 at 12:29 am
@all: People who have problems with the code from the tarballs should definitely check out the git-repository Behdad setup. Make sure you’ve git and related command-line tools installed on your machine. Then initially issue…
git clone http://people.freedesktop.org/~behdad/cairo-dock.git
to grab the code. Afterwards a simple…
git pull
in the cairo-dock directory will be enough to update your local copy. Aside from that I’ve no idea what is causing the BadMatch/BadLength-errors for some people.
June 14th, 2006 at 12:40 pm
It doesn’t compile for me…
What are packages it depends on, please ?
June 14th, 2006 at 1:06 pm
@ Tonio: For cairo-dock to compile you’ll need cairo 1.1.6, glitz 0.5.6, gtk+ 2.8.x, librsvg 2.14.x
June 14th, 2006 at 5:26 pm
I tried Behdad’s git repository, but I’m still getting a ‘BadLength’ error (also using the nvidia binary driver). Nevertheless, the dock is really fast and impressive
Great work!
June 14th, 2006 at 8:17 pm
Great work… still for me it doesn’t work. I am running fully updated Dapper and I can’t compile. I am having these errors:
………
main.c:932: error: ‘uiHandlerId’ undeclared (first use in this function)
main.c:935: error: ‘gpointer’ undeclared (first use in this function)
main.c:935: error: syntax error before ‘pWindow’
main.c:937: warning: implicit declaration of function ‘gtk_main’
main.c:943: warning: implicit declaration of function ‘rsvg_handle_free’
main.c:943: error: request for member ‘pHandle’ in something not a structure or union
main.c:944: error: request for member ‘pSurfaceBuffer’ in something not a structure or union
main.c:947: warning: implicit declaration of function ‘rsvg_term’
make: ** [main.o] Erro 1
June 14th, 2006 at 9:06 pm
@ linuxmad: Without seeing the full output of gcc it looks like your software-setup for development isn’t complete. You are probably missing several header-files.
June 15th, 2006 at 11:46 pm
I’m getting that blocky kinda thingie
But just look at the FPS:
http://img218.imageshack.us/img218/5642/screenshot9qg.png
June 16th, 2006 at 9:28 am
@MacSlow : Thanks, works.
But only wirh ‘—surface-buffering’ option (with glitz it doesn’t start), and I get beetween 15 and 30 fps (6600GT).
June 18th, 2006 at 6:10 pm
[...] Das Dock findet ihr auf Macslow’s Homepage sowie ein Video. [...]
June 20th, 2006 at 6:22 pm
[...] video & info - http://macslow.thepimp.net/?p=60 [...]
June 25th, 2006 at 6:49 am
I just ran it. I have a dual core opteron 165@1.8GHz and a 7900GT OC pcie. I have 2gb of ram, also. I ran it with no flags and got about 3 or 4 avg fps. With –glitz and –surface-buffering it is fantastic, but I get artifacts (black squares instead of icons, and not all of em. just a few).
This is very impressive man. You seem to whip this stuff up really quickly. It’s remarkable.
I looked at your code. Yeah, its’ a little bleh. I don’t know much C, but I know enough to say hmm to some of your organization there. *shrug* It will be fixed i’m sure. Thanks for your work. I can’t wait till someone makes it a functional launcher.
Without –surface-buffering, it’s immensely slow and the text is improperly rendered. With nothing but surface buffering, it’s perfect! No problems at all.
David
(aka regrasso_damonus/hesperaux)
June 25th, 2006 at 7:05 am
Oh. If you care, it was about 60-70 fps, and 104 if i really went crazy with the mouse. Also, here is a screenshot: http://www.flashbanged.com/david/xgl_cairo-dock_corner.png
It runs fine over desktops or the "corner." I don’t know if that’s important to you. I guess that is really just Xgl’s magic, but still. yay \o/
Dave
July 5th, 2006 at 8:09 am
[...] Un ejemplo de utilización de Cairo [...]
April 9th, 2007 at 1:17 pm
Duron 1 GHz (7.5×133)
512 MB SDRAM 133 MHz
GeForce 6200 with 128 MB RAM (AGP 2x because of incompatibility with an old Abit KT7A mainboard)
5-10 FPS with –surface-buffering (Beryl runs at 160 FPS)
./cairo-dock: symbol lookup error: ./cairo-dock: undefined symbol: cairo_glitz_surface_create
when trying to run with –glitz option
Using nVidia 9655 driver.