Ten steps to make ALSA and Flash 9 beta work on Ubuntu

Update: I strongly recommend PulseAudio and the flashsupport-lib instead

Worked for me:

  1. Remove all leftovers from Flash 7, or other flash plugins, from the system:sudo aptitude remove flashplugin-nonfree flashplayer-mozilla libflash-mozplugin
    sudo rm /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/firefox/plugins/libflashplayer.so /usr/lib/mozilla-firefox/plugins/libflashplayer.so /opt/swiftfox/plugins/libflashplayer.so /opt/flash32/libflashplayer.so
  2. Remove all leftovers from Flash 7, or other flash plugins, from your home-dir:
    rm ~/.mozilla/plugins/libflashplayer.so
    rm ~/.firefox/plugins/libflashplayer.so
    rm ~/.mozilla-firefox/plugins/libflashplayer.so
  3. Start your browser, visit “about:plugins” and make sure that you have no flash-player installed. (It may alternatively appear as something with “SWF”). If neccessary, remove all files that is named something with “flash” from the directories where libflashplayer.so resided.
  4. Flash 9 can use Alsa instead of OSS, which is not only preferrable, but the only way I could make it work. Firefox/Swiftfox needs to be aware of this, and you can make it known by editing /etc/firefox/firefoxrc. Make sure that FIREFOX_DSP=”none”.
    gksudo gedit /etc/firefox/firefoxrc
  5. Get libflashplayer.so from Adobe by downloading and unpacking the file in one go:
    wget http://www.adobe.com/go/fp9_update_b1_installer_linuxplugin -O- | tar zxvf - --strip-components=1 --no-anchored libflashplayer.so
  6. Move the plugin to the Firefox-plugin-directory on the system:sudo mv libflashplayer.so /usr/lib/firefox/plugins/
  7. Link or copy the plugin to wherever else you wish to have it:sudo cp /usr/lib/firefox/plugins/libflashplayer.so /usr/lib/mozilla/plugins/
    sudo ln -s /usr/lib/firefox/plugins/libflashplayer.so /opt/swiftfox/plugins/
  8. Make sure Alsa is working, follow any tutorial on the web. If this command plays a sound, it works:ls -rS /usr/share/sounds/*.wav | tail -1 | xargs aplay
  9. Now, here’s the thing that took a lot of time for me to figure out. It’s not enough to make Alsa play sounds, it has to be configured so that the default Alsa-device and soundcard is the one you wish to play sound through. This may not be an issue for you if you only have one soundcard. Skype has (or had) the same problem as Flash here, so there are some tutorials in connection with Skype that might work for you. For me, it meant:- Commenting out the soundcard-module I didn’t want to be first from:
    /etc/modprobe.d/alsa-base(You can find the name of the modules for each soundcard with a combination of looking in /proc/asound, lspci, lsmod, dmesg and aplay -l)- Then adding the same soundcard-module to the bottom of /etc/modulesCheck that the soundcard you wish to play through is listed first with this command:cat /proc/asound/cards
    - Then, making sure that there weren’t any surprises in /etc/asound.conf or ~/.asoundrc.- And finally ending up with an ~/.asoundrc like this:

    pcm.lydkort0 {
    type hw
    card 0
    device 0
    }

    pcm.lydkort1 {
    type hw
    card 0
    device 1
    }

    pcm.flash {
    type plug
    slave.pcm "lydkort0"
    }

    pcm.!default {
    type plug
    slave.pcm "flash"
    }

    “lydkort” is Norwegian for “soundcard”, you can change the name as you like. This file probably won’t work for you if you’ve got a different setup from me, but it might be a starting-point for editing the file. The “!default”-name is essential, however, and if you change “flash”, remember to change it both places. aplay -d and aplay -D are great for checking some of the settings. You could sudo mv .asoundrc /etc/asound.conf when you’re happy with the settings.

  10. Now, if Alsa works, .asoundrc is correct and all the planets in our solar-system are lined up correctly, you can start Firefox, and both Flash 9 and Alsa-sound will work. You should also double-check with “about:plugins”. At least, it finally worked here. Hopefully you’ll make it work in a shorter amount of time than myself. If it doesn’t, you could always install Flash 7 again, and run Firefox with the FIREFOX_DSP=”aoss”-setting. Good luck to you. :-)

A possibly handy Python-script

Become more organized

Often times, I download files with the handy and good-looking Download Statusbar Firefox-extension. I’ve configured it so that they end up right in my “download” directory, which resides in my home-directory. These files often end with zip, tbz2, tgz, tar.bz2 or tar.gz, and I just want to check out what’s in them in an easy way, on the commandline.

I don’t want to click buttons in a GUI like Ark or File-roller, and I don’t wish to move around with cd and type tar zxvf myfile.tgz. Even worse, sometimes archives do not create their own directories, which creates a random mess in one of my directories. (The horror!)

As a solution to this, I created a Python-script that works for me ™. It has two directories pre-defined in the source, one which is the download-directory and one which is the directory where it should unpack it’s own directory (it’s easy to change these in the sourcefile if you’re unhappy with ~/download and ~/utpakk).

At invokation, it untars/unzips the latest downloaded file. It’s still in version 0.1, but it might work for you too. Please let me know if it’s not crossplattform enough, or if I should try to support an even earlier version of Python. (Tested with Python 2.3.4). I have it in my PATH, with the +x, which makes for easy access. Hope it’s of some use to someone. If the last file downloaded isn’t a supported archive, it will give an “Unknown filetype”-message. If you wish to extract a file that isn’t currently the latest one, you can touch it with “touch”.

Here it is.

My first cartoonstrip

Eating at uni

Recently, I was asked what I would do if I died in a month. The “usual” question is what you would do if you died in a day, and then you wouldn’t have had much time for anything, really. But in a month…?

Since then, I have asked two friends of mine, and they both (independently) answered that they would make as many children as possible.

Anyways, the first thought that popped up in my head, was that I should bother the world with some of my creative whims. So, here’s my first cartoonstrip (”Eating at uni”).

Good or bad, please comment.

Erlang The Movie

Ericsson

Enjoy this timeless video, containing swedish computer-scientists from the 80’s. It’s unspeakably brilliant, if you like the retro-style half as much as I do! Here it is: Erlang The Movie

Emotional intensity

Emotional intensity

After reading lots of news on the web, I get the impression that many companies and organizations are happy if they make, say, 87% of their users content. This is evident by the (luckily declining) amount of webpages that are specially made for Internet Explorer, Macromedia Flash (now pwned by Adobe) or some weirdo-ActiveX-plugin.

Now, if you only knew three people in the whole world, would you be fine if two of them liked you and one of them hated you intensely? Well, 66% of them are content, so you should be fine, right? Even though the third is a bloodthirsty maniac? Right?

Okay, so the point I’m trying to make here, is that companies and organizations should start worrying about, not only marketshare, but to what degree people like them. A small community of people that absolutely adore their operating system, can achieve huge things. And similarly, a huge company with a bunch of users that just-don’t-care, doesn’t get much help from them.

Here, let me write it down as an equation. If it’s mathematics, it must be true:


heartshare = love * marketshare

I think Microsoft has been exceptionally bad at recognizing heartshare, ignoring users for years, while Google has been exceptionally good at it. This summer, Google is using $3.15 million dollars on Summer of Code, which is all a pure investment in heartshare. Summer of Code is a marvelous concept, where students get paid by Google for developing open source software. We get free software, students get paid training, Google gets an overview of future employees and tons of heartshare. 4x win.

It is also seen over an over again through history, how a relatively small group of people with intense emotions, can change systems or overcome large groups of people. Plus, those who gives shall receive, which is echoed in all major religions I know of.

Marketshare isn’t all, remember the heartshare!

Throwies

Throwies

After following a link from Popurls, my favorite page on the Internet, I arrived at a mighty fine page that has instructions for all sorts of interesting projects. One of the projects were throwies. Although I’ve heard about throwies before, this time around, it really struck a chord with my inner need for decorating my surroundings with leds.

About programming

The Killer Rabbit

Many programmers learn a lot of different languages. One common route is to start out with Basic, go through Pascal, Assembly and/or C, perhaps using some C++, doing some Java, looking into some Python/Ruby/Perl/PHP and end up hopping between languages like a linguistical killer rabbit. I might admit to being one of those. Boo, Nemerle, C# and especially Python were my latest victims. The great thing about Python, is the freedom to express things quickly. Need a new class? Two words and a colon, done. A full program? “print ‘Hello World’”, done.


"Static is the new dynamic"

Unfortunately, this expressive dynamism comes at a cost, which is paid back by writing code that tests if your code actually does what it’s supposed to. You don’t have to write tests, but it’s a common practice of all serious companies I know of that uses Python. So, when all comes to all, you still have to write code both for actually doing stuff, and for making sure it’s doing the right thing. Which is no different from using an ordinary statically typed language, which were used long before Python.

But, what does it all mean? It means that static is the new dynamic, and this is also where Haskell enters the picture. Haskell suddenly became the coolest language around, at least in my sparkling killer-rabbit-eyes. As an added bonus, Haskell is a lot quicker than Python, can be compiled to native executables, can be analyzed mathematically, if you’re so inclined, and mixes in the imperative style of writing code, in a beautiful functional way. And unlike LISP, you can actually use it for something (a big “sorry” to the seven LISP-fanatics out there). Unlike Python, fullscreen graphics (with OpenGL) is included by default, it’s not an extra package. And have you seen quicksort implemented in Haskell? It’s two beautiful lines of code, not a gazillion. No wonder Linspire is standardizing on Haskell.

Am I pulling all this out of my killer-rabbit-ass? No. Here’s a post I found about why Haskell is the language for 2010. And Tom Sweeny of Epic games has a well-resoned presentation where he talks about the next mainstream programming language, from a game developer’s perspective. Furthermore, if you’re into mathmatics, here are eleven reasons for using Haskell.

In a world of parallelism, which we are heading into with full speed, where it’s better to do things right the first time instead of writing tests all over the place, Haskell really shines. So this is why Haskell is my next victim.

Trends

Trends

After seeing The Postal Service with “Such Great Heights” at the Last.fm charts, I made a mental note about them. So, after finding them on Telemusicvision in Democracy Player, I was grateful to get hold of the video – it’s a masterpiece. So is this.

If you ever try out Democracy Player, I recommend watching Diggnation, which is a Wayne’s world-ish, technical, funny and insightful videoblog, by the people behind the popular community-driven Digg.com website. Mind that you might need the SVN-version of Democracy Player if you’re on *nux (aka GNU/Linux or friends).

When it comes to *nux, Planeshift and Nexuiz actually worked for me this time, which is new. Nexuiz is a very smooth FPS, and gives me the same feeling as when I first became hooked on a FPS. Planeshift, which is a MMORPG, is cool too, I met this guy who was very friendly, gave me a guided introduction and invited me to apply for a membership in the strangely named Woiperdinger guild. It turned out that Woiperdinger is some sort of German fantasy animal, also called Wolpertinger. I’m really impressed with how far open source gaming has came. Almost all the classics are cloned now, including Sim City, so I think we’ll see a wave of innovation, which I’m looking forward to.

I really wish there was an open-source clone of CGoban2, though. I’ve actually started writing a clone in C#/Mono, and made the client/server-part work, but I need some motivational help here. For the record, I don’t play games anymore, in fear of becoming hooked, but I like to keep up with the tech.


"Almost all the classics are cloned now"

Oh, and Firefox and Xubuntu are still cool, but TA Spring and Klik still doesn’t work for me. Looking at some bug-statistics, I wonder if the ratio of old bugs to new bugs is a good measurement for the quality of a program. Probably not.

On the spiritual side of things, I’m very fascinated with Shikantaza – a way of meditating by just sitting – and nothing else. I like this kind of Zen. Oh, and they’ve finally managed to get a camel through the eye of a needle.

In other news, I found four rising trends on Google’s newly released Trend-page. And the wonderful Reddit.com showed us all some surprising statistics. Well, not really.

That’s all for now. Be well!

Xubuntu

Screnshot

I’ve recently insalled the wonderful Xubuntu. It installed nicely, looks good and works well.

Xfce is the default desktop-system, and an incredibly nice one at that, but I would never leave my trusted Fvwm, with all those nice keybindings. Setting up Fvwm is more like writing an application than configuring options, but after a few years perfecting it, you’ll love it. Guranteed!

The image above is from my desktop, running Fvwm, with a background from Xfce. I usually have one borderless window per desktop, but for the occation, I moved all my windows to one desktop, resized them a bit and pressed the hotkey to turn on Mac-ish windowdecorations.

Here’s a list of my favorite programs for X: aterm, xclock, fvwm, firefox, thunderbird, xchat, and gvim. For graphics, inkscape, gimp, blender, wings3d and mtpaint are great.


"Popurls is worth a daily visit"

And here’s a list of my Firefox-extensions: Adblock, Crash Recovery, Download Statusbar, Fission, FoxClocks, Greasemonkey, MenuX, PDF Download, Sage, Sidebar on Right, Sourceforge Direct Download, Stop-or-Reload Button, NextPlease, Mouse Gestures, Tab Mix Plus, Reveal, Organize Status Bar, Paragrasp, CuteMenus 2 and Flashblock. These are all very good.

Phew. That’s enough listings for today. If you want something less nerdy, and far cooler, try the very cool Popurls. It’s actually so nice that I visit it semidaily, instead of reading RSS. Popurls is worth a daily visit.

A flashback to 1992

Win31

This site offers a mini-version of “good old” (ahem) Windows 3.1. It’s the size of a floppy, and runs beautifully in Qemu! If you wish to emulate other operating systems, Qemu is my first choice. Wine, Bochs and Dosemu can be a bit of a hassle. If you intend to play old DOS-games, I would highly recommend Dosbox and ScummVM, as they both work really well.

I’ve made a recepie for trying out Win3.1 under Qemu. I’m using Debian GNU/Linux, but I think it should work on other operating systems as well. Here goes:

1. Download this file
2. Unzip the file
3. Rename pcdosmw.VFD to win31.img (not strictly necessary, but I think it’s nicer)
4. Run qemu from the commandline like this: qemu -fda win31.img
5. Tahdah! Flashback to 1992!

Now, it will be fun to see if Win32s (32-bit support for Windows 3.1) will install.

Update:
* I had no luck with Win32s, as it is supported by Windows 3.11, but not by Windows 3.1.
* You can share a folder between your system and the system you are emulating by using this commandline: qemu -boot a -fda win31.img -hda fat:rw:myfolder
* Yes, I own the original version of Windows 3.1. It’s on a floppy or four somewhere in my old collection of computer treasures