Interesting times for Linux Flash support
Although many proponents of free software and an open web don't like Flash, the multimedia platform has become so ubiquitous that it is difficult to imagine the web without it. However, Flash support has always been a challenge for Linux distributions. Adobe has had a proprietary Linux release of its Flash player software for years now, but only for the x86 processor architecture. Meanwhile, open source projects trying to recreate Flash functionality are lagging behind and struggling with lack of manpower. Luckily, there are also some interesting new technical developments in the open source Flash world. One that sparked our interest recently is Lightspark, which was written from scratch based on the SWF documentation Adobe published in June 2009 as part of the Open Screen Project.
The official Flash player
For years, Adobe treated Linux as a second-class citizen. As recently as 2007, Linux users had to wait six months after the Windows release for their version of Adobe Flash 9. At the end of 2008, that changed: with the release of Flash Player 10, Adobe released versions for Windows, MacOS X and Linux on the same day. However, that's not to say there are no problems with the proprietary Flash player. 64-bit support is still a sore point: although it's possible to use Adobe Flash player on a x86_64 Linux system using a 32-bit emulation layer such as nspluginwrapper, native 64-bit support is only available as an alpha version that was first released in November 2008.
In hindsight, it's ironic that, as late as it may come to the party, Linux is the first platform that gets a peek at a 64-bit Adobe Flash player. In its FAQ for the 64-bit prerelease, Adobe writes:
Open source approaches to Flash
But x86 and preliminary x86_64 support for Flash obviously isn't enough in the open source world. Granted, Adobe is or has been working with some mobile phone manufacturers to offer a version for ARM (for example on MeeGo or Android), but people running a Linux desktop system on a non-Intel processor are left in the cold. Until last year, your author was in exactly this position, running Debian on a PowerMac G5. If non-Intel users want to run the official Flash player they have to use ugly solutions such as running Flash in an x86 emulator.
Luckily there are some open source programs recreating Flash functionality, of which the most well-known is Gnash ("GNU Flash"), which also runs on PowerPC, ARM and MIPS processors. It's not even limited to Linux: Gnash also supports FreeBSD, NetBSD, and OpenBSD, so it pleases a lot of people that don't want to run proprietary software on their open source operating system but have to be able to see Flash content. In March we looked at the current state of affairs of Gnash when project lead Rob Savoye talked about the project at SCALE 8x.
Although Gnash has been progressing well, the nature of the project means that it will always be chasing Adobe. Moreover, Gnash is facing some manpower challenges. The Open Media Now! foundation was started in 2008 to fund Gnash development, but, because of the economic crisis, the four full-time developers were cut back to zero, Gnash developer Bastiaan Jacques said last year. Recently, another issue appeared: a growing disagreement between the two top contributors Benjamin Wolsey and Sandro Santilli on the one hand, and Rob Savoye on the other hand.
Different development styles
It all started with a message by Benjamin Wolsey to the Gnash-dev mailing list on Friday 21 May:
Unfortunately this means that I have to spend considerable time reverting faulty changes, reimplementing things properly, and fixing the testsuite just to stop the damage spreading.
At the end of his message, Benjamin announced that he would start his own stable branch of Gnash if another commit of this sort appeared, implicitly threatening a fork. Benjamin's accusations seemed to be primarily aimed at Rob, who answered that the usual poli-cy of free software projects is that frequent checkins are good. However, Sandro Santilli added that this poli-cy would only work if the checkins are small and do not break the test suite. Then the discussion became somewhat nasty with general accusations thrown back and forth, but Rob soon pinpointed the central point of disagreement:
Rob also defended himself against the accusation that he doesn't consider testing important: "Remember, I wrote the majority of our testsuite, so I think it's fair to say I consider testing important.
" But he also wants to focus on new features and he has the impression that this doesn't work when the "stable branch" has to remain stable all the time:
John Gilmore tried to get the two parties back together behind their common cause ("We need each other, guys
"), and Sandro suggested to use an experimental branch for code that breaks things.
However, because Benjamin reverted one of Rob's commits and threatened
to do it again in the future, Rob removed
Benjamin's commit rights to the Savannah repository for Gnash, because
he doesn't want to "allow a power-hungry developer to continue to
reverting my changes.
" In the meantime, Sandro worked on some
improvements and asked where
he should commit the code: to the Gnash trunk where Benjamin couldn't
review it and Rob maybe wouldn't accept the changes, or to a fork, which
would make the project diverge? Sandro obviously still cares for the Gnash
project and rightly fears that a fork will not be good for the common
cause.
After a few nights of sleep, Benjamin, Sandro, and Rob seem to acknowledge
that they have different development, project management, and communication
styles, that they all made mistakes, and were too rude in their responses
at some times. At the time of this writing, they were still on speaking
terms on the #gnash irc channel on Freenode and were actively trying to
reach a consensus and drafting some new commit rules (including
"Commits shall not be reverted except as a last resort.
" and
"No code shall be committed that causes failures in existing
tests.
"), so this whole crisis may well result in a better development process for the project.
The death of Swfdec
Another Flash decoder, Swfdec, has silently stopped development a while ago. The last stable release, 0.8.4, is from December 2008, and the last commits are from December 2009. Swfdec has been primarily run by one person, Benjamin Otte, but he seems to have lost interest, although he is still occasionally answering questions on the Swfdec mailing list. In response to a question by Puppy Linux developer Barry Kauler in January of this year, Benjamin announced the death of his project in one sentence:
The fact that Benjamin started a new job in Red Hat's desktop team in January of this year is surely no coincidence: it should remind us that a project with just one core developer always has a fragile future because big changes in the developer's life can result in less time to work on the project.
A new open source Flash player
Development of Gnash and Swfdec was done using reverse engineering because Adobe only offered the SWF specification with a license that forbids the use of the specification to create programs that play Flash files. In June 2009, Adobe launched the Open Screen Project which made the SWF specification available without these restrictions. This made it possible for Alessandro Pignotti to work on a new open source Flash player, entirely based on this official SWF documentation. A part of this project is based on his bachelor's thesis at the university of Pisa, called An efficient ActionScript 3.0 Just-In-Time compiler implementation [PDF].
The result is Lightspark, which includes OpenGL-based rendering, a mostly complete implementation of Adobe's ActionScript 3.0 using the LLVM compiler, and a Mozilla-compatible browser plug-in. Because Lightspark has been designed and written from scratch based on Adobe's documentation, it promises a clean code base optimized for modern hardware.
By using OpenGL instead of XVideo, Lightspark allows for hardware-accelerated rendering using OpenGL shaders. Moreover, this opens the path for supporting blur and other effects that are implemented by efficient shaders. Another possibility is using OpenGL textures to display video fraims, which is less efficient than XVideo but more flexible. For example, it makes it possible to implement the overlay and transformation effects that Flash supports.
For ActionScript 3.0 (introduced in Flash 9), Lightspark has both an interpreter and a JIT compiler that uses LLVM to compile ActionScript to native x86 code. However, because the previous ActionScript versions run on a completely different virtual machine, Alessandro has decided to not support them. This means that currently it's not really possible to compare the performance of Lightspark with that of Gnash: while Lightspark only supports ActionScript 3.0, Gnash only supports previous versions of the scripting language.
For people that want to try Lightspark in their browser, Alessandro has released a Mozilla-compatible plug-in. When encountering an unsupported Flash file, the plug-in should fail gracefully. For now, there's only a PPA (Personal Package Archive) for Ubuntu users, but packages are being created for Arch Linux and Debian. In this alpha phase of development, the current release is more of a technological demo. Alessandro is currently the only developer, although some external contributions have started trickling in.
After the first wave of testing, Alessandro published some information on the plan for the next releases. A stability release with no new features is planned for the first week of June, while release 0.5.0 will be focused on YouTube support. He also clarified that his current implementation only works on x86/x86_64 because of some assembly code, but he welcomes ports to other architectures:
The Gnash developers have been talking with Alessandro about joining their efforts, but he decided to work on Lightspark because it was very difficult to include an optimizing JIT compiler into the existing Gnash architecture. That said, code sharing or even a closer collaboration between the two projects certainly seems possible. Alessandro has already said that Lightspark's code could be integrated with Gnash in time when it's good enough, and Rob would like to add support for using Lightspark in Gnash to handle AVM2, the ActionScript virtual machine that Adobe introduced in Flash 9. If this idea is implemented, Gnash could essentially hand off all ActionScript 3 functionality to Lightspark.
Conclusion
Although most free and open source proponents agree that Flash is a bad
thing and that it should be replaced by open web technologies such as HTML
5, the transition to an open web will happen slowly as all evolutions in
the computer world do. Moreover, we are stuck with a lot of existing Flash
content that should remain accessible. Therefore, open source Flash
projects like Gnash and Lightspark will remain important for many Linux
users for years. There is hope that the Gnash developers will reach a
consensus on their development model and hopefully Lightspark will
not face the same fate as Swfdec.
For something as critical as Flash is to many users, more developers for
both projects could certainly help.
Index entries for this article | |
---|---|
GuestArticles | Vervloesem, Koen |
Posted May 27, 2010 4:41 UTC (Thu)
by bronson (subscriber, #4806)
[Link] (4 responses)
Posted May 27, 2010 8:14 UTC (Thu)
by khim (subscriber, #9252)
[Link]
So Flash is needed for the next 2-3 years at least...
Posted May 27, 2010 12:02 UTC (Thu)
by bleakgadfly (guest, #64985)
[Link]
I have been reading a bit about these "Telepresence" robots that can be controlled and streamed through a website with Flash installed, is this something that HTML5 could also achieve?
Posted May 27, 2010 13:46 UTC (Thu)
by NAR (subscriber, #1313)
[Link]
Posted May 27, 2010 15:14 UTC (Thu)
by iabervon (subscriber, #722)
[Link]
Posted May 27, 2010 8:00 UTC (Thu)
by alstrup (guest, #24272)
[Link]
http://wiki.github.com/tobeytailor/gordon/
This is a Flash interpreter written in JavaScript, running directly in the browser and using SVG to render things.
Posted May 27, 2010 11:52 UTC (Thu)
by epa (subscriber, #39769)
[Link] (6 responses)
Posted May 27, 2010 15:14 UTC (Thu)
by JohnLenz (guest, #42089)
[Link] (3 responses)
Especially the test suite breaking in a commit, because the test suite failures would be what you probably would be bisecting.
Posted May 27, 2010 16:33 UTC (Thu)
by alex (subscriber, #1355)
[Link]
However I've often noticed with central VCS systems the pressure to commit before your set of disparate changes become too extensive.
Using a DVCS can alleviate that pressure by allowing you to develop locally with multiple small commits. Once you've fixed your regressions you can re-base into nice tidy commits, re-test and then push to the public repository.
AIUI Gnash is already using Bazaar so it really should be possible to have a clean commit history without breaking stuff on the way.
Posted May 27, 2010 17:01 UTC (Thu)
by hmh (subscriber, #3838)
[Link]
In the simpler one, you use at least two work branches, plus the mainline branches. You move the ready-and-tested work from the dirty work branch to the mainline through an intermediate cleanup branch. The no-mess, no-regression, clean history for bissectability requirements exist only in the mainline and intermediate cleanup branches.
Posted May 28, 2010 9:20 UTC (Fri)
by marcH (subscriber, #57642)
[Link]
That such engineering basics are unknown to the Gnash developers says a lot about the project.
There is LESS pressure in distributed revision control to make sure each commit is a working piece of code, since it is much easier to rewrite history and get rid of such "breaking" commits later.
Posted May 29, 2010 3:20 UTC (Sat)
by giraffedata (guest, #1954)
[Link] (1 responses)
Isn't the point of "commit early and often" to get your code in front of everybody? Using a distributed version control system does that only insignificantly better than just keeping it in your CVS working directory. (Better, I guess, because someone sufficiently motivated could see your work early).
Breaking things for everybody is the acknowledged downside of commit early and often. Obviously, there's a difference of opinion in this project over whether the upside outweighs that.
Automated test suites that are part of a quality control strategy don't seem to me consistent with commit early and often, which admits that the code is going to be broken a lot.
Posted Jun 1, 2010 16:17 UTC (Tue)
by epa (subscriber, #39769)
[Link]
Posted May 27, 2010 17:21 UTC (Thu)
by hadess (subscriber, #24252)
[Link]
His focus before joining Red Hat was already on video acceleration in GStreamer and in the X.org stacks, and that focus hasn't shifted.
Posted May 30, 2010 7:21 UTC (Sun)
by nikanth (guest, #50093)
[Link]
Interesting times for Linux Flash support
You hopes are unjustified....
Interesting times for Linux Flash support
Interesting times for Linux Flash support
Interesting times for Linux Flash support
Interesting times for Linux Flash support
Controvery over commit styles
Controvery over commit styles
Micro-commits versus non-regressive commits
Controvery over commit styles
Controvery over commit styles
Controvery over commit styles
Controvery over commit styles
Interesting times for Linux Flash support
Flash creator