Showing posts with label compaq mini. Show all posts
Showing posts with label compaq mini. Show all posts

Monday, 7 September 2009

Ethernet in Compaq Mini 700

As noted below, I have a Compaq Mini 700. It is a great little machine, useful keyboard, good screen, plenty of storage and decent battery life. I just use it with my wireless connection at home, and it works flawlessly.

In the office though, I appear to sit in a wireless dead sport, which obliges me to use an ethernet cable to get access to the network.

In a spirited attempt to bring some unpredictability and surprise to my life, plugging in the ethernet cable does nothing, while unplugging the cable instantly crashes the whole machine. Genius, absolute genius. Apparently, what you need to do, is plug the cable in, turn on the machine, use the network connection, turn off the machine and THEN unplug the cable. Oh, unless you have the power cable plugged in, in which case it won't instantly crash when you unplug the cable, but it still won't work when you plug it in when on.

This is, of course, all designed to make me swear and throw the machine out of the window, at one stroke invalidating the warranty AND increasing Compaq's profits when I go to buy another one.

It turns out there is an actual proper solution to this problem. You need to tell the operating system that it can use acpi. Or that acpi can use the OS. Or something to do with acpi anyway; the whole thing is as transparent as a foot thick sheet of fucking lead. Whatever it is you need to do you do it by adding a setting to your boot configuration. You need to run this command:

sudo cp /boot/grub/menu.lst /boot/grub/menu.backupincasethisfuckseverythingup
sudo gedit /boot/grub/menu.lst
You then look for this section, about halfway down the file:
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=long-string-of-letters-and-numbers ro
What you want to do to fix the problem is to make the last line of this section look like this:
# kopt=root=UUID=long-string-of-letters-and-numbers ro acpi_os_name=Linux
The reason you do this is because ubuntu gets clever when it updates its kernel. It also re-writes the menu.lst file. If you just went through this list and changed the ACTUAL kernel settings then this fix would work. Until you downloaded a kernel update at which point it would instantly fubar. Having made the change to the default options section, you can force a rebuild of the menu.lst by using this command:
sudo update-grub
Now, even if the kernel is updated the acpi (whatever that is) change will remain in place. Once you reboot your machine, you will find the ethernet cable slips in and out easier than some disgusting sexual metaphor.

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.