How to upgrade ALSA – The Easy Way

22 03 2009

I got recently pissed off by a major defect occurred to my system. All of a sudden the headphones just stopped working. Actually their behaviour is quite weird: once I plug the headphones the sound is fed for about one sec and then it just die. This is one of those bugs which make you willing to swear as they affect one basic feature you may or may not want to part from.

I already tried to follow some advices dug out from some forums and went rotten (lame of me I admit it). I basically tried to remove all ALSA packages to reinstall them from scratch, and this caused a system crash and, God knows why, the X user settings to be wiped off.

After reinstalling Ubuntu Intrepid I tried another approach to simply upgrade ALSA in the hope of solving my problem. Well, this hasn’t but maybe you can find anyway interesting this simple method to upgrade ALSA to the latest version.

This Soundcheck guy made a script to easily retrive and install the latest ALSA driver. The script and discussion are located in this thread on Ununtu forums but I will report the instructions here for convenience.

First, let’s introduce ALSA by reading a brief description directly from the website of the project.

The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI functionality to the Linux operating system. ALSA has the following significant features:

* Efficient support for all types of audio interfaces, from consumer sound cards to professional multichannel audio interfaces.
* Fully modularized sound drivers.
* SMP and thread-safe design.
* User space library (alsa-lib) to simplify application programming and provide higher level functionality.
* Support for the older Open Sound System (OSS) API, providing binary compatibility for most OSS programs.

Now let’s go on with the instruction to upgrade the driver to the latest version.

Important Note: please before updating ALSA consider the reason you’re doing it it’s important, make a beckup of your files (you never know) and read carefully the thread I mentioned above. The script author says that he wrote it to be as fail safe as possible but given that it will affect low level packages please be sure you know you’re doing it at your own risk.

  1. First you must download the script which can be found somewhere at the bottom of the thread or here. Note that you must register to Ubuntu forums to download the script.
  2. Save the script in your /home or wherever you like and untar it either with File Roller or Ark, or with tar xvf AlsaUpgrade-1.0.x-rev-1.16.tar from a terminal
  3. If you haven’t done yet, open a terminal and move to the script location with cd [download directory]
  4. Type sudo ./AlsaUpgrade-1.0.x-rev-1.16.sh
  5. On the first run the script will present all the options you can select when running it for actually doing its job.
  6. To download, compile and install the packages on a single pass type sudo ./AlsaUpgrade-1.0.x-rev-1.16.sh -di Note: -di is the option to do so but there are many more to suit your needs
  7. Wait for a fifteen minutes and then reboot
  8. Have fun with your freshly updated ALSA driver




How I messed up my laptop with Kubuntu 8.10 KDE 4.2

18 03 2009

I’m a Linux user since Ubuntu 7.10 “Gutsy Gibbons”, then we can say I’m quite a freshman.

I took the decision to migrate my XP laptop to Linux mostly because I wanted to sail new waters after being a MS user since MS-DOS 5.0.

Until now I must say that my experience was pretty positive. I had no major problems switching to a new system. I found substitutes for most of the software I was used to and for those few I didn’t find an alternative, I relied on VirtualBox OSE and my old XP home edition. I was quite impressed by the stability and safety of the system. My laptop and me experienced a new speed we weren’t accustomed to. The only thing made me a bit crazy was the impossibility to run the composite manager with application based on OpenGL or which worked with video rendering (basically Google Earth and VLC for watching videos). I understood that this was because of my ATI video card yet I was disappointed by the fact that the situation remained always the same either with Hardy and lately with Intrepid.

With the advent of the 8.10 “Intrepid Ibex” release I decided to try again something new and switched to the Kubuntu fork. At the beginning I felt both dizzy and bewildered by the KDE4 environment. It took me some times to get somewhat accustomed to the new desktop manager which sets a complete new concept of user interface. The learning curve wasn’t so flat but I judged the worth the effort. On the other face of the coin the stability of the system was terrible. Panels got messed up once in a while causing me to swear first and sweat after to get everything in place. Contextual menu were sometimes weird (I couldn’t open a pdf from the web on the fly but was forced to download and open it after), the ark tool won’t compress -it didn’t see them- some kind of files (like pdf) and folders, trying to erase a file caused the system to drain an insane amount of resources without apparent reason (but pressing shift+canc didn’t), etc… With KDE4.2 version things im proved quite much and this was a great relief. However something dark was coming

Out of the blue the headphones just stopped working. The weird was that by inserting the jack I got the feed for about one sec and then all went silent. After searching forums I did understand that the problem was probably related to ALSA and they advised to uninstall it and recompile. You know how it is when you happen to have an uncommon problem; the resources are few and often contrasting. As I said I’m a freshman and what is worse, a freshman without the time and will to learn bash and compiling and stuff the way I used to enjoy with MS-DOS when I was a teen. So I did what I usually do when I don’t know where to slam my head against what in Linux. I opened Adept and looked for ALSA related package. And I had the great idea to uninstall one package (probably libasound-2, or alsa-base). The computer crashed and I was forced to restart. Guess what it happened when I tried to access to my user session again? See below…

dscn0787

Then I got scared. The computer was full of documents, all expendable except the fact I had a big bunch of new pictures of my son I didn’t backuped. I was cold sweating and already thinking of my wife chasing me down like Sauron with the Fellowship of the Ring, except I wasn’t likely to make it… I accessed my user from console to try to backup the pictures directory by cp-ing it to the external drive. But I could find the external drive in the /media directory and all my attempts to mount it were a failure. At this point I booted from the live cd and managed to have access to the folder and copy it to a safe location. At least I managed to sleep that night…

The day after (which is two days ago) I wiped the hard disk and installed Ubuntu 8.10 which is now running onto my laptop. I enjoy a immediate feel of improved stability and boosted speed. However the headphones problem keeps on haunting me!

I’ve grown loving Linux but there are things that really piss me off. I worship over all the concept of ergonomics and elegance in all human manufactured products, so also for what concerns software. In their way the distros I used are ergonomic and elegant but there are a few things I can’t stand. Installing new software is a completely insane process. Left behind the add/remove tool, all what remains is chaos. Sometimes you just download a software from a website, double click and it installs and goes into the right place of the menu (Truecryp on Ubuntu). Sometimes you download it and then you must go and search for instructions to install it, copy&paste those on the terminal and that’s it (Google Earth) but then how you uninstall it?? Sometimes you must add the repositories and, if you’re lucky, the software get installed without issues and goes in the right menu place. Some other times you must mess with bash to copy files to some root place with sudo etc… As far as I’m concerned this is something crazy and one of the things which keeps new user at bay from say Ubuntu. Nowadays many people are willing and able to search the internet for open source alternative software, but how many of them can or want to the same to learn how to install it? Again, let’s be frank, apart from the add/remove and, in a shorter range, synaptic, tool it needs a super user to install software on Ubuntu.

Anyway I could stand all this installation matter and bound to let’s time be my teacher. The headphones trouble is though something completely unacceptable. We’re speaking of a pretty basic function and a priority one. I will probably take my time and try some solution in a protected environment like VirtualBox but again this takes time and to me it’s really a pain in the rear to waste a lot of time trying to solve this headphones related issue!

I won’t surely go back to Windows, but I’m looking forward an iMac as my next computer.