Defusing one of the most annoying bugs in Ubuntu Hardy Heron: Stop Flash from killing Firefox
Using Hardy Heron for about 2 months, I'm happy to say that it's a great piece of software. Rock solid and with a lot of useful features.
Unfortunately, there's one really annoying bug:
If you start using Firefox 3 with Flash, odds are good that you'll experience Firefox crashing every few minutes while loading Flash. It seems Pulseaudio (Hardy's new sound system) is triggering a bug in Flashplayer, which causes Firefox to crash. Since Flash is closed-source software, there's no chance Ubuntu is able to fix the problem in time for Hardy Heron's release.
So here's how you work around the bug:
1) Current Ubuntu policy:
Package libflashsupport (which connects Flash to Pulseaudio) will no longer be installed as a dependency on flashplayer-nonfree. Without libflashsupport, Flashplayer directly sends it's audio to ALSA. This works great, as long as your sound card supports hardware mixing of multiple audio streams. If it doesn't, you'll get no sound at all from Flashplayer.
If you installed Hardy due it's beta cycle, you may want to remove libflashsupport and check if Flash stops crashing your Firefox.
sudo apt-get remove libflashsupport
2) Alternative workaround
Since my onboard sound card does not support hardware mixing, I was quite unsatisfied with the currect Ubuntu policy. I do understand that it's Adobe who needs to fix this bug, but the current workaround is hardly a "fix" for the problem.
He utilizes nspluginwrapper as a interface layer between libflashsupport and Pulseaudio. What makes it special, is that nspluginwrapper originally serves as a wrapper to include 32bit Flash into 64bit Firefox. It wasn't meant to run at 32bit Ubuntu, but it still works. To give proper credits: It seems this idea was born at the Fedora Project.
To use his work around, follow these steps:
1) Close Firefox
2) Install Conn's nspluginwrapper package
wget http://launchpadlibrarian.net/13470096/nspluginwrapper_0.9.91.5-2ubuntu2... dpkg -i nspluginwrapper_0.9.91.5-2ubuntu2_i386.deb
3) Remove flashplugin-nonfree
sudo apt-get remove --purge flashplugin-nonfree
4) Install flashplugin-nonfree again
sudo apt-get install flashplugin-nonfree
I had one Firefox crash since testing Conn's workaround, immediately after installing his package. Flash still crashs from time to time, immediately after starting a video for example. You'll be presented with a grey box where your video used to be, but you just need to reload the page to fix that problem. Not a single crash of Firefox since hours of testing.
Thanks for the great solution, Conn!
Update: If you're using Ubuntu for AMD64, you don't need the alternative workaround, since you're already running nspluginwrapper. One drawback: Scrolling over Flash with your mouse wheel no longer works. This was one great feature I will miss much. Let's hope Adobe fixes this bug ASAP.