Paparazzi v2

This is my monitor at work:

Penguin Paparazzi

Coworkers passing by are beginning to think I’m somewhat vain. Don’t ask about that sumo camera. Just… nevermind.

Anyway, the second beta of Flash Player 10/Astro includes native support for cameras conforming to the Video4Linux v2 API (V4L2). The support is not complete, however, owing to the fact that there are dozens of different colorspaces that a V4L2 camera can provide to a user application. I suspect that this is a manifestation of the do-it-yourself spirit of Linux, i.e., if you need support for a particular format, you need to code it yourself.

So the first pass at V4L2 support in the Linux Flash Player contains handlers for quite a few different pixel formats. Only 2 of them have been tested so far. (I should point out that, of all the cameras in the picture above, only 2 work in V4L2 and also output a usable format.) The rest of the formats were just implemented blindly.

So I’m hoping to get your help in testing these formats.

My corporate masters have authorized me to release the source code for a small utility to gather basic data about a V4L2 camera:

An example run:

$ ./v4l2-formats /dev/video0
/dev/video0 is a V4L2 device named 'VF0410 Live! Cam Video IM Pro'
/dev/video0 is capable of video capture
/dev/video0 is capable of streaming capture
/dev/video0 supports 'YUV 4:2:2 (YUYV)' (raw format, V4L2_PIX_FMT_YUYV)
/dev/video0 supports 'MJPEG' (compressed format, V4L2_PIX_FMT_MJPEG)

Please download the utility and run it on each /dev/videoN device you have on your system. You will ideally have one such device for each camera attached to your system: /dev/video0, /dev/video1, etc. Then, go ahead and post the results in a comment below.

Also, it would help if you could test out the V4L2 capabilities of the current Flash Player 10 beta and let me know, along with the foregoing technical data, whether or not your camera gives you a picture through Flash, without crashing, and if it looks correct. Check out this snowfall SWF for a good example.

One more thing: If you include your email address in the form’s email field (not in the actual message content), and you report that your camera does not work correctly, I may contact you directly if I deem that you could be useful for collecting more data.

Technical notes: The official documentation recommends VIDIOC_TRY_FMT in order to determine camera capabilities. In my experience, VIDIOC_TRY_FMT lies. I have a camera that claims to support every format in V4L2. I found VIDIOC_ENUM_FMT to be more reliable.

Addessing Wmode Crashes

Firefox 3 is the first Firefox release for Linux that includes windowless mode (wmode) support. Unfortunately, there was a crashing issue related to wmode that a lot of people testing Flash Player 10 beta 2 have encountered, and on fairly major sites.

Great news: Thanks to the Firefox team, this issue has been solved. The fix has made its way into the Firefox nightly builds. You can download them at http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/.

The first build I know of that contains the fix is for 2008-07-08. So start with that one or later, until the next formal Firefox release. Ideally, wmode-related crashes should now be entirely Flash’s fault. But please, before reporting such crashes, be sure (using the About Firefox dialog) that you actually are using one of the very recent builds. And it wouldn’t hurt to be certain that you’re using the latest beta of the Flash Player by checking the “about:plugins” URL in the browser.

Turkish Localization! … also Wmode, V4L2

There’s a new beta for Flash Player 10 (Astro) available for Windows, Mac, and — you guessed it — Linux. Go get it in the lab. This beta is a big deal since it finally contains an important, oft-requested feature. I refer of course to Turkish localization.

Adobe Flash Player - Turkish Localization

I’d like to give a shout out to my Turkish open source pal, İsmail. We didn’t forget about you!

Windowless Mode

Oh yeah, this beta also introduces some other features that may be of interest to some people. There’s this thing called windowless mode, a.k.a. wmode, a.k.a. transparency, a.k.a. proper stacking order, a.k.a. DHTML/JS menus unroll over a SWF vs. under, such as on the main Adobe website:

Adobe Flash Player - Windowless mode

A.k.a. fullscreen Flash overlay ads! Yes! They’re on Linux now. Let me tell you, I have never been so happy to see one as when I first got one to work in Linux. I suspect the novelty will wear off rather soon.

To be clear, there are 3 major modes for SWFs embedded in webpages: 1) Windowed mode, which is the only one supported by the Linux Flash Player up to this point; 2) windowless/transparent mode; 3) windowless/opaque mode. CommunityMX has this great, simple page that illustrates the differences between the 3 modes. (There are also 2 new wmodes introduced in Astro — direct and gpu — that are already supported in Linux where allowed by hardware.)

