Lightspark, an innovative FLOSS Flash player, reaches Beta Status


More than a year has passed since the begin­ning of the Lightspark project. It was a long time indeed, but not wasted. I’m extremely pleased with the cur­rent level of sup­port and the robust­ness of the sys­tem. You may be won­der­ing “What the heck is lightspark?”, so let me intro­duce it.

Lightspark is an open source Adobe Flash imple­men­ta­tion, designed from the ground up to be effi­cient on cur­rent and (hope­fully) future hardware.

The long term objec­tive of this project is not only to deliver a free as in free­dom flash player, but also to give to the Flash tech­nol­ogy the dig­nity of a real open stan­dard. I really believe Flash is a pow­er­ful tech­nol­ogy, it’s main weak­ness being it’s closed­ness. Lightspark has been entirely designed after Adobe released the SWF file for­mat doc­u­men­ta­tion, so no reverse engi­neer­ing has been done.

Fea­tures

I’ll try to review and sum­ma­rize what as been done so far, and what is planned for the future.

Lightspark show­ing video. Pro­fil­ing graphs can be over­layed on the movie.

  • OpenGL based ren­der­ing allows for fast ren­der­ing of geome­tries and video frames. More­over, although those are not yet sup­ported, blur and other effects can be imple­mented using shaders for max­i­mum eff­i­cency. Using OpenGL tex­tures to dis­play video frames is a bit less eff­i­cent than using XVideo, but make it pos­si­ble to sup­port any overlaying/transformation effect that flash provides.
  • Mostly com­plete sup­port for the newer ver­sion of the flash script­ing lan­guage: Action­Script 3.0, intro­duced with Flash 9. Both an inter­preter and a JIT engine based on LLVM are pro­vided. The pre­vi­ous ver­sions of the lan­guage (sup­ported by Gnash, which does not sup­port 3.0) run on a com­pletely dif­fer­ent, and quite weird, vir­tual machine. Cur­rently Ligth­spark does not sup­port the older engine, but most sites (e.g, YouTube) are migrat­ing to the newer engine, so we will be fine just with 3.0
  • Beside the Vir­tual Machine Flash pro­vides a huge run­time libraries that ranges from Video Ren­der­ing ser­vices to XML pars­ing. Imple­men­ta­tion of the run­time is of course far from com­plete, but the archi­tec­ture of the VM makes it pos­si­ble to eas­ily imple­ment the var­i­ous objects in plain C++. More­over, an arbi­trary degree of mix­ing between VM gen­er­ated and C++ code is pos­si­ble. This means that func­tions can be called from what­ever con­text with­out wor­ry­ing about their origin.
  • A mozilla com­pat­i­ble plu­gin is pro­vided, I’ve spent a lot of time try­ing to make the code robust to unex­pected con­di­tions and it should fail grace­fully and dis­play a gen­tle mes­sage. But, as plu­g­ins runs inside the browser process, there a not-so-slight pos­si­bil­ity of crashes. Please report any crashes using the bug report­ing sys­tem of launchpad
  • As an added bonus, dur­ing devel­op­ment I’ve also added a cou­ple of inter­est­ing per­for­mance profiling/debugging fea­tures which are not pro­vided by the orig­i­nal Adobe player. Key­board short­cut can be used to enable a pro­fil­ing over­lay, and a prim­i­tive inspec­tor of the objects on screen
There­fore I declare lightspark to be in beta sta­tus! Now the most impor­tant thing that is still miss­ing is a nice Logo for the project. I’m very bad at art, so any con­tri­bu­tion is very wel­come. And of course the whole project, in a pure open phy­los­o­phy, is open to con­tri­bu­tion! To have a quick glance at the cur­rent sta­tus it is pos­si­ble to get lightspark pack­aged from our PPA on launch­pad.
Lightspark should fail in a clean way on unsupported Flash movies

Lightspark should fail in a clean way on unsup­ported Flash movies

