Flash 9 sound on 64-bit Gentoo Linux

I recently blew away my completely setup Gentoo desktop when I decided I needed to rebuild on a new RAID5 array. This meant that I got go through the entire Gentoo install, build, and configuration process from scratch, after not having had to do it for ages. I also took the opportunity to use LVM2 this time around, which I'll probably write about in a future post.

Either the Gentoo process has gotten much easier or I've gotten much better with Gentoo. It was a fairly painless install, and it turned out my only real hiccup was getting flash9 to output sound to ALSA. I knew I had correctly installed ALSA since all my other ALSA applications output sound perfectly - Amarok, Kaffeine, and even aplay from the CLI. I also knew that Flash9 was completely ALSA based instead of OSS, so as long as other ALSA apps were playing, Flash9 should be playing. After a day of thinking about it, I gave up and visited #alsa on freenode.

Adobe only supplies flash as a 32-bit binary, so running it on my 64-bit Gentoo system meant I had to either use net-www/nspluginwrapper in 64-bit Firefox or install it on 32-bit firefox. Gentoo supplies a 32-bit FF package called www-client/firefox-bin that works well on 64-bit environments and allows for native 32-bit plugins, so this is what I use. Well, on my previous install (before I wiped the disk) this 32-bit FF combined with flash9 worked beautifully, and I was able to browse Youtube all day long in full multi-media glory. However, this time around it would play the video without sound. I couldn't get any flash based audio to work - last.fm, pandora, youtube, etc.

It turns out the problem was an oversight on my part. Since the plugin and browser are 32-bit and my ALSA was natively compiled at 64-bit, the two couldn't really talk to each other. I just had to do a simple

```bashemerge -av app-emulation/emul-linux-x86-soundlibs```

After that, a restart of ALSA and Firefox, and I was back to full flash9 sound. Flash 9 beta two works very well under Gentoo, by the way.

For those curious, here are my system specs and a quick How-To:

  • AMD Opteron 165 @ 2.3ghz
  • Asus A8N-SLI Premium
  • SB Live! Value sound card
  • 64-bit Gentoo Linux

If you choose to install ALSA as a module rather than in-kernel, in /etc/make.conf:

```bashALSA_CARDS="emu10k1"``` Replace emu10k1 with whatever the ALSA module for your card is. Check the ALSA list for what works for your hardware. Then 'emerge alsa-utils alsa-oss alsa-lib alsa-driver app-emulation/emul-linux-x86-soundlibs'.

My /etc/modules.d/alsa:

```bash alias char-major-116 snd alias char-major-14 soundcore

alias snd-card-0 snd-emu10k1 alias sound-slot-0 snd-card-0

alias sound-service-0-0 snd-mixer-oss alias sound-service-0-1 snd-seq-oss alias sound-service-0-3 snd-pcm-oss alias sound-service-0-8 snd-seq-oss alias sound-service-0-12 snd-pcm-oss

alias /dev/dsp snd-pcm-oss

options snd cards_limit=1

Add 'snd-emu10k1' to your /etc/modules.autoload.d/kernel-2.6.  Make sure you do a 'modules-update -f' followed by a restart of alsa '/etc/init.d/alsasound restart'.  You should be good to go.<br /></p>