Thanks to both the Firefox and Opera teams for their support in implementing wmode. That’s right– this feature will work on both Firefox and Opera on Linux. For Firefox, you must have version 3. For Opera (as of this writing), you will need the latest beta of 9.50 Opera 9.50 release. Thanks also to Swfdec for implementing this feature concurrently, helping to attack wmode from many angles and bring Linux web browsing up to ~2002 standards.

Be advised that there are still some wmode-related problems, most notably this crash issue. Please report any other consistently crashing URLs.

Updated Camera Support (V4L2)

This Linux beta includes native support for the Video4Linux v2 (V4L2) camera API. When I started this journey 2 years ago, V4L2 was supposed to be the standard, but V4L1 still seemed to be used everywhere. The last 2 years have seen significant change in this regard and now V4L1 distros are nearly impossible to come by which, by extension, has made Flash’s camera support nigh useless on Linux. No more, since V4L2 is now supported. In fact, it is supported concurrently along with V4L1.

There is still some work to do on V4L2 and I will need some help with it. You might be able to help me with it, too. Details to come in a separate post.

Bonus! You can finally select from among multiple cameras installed on the system:

Flash camera select, localized in Swedish

Oh hey, the dialog is localized in another new language: Swedish. Which brings me to…

Extended Language Support

In addition to Turkish, there are other new languages supported too. The complete list is (alphabetically by language code): Czech, German, English, Spanish, French, Italian, Japanese, Korean, Dutch, Polish, Portuguese, Russian, Swedish, Turkish, and Chinese.

Speed and Stability

Additionally, we are also working hard on speed (using a number of quality Linux profiling tools to identify and optimize hot spots) and stability (boom). To that latter point, do you know my favorite kind of crash bugs? The ones that occur consistently on a particular URL. Please let me know about those. The less useful reports are the ones about purely random crashes. While those are definitely irritating, any programmer will tell you that such reports are not especially helpful. Identifying consistent crashes goes a long way towards addressing the more random crashes as well.

Go. Get testing.

Flash Uses The GPU

A much clamored-for feature (right after native 64-bit, wmode/transparency, and V4L2) is Flash GPU (graphical processing unit) acceleration, sometimes founded in a belief that it’s a magic solution for making things fast without any side effects or ill consequences. I just wanted to make it known that the Adobe Flash Player is GPU accelerated, even on Linux. However, this comes with some qualifications.

Starting in version 9.0.115.0, the Flash Player was able to display fullscreen content with GPU assistance. This is done via OpenGL facilities.

Starting in the most recent Astro Beta, Flash Player supports new GPU acceleration modes. This acceleration doesn’t automatically speed up legacy content. Instead, new SWF content has to be authored specifically to take advantage of this. Tinic Uro has an excellent overview of the capabilities and limitations of this new feature in his blog post, “What does GPU acceleration mean?”

Tinic’s post mentions the lofty GPU requirements for Windows: “You will need at least a DirectX 9 class card. We essentially have the exact same hardware requirements as Windows Vista with Aero Glass enabled.” Obviously, the Linux version isn’t going the DirectX route. It uses OpenGL and we require the following features before we consider honoring the new SWF GPU features:

  • GL_ARB_multitexture
  • GL_EXT_framebuffer_object
  • GL_ARB_shader_objects
  • GL_ARB_shading_language_100
  • GL_ARB_fragment_shader

Also, for fullscreen OpenGL acceleration, the Flash Player requires that the client glx vendor string be something besides “SGI”. Official drivers from, e.g., ATI and Nvidia hopefully do not have “SGI” in this field (check the ‘glxinfo’ command, for this string and for the extensions listed above). We have this logic in place to detect whether software rendering is in place and fall back on our own software fullscreen in that case. There are more robust ways to detect software rendering but we have seen crash problems on a number of distributions, possibly with outdated libraries.

Another important note: Compiz and GPU-accelerated Flash on Linux do not mix. The Flash Player still works if you have Compiz as your window manager; you just won’t be able to make use of GPU-accelerated features. This is a shame since Compiz is coming with the basic installation of various Linux distributions. Unfortunately, things get unstable when trying to do GPU acceleration in SWFs running under Compiz.

  • FAQ regarding hardware acceleration: Why doesn’t the Flash Player on Linux user the X video extension (Xv)?
  • Answer: Because Xv scales YUV data. Flash Player operates on RGB data.

