[Swfdec] swfdec 0.8.2 on MX31 (ARM) very slow

Bernhard Kuhn kuhn at l1nuxh4ck3r.de
Tue Dec 9 06:50:00 PST 2008


Hi!

Before going into details, i'd like to thank to all swfdec
developers for their hard work on this nicely architected
piece of software! Please not that I'm a swfdec noob, so
please be patient with me :-)


My goal is to get swfdec working on an MX31 ARMv6 target,
but i'm struggling with getting smooth video playback
working.

I'm currenly used Debian Lenny for ARM which has swfdec
and swfdec-mozilla (0.6.2) already integrated ready to go.

However, when trying to play youtube videos, i just got
a blank screen. I did some debugging (using 0.8.2) and
figured out that i needed to increase the source priority
for swfmoz_player_idle_redraw() from SWFDEC_GTK_PRIORITY_REDRAW
to GDK_PRIORITY_REDRAW (swfmoz_player.c, line 289).

Then, video playback was basically working, but *very* slow
(maybe around two frames per seconds). So i did some profiling
(with oprofile) and learned that swfdec obviously does a lot
of un-necessary alpha blending operations that you can just
omit (i uncommented "cairo_push_group (cr);" in swfdec_movie()
around line 787 in swfdec_movie_render() and ifdef'ed out
the corresponding "movie->masked_by" if-clause at the
end of the function). However video playback was still
unwatchable slow.

So i did some more profiling and enhanced some functions
in libpixman (running X-Server on top of fbdev) and replaced
the i420 to rgb color conversion with a faster hand-written
function. So i now ended up at about 10 to 15 FPS.

All graphical operations required for video playback are
accountable for about 35% of the CPU usage (see attached
oprofile break downs for libraries and sysbols). swfdec
itself takes only 15% CPU cycles for the flash decoding.
The remaining 50% CPU cycles seem to be overhead caused
by the system.

I fear, there is not much i could further optimize?! For
the time being, 10-15 FPS wouldn't be that bad but there is
another problem: the video plays back in "slow motion" (means:
all frames are rendered) rather than skipping rendering frames
now and then.

I have read about pretty much the same issue on this mailing list:
http://lists.freedesktop.org/archives/swfdec/2008-March/001306.html
and the patch to be found at
http://lists.freedesktop.org/archives/swfdec-commits/2008-April/000152.html
seems to be just what the doctor ordered. However, it's pretty
obvious that the patch has already been integrated to 0.8.2.
I guess this patch is only effective for the gtk-player but
not for swfmoz-player and it would be necessary to implement
a similar mechanism for swfdec-mozilla?

Any feedback is highly appreciated!

best regards

Bernhard



P.S.: i tried out 0.9.2, but this causes some error messages and doesn't
actually play videos (i will prepare a separate mail in this topic).
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: oprofile-swfdec-lib.txt
Url: http://lists.freedesktop.org/archives/swfdec/attachments/20081209/4376e73d/attachment-0002.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: oprofile-swfdec-sym.txt
Url: http://lists.freedesktop.org/archives/swfdec/attachments/20081209/4376e73d/attachment-0003.txt 


More information about the Swfdec mailing list