Saturday 5 September 2009

Compaq Mini 700 Sound in Ubuntu Jaunty

I also have a Compaq Mini 700 netbook, which is for all practical intents and purposes that same as the HP Mini 1000.

So I installed Ubuntu Jaunty on this machine. Thankfully the network card either doesn't use firmware, or the firmware is open sourced, because the networking functioned out of the box. I therefore did not have to go through the will sapping sequence of steps outlined in earlier posts just to get the damn thing working.

Woo, and if I may add, Hoo.

Until that is, I tried to play some sounds. Nothing, no noise, just nothing. Oh, for fucks sake, why is nothing ever simple. Right, time to roll up my sleeves.

It turns out that ALSA version 1.0.18, which is the version used in Jaunty, does not support the speakers on the Compaq Mini. This is particularly frustrating, because version 1.0.17, such as used in Ubuntu Intrepid, does support the speakers. Yes, let's advance our software by removing functionality, fucking spiffing. You can check if you have this problem; stick some headphones in the machine, if you get sound from the headphones but not the speaker, congratulations.

To fix this delightful issue, you need to install ALSA 1.0.19. Will Ubuntu let you do this automatically? No. As far as I can see at this stage, you have three options.

Option A.
Download the source code for ALSA 1.0.19 or later and build the software from source EVERYTIME AN AUTOMATIC UPDATE FUCKS WITH THE SOUNDS SETTINGS.

Option B.
Use a handy PPA which does Option A for you automatically.

Option C.
Shake your head in disbelief and take up basket weaving as a hobby instead.

As you may have guessed, I plumped for Option B. I tried Option A, but then I have also tried amateur fire-breathing and I found it about as painful.

Step One.
So to get the bloody sound working, open a terminal and type, or paste the following into it:
echo 'deb http://ppa.launchpad.net/minichoco-team/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/minichoco-team/ppa/ubuntu jaunty main' | sudo tee -a /etc/apt/sources.list
Your sources.list is a text file which has a list of internet places where Ubuntu can download system files. This command adds a PPA to this list. This is a non-official source of ubuntu software, but which can now be accessed automatically.

Step Two.
Get the Ubuntu Package management software to speak to the PPA by running the following commands in a terminal:
sudo apt-get update
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 9220067F
sudo apt-get update
sudo apt-get upgrade
Step Three.
Install the source code for ALSA 1.0.19 by running the following command:
sudo apt-get install alsa-source module-assistant
Step Four.
You only have an intel sound card in your Compaq/HP mini don't you? You don't need the flexibility of running any soundcard under the sun in your tiny netbook do you? No. Tell the configuration file for ALSA this by editing it:
gksudo gedit  /etc/alsa/alsa-source.conf 
On line 11 you make it read ALSA_CARDS="hda-intel" rather than ALSA_CARDS="all". You do not have to do this, it just speeds the whole thing up. If you enjoy watching progress bars crawl across the screen, or this sounds a bit scary, then ignore this step altogether.

Step Five.
Compile the ALSA Source code. Sounds scary doesn't it? Nah, just run this command in a terminal:
sudo m-a a-i alsa-source
This uses the [m]odule-[a]ssistant program to [a]uto-[i]install the ALSA source code for your current kernel. The beauty of this is that if an update fucks up your sound again, you just rerun this command, and it will work again. That's considerably easier than fucking about with make, make install, every time you do an update.

Step Six.
Restart ALSA to run 1.0.19 rather than 1.0.18, by either rebooting or running this in a terminal:
sudo alsa force-reload
Step Seven.
Don't you just love it when you sweat blood through six steps like we have just done, only to find that the OS then mutes your speakers everytime you log in. Delightful isn't it. What, you mean you don't like that? Well, picky, just edit your rc.local file by running this command:
gksudo gedit /etc/rc.local
And add this text before the line reading exit(0):
amixer set Speaker unmute
amixer set Speaker 100%
amixer set 'PC Beep' mute
amixer set Master 70%
rc.local is a list of commands run when the system boots, not unlike the old autoexec.bat file in DOS. amixer is a command line utility which is used to change the sound settings. This means that you could run the above commands quite happily in a terminal. Putting them in rc.local just means that they run everytime you start the machine. If you need an explanation of the complicated tech-speak options which follow the 'amixer' command above, then I am afraid you are too stupid to own a computer. Take it back to the shop.

No comments:

Post a Comment