For the uninitiated, many video codecs operate in a YUV colorspace. Unix/X11 has an extension called X video that allows hardware scaling of YUV images. This is a very mature system on Linux which has allowed seamless, low CPU usage, fullscreen video playback on Linux for many years. Unfortunately, the Flash Player can not easily make use of this since Sorenson, On2, or H.264 video data — even though it is decoded as YUV — has to be converted to RGB and possibly combined with other graphical elements. This is why RGB scaling via OpenGL is the future of Flash.

Except if Compiz is acting as window manager.

Astro Beta

We just released a public beta of the next Flash Player, version 10. As is now customary, Linux is invited to the cross-platform party and is available alongside the Mac and Windows binaries. Go get it here. And go report bugs here.

There are plenty of nifty new features covered in the labs link. More interesting for Linux users is that we have been addressing the graphical performance issues that manifesting starting in 9r115, the version where we had to rework the graphical system due to the new XEmbed support (trying to remember what that bought us… oh yeah: context menus consistent with the desktop). The key to performance? Move away from recommended APIs and use unrecommended ones (without resorting to deprecated APIs).

Anyway, I can certify that this version is notably faster. I have been testing the FP10 beta on my special profiling tool, a.k.a. Asus Eee PC. But I would still like to hear whether you experience measurable performance improvements as well.

License-Free Spec

Adobe is announcing the Open Screen Project today. The press release mentions that it deals with “driving rich Internet experiences across televisions, personal computers, mobile devices, and consumer electronics.” However, I can guarantee that the part of this announcement that will be of most interest to Linux/open source fans is likely to be these items:

  • Removing restrictions on use of the SWF and FLV/F4V specifications
  • Publishing the Adobe Flash® Cast™ protocol and the AMF protocol for robust data services

Note that this is not about open sourcing the Flash Player (although a non-negligible portion of the Flash Player code is already open source). However, the previous restriction that anyone who looks at the spec technically isn’t allowed to create an independent SWF decoder (if documentation EULAs are to be believed) was a point of contention among many open source types. No more click-through EULA embedded in the actual PDF, or so I’ve been reliably informed.

And if I can find the new documents (there’s the traditional SWF spec, while the FLV and new F4V formats have been split out into a new document) on the vast corporate website, I will be sure to link to them. I’m not even sure if they’re posted yet. But I’m sure my loyal readers will post links in the comments if they can locate them first.

Spring Security

Some visitors have gently proposed that I should make some blog post, if only to assure the community that the Adobe Flash Player for Linux is still very active. Besides, the previous post’s comment thread was growing a smidge unwieldy. Here’s a fresh new thread.

As many are already aware, there is a new version of Flash Player 9 available. This version is designated 9.0.124 and is available here (standalone Player available here). There are no major features to announce with this release; it’s a security fix. This is for your protection, cyber-citizen.

Also, I apologize that this release once again broke package management cryptographic checksums because the filename is the same as the previous release. I will rectify that for future releases.

You may be interested to learn that we just rolled out a new bug base: https://bugs.adobe.com/flashplayer/. This replaces the old wish form. Flash Player Project Manager Justin Everett-Church has more details about the new system. You can vote for your favorite bugs!

Flash Player 9 Update 3 (Final)

A new version of the Flash Player is available. To be specific, this is Adobe Flash Player 9 Update 3, version identifier 9,0,115,0. It is simultaneously available for Linux, Mac, and Windows. The Linux version, as with previous Linux versions, is presently x86_32 only.

This version includes the new Flash support for the standard H.264 and AAC codecs as well as hardware-accelerated fullscreen support (where supported by video hardware and drivers, and specified by a site’s SWF). This is also the first official Linux release to support the new XEmbed browser protocol which simply allows a browser plugin on Unix to behave better in a modern desktop environment.

Improvement over the string of beta releases: This new XEmbed-enabled plugin should work with Opera now.

Get it here (.tar.gz, .rpm, and YUM available).

Linux Flex

Adobe’s Flex Builder is coming to Linux. You can download the public alpha of the tool over on the appropriate labs page.

flex-icon.png

Flash Player 9 Update Release Candidate

A release candidate for Flash Player 9 Update is available for download on labs. Windows, Mac, and Linux, all at the same time.

Oh please, click bug, please be be gone!

Go get it. If you find problems, remember that this blog’s comment section is not the best place to report them. This is. Also, there are the forums.