Share on:
  • email
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • LinkedIn
  • StumbleUpon
  • Twitter
  • Slashdot
  • Technorati

, , ,

  • Will it be possible to port Lightspark to PPC ?
  • My congratulations from Mexico to Italia! :D I'm just dicovering a post about Lightspak, and I'm having a lot of hope in your -our- community project. Maybe, in a near future, your program comes by default in a distro like Fedora, Ubuntu, OpenSuSE...

    Greetings!
    JaD!
  • Davide
    It is possible to contact the author?

    Thank you very much.
  • apignotti
    Here I am :-) My mail address is available on launchpad
  • ? This is the correct blog. Do you want to contact him via mail?
  • Will Lightspark have tool-assisted speedrunning (TAS) features? Basically that means the player should be able to process an input stream on a SWF file and always produce the same output, and it should include tools for making these input files, such as recording, save states, slow motion, frame advance etc. You can find more about TAS at http://tasvideos.org/ . I have been working on a Flash implementation as well with these features in mind, but if another player gets the same features then I might as well abandon my project.
  • That's not planned.
  • Jeff Moe
    I tried building from git on Fedora 12 x86_64. I was able to find all the build dependencies except "mozilla-plugin". What is this creature?
  • This is the first time I'm hearing about this project, and I'm happy that someone it's coming forward with trying to make a decent solution for linux. Keep up the good job ;)
  • Flow
  • MLx
    Any chance of a build for *buntu Karmic?
  • apignotti
    karmic misses an updated version of llvm, sorry :-(
  • Wow, these are really nice news. Is there any change you will opensource it and publish it also on OSX? Mac community highly needs a good performing flash player. Adobe was not able to publish one until now.
  • dave
    neither could this project until just recently. Apple didn't open the performance hooks needed to make video work effeciently
  • jurek
    Ok but opengl accelerated graphics would bring lot of performance improvements too on Mac... Or not?
  • Milan
    I just tried to compile it, llvm-2.7 doesn't have llvm/ModuleProvider.h , also I couldn't find mozilla plugin tarball or source, where is it? Thx, I hope this open source flash project will be succesfull ;)
  • apignotti
    It looks like you're using an older version, please download the current master branch from github. Plugin source is included in the repository.
  • Milan
    Everything is ok now, but where can I download watch_as3-vfl155676.swf ? Link in readme returns 404 .
  • Here's my logo contribution, hope you'll like it.

    Full logo version : http://spitch.fr/tests/lightspark.png
    Icon version : http://spitch.fr/tests/lightspark-ico.png
  • apignotti
    Nice work! would you mind adding them to the launchpad bug dedicated to the logo?
  • kasbah
    This seems extremely cool. I am having some issues but I shall report these on the tracker. Does it use OpenGL to accelerate video decoding in any way?
  • apignotti
    There is preliminary, currently disabled, support for vaapi accelerated video decoding, contributed by "Gwenole Beauchesne". I think the API has a lot of potential, but the drivers support is still not mature enough. Accelerated decoding using vaapi is planned as a key feature of future releases.
  • kasbah
    Thanks for the quick repsonse. VAAPI is an API to the dedicated decoding hardware (on newer AMD gaphics cards and Atom chips) as far as I understand. I was wondering if any video decoding was done in OpenGL directly though GLSL as I am currently working on a project doing this.
  • apignotti
    No, currently no work has been done on such subject. If you want to contribute please subscribe to the lightspark-devel mailing list on sourceforge http://sourceforge.net/projects/lightspark/support
    and discuss your proposal there, as the rendering/decoding architecture is somehow complicated
  • Sean
    Any possibility you'd reconsider the license and put it under something that makes redistribution easier? The use of the GPLv3 destroys any possibility of this becoming integrated with future Firefox or Chromium browsers, and also precludes it from being a part of a number of Open Source operating systems like some of the BSDs that avoid the GPLv3 like the plague. It also makes it impossible to distribute many video codecs with the project; even if you using a pluggable codec pipeline like GStreamer, by being under the GPLv3 you preclude the use of any non-Free video codec, which essentially makes the whole plugin useless as a video playback replacement for most Flash video sites. You're also entirely removing any possibility of commercial contribution from just about any company other than the handful of pure-FOSS companies.

    Given it's designed to be used as a plugin that mixes in a browser that is likely running other plugins, at the very least the LGPL would make way, WAY more sense. It'd be fantastic if it went BSD/MIT/zlib if you're not opposed to Open over Free. Either way, the GPLv3 really just guts the potential for this project to being nothing more than a non-standard add-on package only useful to hobbyist Linux users.
  • Jack
    Wow, such nonsense and fearmongering....

    Since it's release as plugin and can use the installed codecs most of your complains are moot. No substance!

    You complain that it isn't "free" enough and then you complain it can't be used in proprietary software !?

    Most "real life" distributions don't include "non-free" codecs. That point is moot too!

    As for BSD, if they don't mind installing "non-free" codecs why would they refuse to use GPL apps? Might be a case blind hatred?

    None of licenses, recognized by OSI or by the FSF, forbid any commercial distribution.

    None of arguments has any substance, NONE!
  • Packet Inspector
    > The use of the GPLv3 destroys any possibility of this becoming integrated with future Firefox or Chromium browsers

    How so? Both Firefox and Chromium are licensed under the GPL.
  • Jesper
    > How so? Both Firefox and Chromium are licensed under the GPL.

    Firefox is multi licensed MPL / GPLv2 / LGPLv2.1.
    Chromium is BSD licensed.

    Multi license make it possible for you to choose the license you want to work with.
    If you are not interested in licensing, you might also think all GPL is the same. However there is a HUGE difference between GPLv2 and GPLv3.
    An example of the result of this is that Apple ban GPLv3 and e.g. the newest GCC under Mac OS is version 4.2 (latest version before GCC switched to GPLv3).
    Many BSD's also choose/make alternatives to GNU software because of GPLv3.

    I can only fully agree with Sean, that another license should be seriously considered. Using GPLv3 will certainly limits the use of Lightspark.
  • apignotti
    I've been considering relicensing under a less restrictive license. I'll evaluate pros and cons and make an announcement if I choose something else.
  • Y.
    I strongly suggest you use a more appropriate license like the LGPL. This will not risk the openness of the plugin, but clarify linking and distribution issues and allow code sharing with other open plugins (most of whom use LGPL AFAICT). See GStreamer docs (based on official FSF opinion) for the kind of legal mess a combination of GPL/LGPL/propriety can be:

    http://www.gstreamer.net/data/doc/gstreamer/head/faq/html/chapter-legal.html
  • Anonymous
    Please don't. GPLv3 is fine for a browser plug-in, it does not even restrict it from using any codecs. It's not like anyone is going to distribute the plugin AND the browser AND codecs compiled together into one executable.
  • I'd love to know what the FSF has to say about that. After all, the FSF claims that a program which dynamically links to a GPL'd library is a derivative work of the library, even if the user can swap in an alternative implementation of the same interface at their own choice. So, would distributing a browser with a GPLv3 plugin cause the browser to be treated as a derived work? If not, why is dynamic linking to a GPLv3 library different?
  • John Smith
    It's very depressing to see people bashing you because of the license you chose for _your_ project. I'm very interested in this project, I hope these people don't discourage you. You can always turn off comments if you like. I might be contributing anonymously from time to time, good luck my friend.

    "A sensible man knows you can not please everybody. A wise man knows you can not please anybody." - Anonymous
  • This would be cool to get working on Haiku OS... sadly lacking good OpenGL support at the moment though... LLVM is said to compile well with a one or two liner fix.

    The Haiku guys also make a good case for BSD/MIT licence if a company uses thier code big woop they still have everything they wrote and chances are that profits made will eventually filter back... The problem with GPL is that it is too lengthy and restrictive IMO if someone adds something to my code they should be able to sell that if they need to for profit (everybody has to eat) I guess its the difference between being a GPL "Nazi" and being relatively chilled out about how your code is used. GPL is like following your kid into school everyday you might say...
  • Philipp Kern
    Urgh, of course they can sell it, even if it's GPLv3. They have to ship the code with their sales of course, and the seller can give it away. But don't say it's not possible!
  • Jez
    GPL makes it a lot more difficult to integrate with existing projects, and most companies (such as Apple) will avoid funding/contributing to it under that license.

    LLVM and Webkit both use more permissive licenses. The looser license allows for far more adoption - and it's difficult to argue that either LLVM or Webkit have lost anything from people keeping changes proprietary.

    This is the kind of decision that becomes extremely difficult to change once there are several contributors to the project.
  • jonaskivi
    The decision about the licence is yours. You're free to choose any licence that you wish to use. (Obviously...)
    If you truly feel that GPL3 is the one you want, for whatever reason, then you should go for it. But, it would be good, that you know all the concequences that the licence decision will have for the adoption and distribution of your code. As others have stated, there are a quite a lot of good reasons for using something more permissive (MIT/X11, BSD). On the other hand, the GPL3 will guarantee a certain amount of control for the freedom aspects of code. At the same time it will of course restrict the distribution of it more. It's all politics.

    If freedom in the sense that the GPL3 states it, is very important to you personally, then you should go with the GPL3. And if you want as many people as possible to reuse, redistribute and bundle your code with existing browsers on all operating systems, then you should choose a different licence. The practical concequence of GPL3 is that people adopting your project, will have to download it separately and install it by themselves. Or then some people can make prebundled packages, that will include both the browser and the plugin, but these packages (propably) won't be made by Mozilla or Google, but by individuals or e.g. operating system distributions like Fedora/Ubuntu/Suse/*BSDs/Haiku/(insert your favorite here). It might be possible for the browsers to ask the user in a pop up window, if they'd like to install Adobe flash or Lightspark when the browser encounters flash content for the first time. This wouldn't be restricted by the GPL3.

    If all the browsers would be using GPL3, then you wouldn't have to think about it, but as both of the mainstream open source browsers have commercial history and commercial backing they have solid reasons to prefer more commercial friendly open source licences. With these licences it is possible that someone can take your code, and make some major changes to it, and not give the changes back to you. But atleast most companies will honour the spirit of open source, and give back all of their changes, even if they are not legally bound to do so under the MIT/X11 and BSD licences. And atleast with these two licences they are bound to tell it in their documentation that they are using your code. So you'll get the credit for it anyway.

    I encourage you to read the wikipedia articles for the licences mentioned here, and then give it some thought, as it is not a light decision, whichever licence you might choose.
  • Louise
    Are your familiar with

    http://blitzableiter.recurity.com/

    ? It is a project for make Flash secure, as it have a lot of API's. Source is GPLv2.

    The author and an Adobe developer presents the tool here:
    http://events.ccc.de/congress/2009/Fahrplan/events/3494.en.html
    ftp://ftp.ccc.de/congress/26c3/mp4/26c3-3494-de-defending_the_poor.mp4

    At the end the Adobe developer explains that they would like to remove old Flash API's for security reasons, but they can't as the web would break.

    What's your take on this? Will you only support the secure API, or also all the old?
  • apignotti
    I think that removing/deprecating older and broken API is the way to go. Of course lightspark is a community driven project. If people really need an application using unsafe APIs (and somebody implements them) they will be supported. Although a special configuration switch to enable such APIs could be included anyway.
  • Louise
    Awesome! That would be a big deal for enterprise desktop users, where they can't effort any potential security risks. Just think what China did to 30 US companies through a browser attack =(

    Btw. If you haven't seen the video, you should =) Not so much to hear how bad and insecure Flash is, but just to hear that guy. He have the highest "swearword per minute" I have ever heard =) The video can only be downloaded with a browser, not wget.
  • p|astikman
    Hello,

    I just tested this on Fedora 12 x86_64 (took the binaries form the .deb) with FireFox 3.5.9 when I load youtube I get the following crash. http://pastie.org/966003

    Any more info i can provide to you just let me know
  • apignotti
    please report a bug on launchpad, detailing your configuration (32/64 bit CPU, video card, video driver and linux version) and the website you were surfing. Sorry for the crashes, this is an early release :-D
  • Flamelab
    Hi..!

    I am trying to build Lightspark from git on Archlinux x86_64

    I can't seem to be able to pass the building stage, due to a weird error:

    Linking CXX shared library liblightsparkplugin.so
    /usr/bin/ld: cannot find -lLLVMLinker
    collect2: ld returned 1 exit status
    make[2]: *** [plugin-dir/liblightsparkplugin.so] Error 1
    make[1]: *** [plugin-dir/CMakeFiles/lightsparkplugin.dir/all] Error 2
    make: *** [all] Error 2
    ==> ERROR: Build Failed.
    Aborting...

    All the appropriate deps are installed, can't find what's going wrong here :-/

    Would you like that I submit this as a bug on launchpad ?
  • Flamelab
    I also forgot to post about a thread on the arch fora where I ask help upon building lightspark

    http://bbs.archlinux.org/viewtopic.php?id=97363

    where you can see the PKGBUILD (like .spec files on Fedora)
  • apignotti
    Libraries that need to be linked are those reported by 'llvm-config --libs'. Have a look at your llvm version and ensure that libLLVMLinker.a is included. Please report the bug on launchpad if you think it is a problem caused by lightspark's build system, it is quite hard to keep up with bug reports here.
  • Looks great. Looking forward to seeing more examples of this project. Here's my logo attempt: http://img.skitch.com/20100518-883uteau8i6unw34fgiterusic.png
  • apignotti
    I like this a lot! There is a bug on launchpad dedicated to logo proposal, would you mind adding this one there? Moreover, I was wondering if it could be possible to leave only the initials of the projects ('LS'). The whole name would look quite bad when scaled to icon size.
  • Alexandre
    Where is the source code available for this latest release? I'd be interested to make it run on other distributions than Ubuntu.

    Thanks,
  • This is good in an enviroment where propietary player is very slow ... and the other open source players are lacking features...the ideea about the implementation using only the specification..not reversing (which might copy some of the bugs/drawbacks in the adobe player) is very good...plus open gl works very good even on older computers.... it reached www.phoronix.com ... it might atract some other developers ... good luck
  • Pete
    Wow thank you so much for this! Been looking for a way out of flash hell on linux for awhile, and a fully open source hardware accelerated implementation too; you're a real champ for doing this! :)

    I see you're a KDE user, maybe pinheiro ( http://pinheiro-kde.blogspot.com/ ) of oxygen fame would be willing to design an icon for the project. Would be good for KDE's exposure, integrate nicely with the desktop and give you a kickass icon.
  • dmitry564
    It doesn't play youtube and even most of simple banners :(
  • ThOR27
    It should be interesting if we could have a adobe-flash-plugin fallback when lightspark fails.
  • laurencevde
    Would support for ARM be possible?
    Most ARM-linux-devices are craving for some kind of flash-support...
  • +1 to ARM support. Now flash is a big pain for ARM-based devices (except Nokia N8xx series). I'm using a chienese MID SmartQ V7 with ubuntu on board and lack of flash is the only problem.
    Maybe I can try to cross compile it...
  • drefeng
    My Nokia N810 ARM device has some version (maybe 9.x? at least youtube works) of the proprietary Adobe player as a standard Mozilla plugin, maybe it works on other devices as well?
    http://repository.maemo.org/catalogue/updates/diablo-2/adobe-flashplayer_2.54-1_armel.deb
    N900 would probably had even newer version, but I don't know the repository URL.
  • This is a very exciting project without a doubt. I certainly hope you get some help with what must surely be a massive undertaking.

    My experiences with the beta:

    - The Firefox plugin does not display video for Hulu or Youtube. No crash message is shown. Just a blank spot on the page where the player usually resides. (Ubuntu 10.04, Firefox 3.6.3, Intel 965)

    - From the command line I was unable to stream any url or play a local swf file. The streaming efforts produced either a seg fault or simply an aborted message. The local file opened a window that hung on me with no video. I could only kill -9 it.

    So I had no success but am very excited about any future developments. Keep up the work.
  • Sven Arvidsson
    Interesting, any plans on using GStreamer for audio and video support?
  • kasbah
    looks like the daemon tools logo
  • apignotti
    Hi everyone, thanks for you're interested in this project. I should have written in the post that the plugin is included in a different package: mozilla-plugin-lightspark, also in the ppa. The plugin should appear in the Add-on window of firefox, under the name "Shockwave Flash 10.0 r03".

    Thanks a lot to those brave enough to try out the system, if you find that lightspark crashes without showing anything please report a bug detailing your configuration. I've only a couple of workstations and a laptop to run tests, and it is really possible that I've missed something critical for other configurations.
  • Dao
    "But, as plu­g­ins runs inside the browser process, there a not-so-slight pos­si­bil­ity of crashes."

    As of Firefox 3.6.4, Flash runs in a separate process. You should check whether this works with Lightspark and then file a bug on bugzilla.mozilla.org to get it added to the whitelist. Details here: http://benjamin.smedbergs.us/blog/2010-03-03/firefox-safe-from-plugin-crashes/
  • apignotti
    Yep, I know about out of process plugins and I'll migrate to such safer environment as soon as possible. Currently the input system would not work out of process :-(
  • Correct me if I'm wrong here: JavaScript based Flash Player detection (used by the majority of websites containing Flash content) will report a negative if someone is using Lightspark plugin instead of the Flash Player. In other words, unless websites update the JavaScript code to detect for the Flash Player OR Lightspark, people using Lightspark are going to see "Flash Player required" messages everywhere.
  • apignotti
    This is not really an issue. Lightspark, as Gnash, disguises as the proprietary plugin, advertising a compatible name.
  • Rather annoyingly, I decided to try it out, but despite the claims of a mozilla plugin, none appears in the /usr/lib/mozilla/plugins folder and therefore neither firefox nor chromium plays flash atm. Would very much appreciate if you could at least post a temporary solution to this problem (perhaps linking/copying the required file to the correct folder would help? I have no real idea how this all works).
  • Soroush
    I can't get lightspark to render any flash. It crashes as soon as it starts on my amd64.
  • apignotti
    This is an interesting issue as amd64 is my primary development platform and first class citizen. Would you file a bug on launchpad please, including a bit of details about your configuration (CPU, video card, linux version)
  • Nice! With swfdec which was powerful, but which development was abandonned, and Gnash that is CPU-intensive and lacks many features, I am glad to see that there are living projects for implementing Flash freely.

    It would be cool to also publish a standard Firefox plugin in addition to the Ubuntu package…
  • Eric
    Yeah I too don't see the firefox plugin.
  • Eric
    You may want to ask the Tango guys in their freenode channel... some of them are willing to create logos for opensource projects that look good.
  • Vanya
    Super exciting!

    I installed the plugin from the ppa, but Firefox doesn't seem to show it in the list of plugins, and Youtube tells me I need to install Flash. Is there another step?
  • peder
    Wow, this is great news, i'll try it as soon as possible. Thank you very much for this!
    But the most important question remains: Does Youtube and <insert favorite="" here="" porn="" site=""> work?</insert>
  • Video support works, but audio has still to be written.

    Mozilla plugin is packaged in mozilla-plugin-lightspark
blog comments powered by Disqus