Arch64, OSS and Flash

2009-01-02 by Bluewind

Some time ago Adobe finally brought the Flashplugin for 64-bit. To get sound working with OSS I had to use the ALSA-wrapper as described here. That worked well for some time, but around 2 or 3 weeks ago flash suddenly stopped working.

Every flash film was damn slow. It felt as if I was running on 100MHz or something. Maybe 1 picture every 5 seconds. Sound was a bit better, but out of sync and stopped sometimes. CPU usage was only 3% and atop nor iotop showed anything suspicious.

I didn't know why because I didn't upgrade anything nor did I change any config file. I googled a bit and asked around, but apparently nobody had a solution.

Then I just ignored that and today I wanted to try if it works again. So I went to youtube, disabled HQTube (A script to play youtube files in mplayer) and started a video. As you can imagine it still didn't work.

I asked the guys in #archlinux.de and we tried some things like adding a new user, using a different Browser, taking out some RAM because strace segfaulted with an error telling that the RAM was bad and finally installing a new system on a different HD.

There I installed everything needed to run Firefox with Flash and guess what. It worked! That meant that my hardware was actually okay so I rebooted the old system and tried to find the cause.

First I thought it might be uvesafb (which still doesn't work with widescreen resolutions). Then I tried using a new xorg.conf without the new fancy HAL stuff and starting X without slim.

Nothing helped and the guys in the IRC didn't have a clue either. But then I remembered that the second system, where flash worked, didn't have any sound. So I disabled OSS and tried again. Worked!! Suddenly I knew what was wrong:
I've set "vmix0-src" to "Production" because I read somewhere that it wouldn't take much CPU, but sound a bit better. Actually it didn't need more when running mplayer, mpd or vlc. Nevertheless I set it back to "Fast" and suddenly flash worked again.

That's really the strangest bug I've ever seen and I have a message for everyone who uses (only) the ALSA API in their programs:

Switch to OSS. It's better:

  • OSS wastes less ressources than ALSA.
  • OSS is able to let multiple programs use the same soundcard to output sound in parallel. ALSA needs an overlay (which again wastes ressources) to do that.

If you need more see here.

Special Thanks to IGProLin for telling me to install a second system.