July 24, 2008

Using Adobe Flash and other 32-bit applications on 64-bit Linux

Author: Edward Amsden

64-bit computing is as prevalent today as multicore computing. Almost any new processor from Intel or AMD has the AMD long mode extensions, allowing the processor to use 64-bit registers. While 32-bit processors can address 4 gigabytes of RAM, a 64-bit processor can address 16 exabytes, or almost 17.2 billion gigabytes, of RAM. Most 64-bit-capable computers aren't making use of these capabilities, but instead are put to work running 32-bit operating systems, usually because of a lack of applications for 64-bit operating systems, since applications must be recompiled and in some cases rewritten for 64-bit operation. It is possible, however, to run 32-bit Linux binaries natively under 64-bit Linux kernels.

Here's a look at three cases where running 32-bit applications on 64-bit hardware can accomplish what you need. The commands in this article are for Ubuntu 8.04, but the software described should work for any Debian-based 64-bit Linux distribution.

Being a technology enthusiast, I decided to install the 64-bit version of Ubuntu on my new Toshiba laptop, equipped with an AMD Turion 64 X2 dual core processor. Most of the applications in Ubuntu's repositories have been recompiled for 64-bit support, so productivity is not a problem. Even the restricted drivers, such as the ATI frglx and the Atheros MadWifi drivers, came precompiled. I was writing documents, browsing the Web, chatting with Ekiga, and listening to music almost as soon as Ubuntu was installed. The joyride came to an end when I tried to find a video for one of my favorite new songs on YouTube. Apparently, the only plugin available for Flash video was the open source player Gnash, but it would not even display the YouTube video player.

Since I am also a (very amateur) musician, I also wanted to install one of my favorite software synthesizers, RTSynth, a physical modeling synthesizer which, alas, is free only as in beer because of concerns over patents on physical modeling. It is available as a binary only for 32-bit Linux. Normally I would set up a virtual machine for such a "problem program," but none of the virtual machine applications that run on today's hardware can meet the processing and latency requirements for sound work (especially physical modeling).

Where I live, we have a saying: "If you don't like our weather, stick around a few minutes, it'll change." Since our weather is so variable, we depend on weather radar more than forecasting for scheduling events affected by weather. The National Weather Service has looping weather radar pages that show the movement of storms and rain. These pages require Java, and Sun, like Adobe, is rather tardy about supporting 64-bit computers. In fact, Sun's Java doesn't even work with the plugin wrapper we will use for Flash. The good news is, Sun doesn't have the only the Java Runtime Environment (JRE) on the block.

32-bit binaries

As it turns out, the good people of Debian (on which Ubuntu is based) have already solved the problem of running 32-bit binaries on 64-bit Linux. The IA32 libraries provide everything you need to run 32-bit binaries. The command sudo apt-get install ia32-libs will install the libraries. If you get an error about an asound library being uninstallable, you should be able to fix it with the command sudo apt-get install libasound2=1.0.15-3ubuntu4.

That's it! Your 32-bit binaries and any included libraries should now be functional. As a test, I fired up QJackCTL, VKeyBD, aconnectgui (all native 64-bit applications), and the JACK version of RTSynth. After hooking up the outputs in QJackCTL and the MIDI from VKeyBD to RTSynth in aconnectgui, I was able to play a wonderful-sounding guitar from my keyboard. The 32-bit binary RTSynth interacted flawlessly with the native 64-bit programs.

Flash video the Adobe way

All well and good; I can get a relatively obscure, special-use binary to run natively on my system -- but how about that killer app of internet multimedia, Adobe Flash? The developers of the open source Gnash Flash player have been working in the dark for most of the project's life. The Flash Video and SWF container specifications were only just released, and Gnash has not yet had the time to make full use of the information. A key piece of the Flash specification, ActionScript, remains unreleased. For everyday use, we still need Adobe's Flash plugin. Yet even with the 32-bit libraries mentioned above, Flash will not install in Firefox.

The answer is a handy little tool called nspluginwrapper that installs under the 64-bit version of Firefox and can run the 32-bit version of Flash. To get Flash working, install the IA32 libraries and remove Gnash if it is installed:

sudo apt-get remove gnash

Install nspluginwrapper and Flash 9:

sudo apt-get install nspluginwrapper flashplugin-nonfree lib32nss-mdns

Flash 9 is not packaged, but the package installer script will fetch it from Adobe's download site and install it. Now simply install nspluginwrapper as a Firefox plugin:

sudo ln -sf /usr/lib/nspluginwrapper/plugins/npwrapper.libflashplayer.so /usr/lib/firefox-addons/plugins/
sudo ln -sf /usr/lib/nspluginwrapper/plugins/npwrapper.libflashplayer.so /usr/lib/firefox-3.0/plugins/

After restarting Firefox, you should have the Flash 9 plugin installed and working properly. Surf to YouTube or Google Video and find something interesting to watch.

Which Java?

And finally we have Java, the "write once, run anywhere" language that brought us our first taste of client-side Web interactivity. Sadly, Sun doesn't seem to think "anywhere" includes 64-bit machines, at least for Web applets. Sun's JRE is available for 64-bit Linux, but does not include a working browser plugin. However, the IcedTea Java plugin will run under 64-bit Linux. The following commands will install the IcedTea plugin for Firefox:

sudo apt-get install icedtea-java7-plugin
sudo ln -sf /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/gcjwebplugin.so /usr/lib/firefox/plugins

Again, you will have to restart Firefox for the plugin installation to take effect. You should then be able to utilize Java applets in any Web page. For a test, visit the National Weather Service and watch the weather over Ohio.

"4 gigabytes should be enough for anybody!"

64-bit processors, operating systems, and applications are the immediate future of personal and business computing. However, most of the applications we use, as well as most of the platforms on which the modern Internet was built, were developed on and written for 32-bit computers, and not all of them have been or will be ported to 64-bit operating systems. In this area, Linux has met the challenge of backwards compatibility well, and has managed to avoid the usual annoyances that plague legacy application support. If you have been waiting to move to a 64-bit operating system because of lack of Flash support or issues with another 32-bit-only Linux application, you can now easily support that application alongside the rest of your better-performing 64-bit native applications.


  • Desktop Software
  • Internet & WWW
Click Here!