[philiptellis] /bb|[^b]{2}/
Never stop Grokking


Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Saturday, December 06, 2008

Installing linux on the Acer Extensa 4630Z

Up front - if you haven't purchased this laptop yet, then stop now and look for a different brand. The Acer Extensa 4630Z has a great webcam, but will take you through hell when you try to install linux on it.

My tests were with Fedora Core 9, because that's all that I had with me. I may have had better luck with FC10 or Ubuntu, but I do not have those CDs with me, and I have a really slow network connection, so downloading it is not an option.

If you've already bought this laptop, then this post will probably help you out with finding some of the drivers.

First off, the keyboard has some extra keys for the Euro and dollar. These are just above the cursor keys, but I haven't yet figured out the keyboard layout to use them, so forget about that.

The trackpad is standard, but you cannot tap on it - at least the default driver on Fedora won't let you. I tried adding a section to my xorg.conf for the touchpad, but that only slowed it down a lot.

Now the problems.

The laptop has two switches - one for the bluetooth antenna and one for the wifi antenna. The bluetooth switch directly controls the bluetooth antenna, but the wifi switch is just a simple key that triggers an event and it is up to the wifi driver to deal with that. It took me a while to figure this out, since the driver for the wifi card isn't installed by default on FC9. I spent a lot of time playing with acerhk to enable the card, but I guess that isn't needed. If you do use acerhk though, the series id is 3000.

The wifi card has the Atheros AR5B91 chipset. This is chipset isn't listed on the Atheros website or the various linux driver pages, don't be confused by that. The device ID shown by lspci -nn ends with 002a.

This card works with the ath5k driver, and on FC9, you'll have to get that from the linux wireless driver page. Just get the whole tarball and build it locally.

Before you can do that, you'll first need to yum install make, gcc, kernel-headers and kernel-devel.

Do not use the madwifi driver - it does not work with this card.

The ethernet card is a Broadcom card, and works well with the default driver, nothing much to worry about here.

However, I had problems getting dhclient to get a DHCP IP for both cards simultaneously. I think this is a quirk with Fedora, because I've done it successfully with Ubuntu on a Thinkpad. If you want to connect to wireless, and you already have dhclient running, you have to first disconnect from wired, and kill the dhclient process. I found this very stupid and frustrating.

The next thing that did not work was the microphone. There is a built in mic right next to the web cam. Your volume control sees this as Mic. There is another device called Front Mic, which is actually a mic that you plug in to the microphone jack in the front of the laptop.

Installing all the PulseAudio tools helps.

This does not help with Skype though, and the audio quality is very bad. I don't know if this is a property of the system, or with skype, but basically I was getting clicks, scratches and a lot of static with skype - even after setting the audio output devices in Skype to Pulse.

Anyway, the wireless problems did not end there. I managed to get the wifi card detected, and could connect to an unsecured network, but as soon as I tried to connect to a secure network, it failed. It failed with both WEP and WPA, and I have no idea how to debug or fix that.

I now have only one day left to get this box working 100%, so will try with Ubuntu tomorrow if I can get the CD from someone. Will update this post when I'm done.

Update: The Ubuntu story

After my trials with Fedora, I moved to Ubuntu. Got an 8.10 CD, but it appeared to be corrupt (tested on three different drives). Then got an 8.04 CD that worked.

The first problem was when starting the live CD. It correctly detects that it needs the intel display driver, but the driver itself is broken. I had the same problem with my Thinkpad - the screen is garbled once xorg starts up. I had to boot up in Save Graphics Mode (Press F4 at the grub menu), which uses the vesa driver.

The vesa driver only goes up to 1024x768, which looks weird on a widescreen, but it lets you get things started.

I went through the install procedure, which worked without problem. Followed the same instructions as above for getting the ath5k driver, except that this time it set up the ath9k driver. NetworkManager still wouldn't connect to a WPA protected wireless network, but after reading up online, I decided to try wicd, and it worked out of the box.

I then downloaded Skype and tried it out, but had very bad luck. The microphone wouldn't work, and skype crashed when I tried to use the webcam. This was much worse than Fedora. I tried the whole pulseaudio setup, but that didn't help.

I then upgraded the kernel to the latest, but still had no luck.

Finally I started looking for an updated video driver. I found melchiorre's weblog where he has a deb for the intel driver.

I first tried to get this driver using apt hoping for a newer release, but there wasn't anything, so I downloaded the deb from the blog, and installed it.

This worked in the broad sense. I could start up in graphical mode and use 1280x800 resolution - which is good for a 14" wide screen. The only problem is that the mouse pointer kept getting garbled every few seconds. It would reset to normal if I moused over anything that changed the pointer, but within a second or two it was garbled again.

This made it very confusing to determine where the pointer was (it was just a large square with a series of black dashes all over the place), so I switched back to vesa and decided to tolerate 1024x768.

The system was now in a state where it was usable as an internet browsing box, but Skype not working was a big problem, because everyone that my dad needs to communicate with is on Skype (which meant that Ekiga wasn't an option).

The Windows story

Just for completeness, I should mention the situation with Windows XP:

Windows does not detect the wireless card or the display card, so it runs in vesa mode at 1024x768, and there's no network. The only advantage with windows is that anyone in the world can fix it, so my absence won't be the bottleneck when this box breaks (and it will).

The final story

So, in the end, I've decided to leave Windows on half the drive - this will be the part that all service engineers can 'fix' when things break.

The rest of the drive I've split between Fedora 9 and Ubuntu 8.04 - I wish I could have more recent versions, but I'm not that lucky. I'll set Fedora as the default system, and get the wireless network working there, and use OpenOffice from the Ubuntu partition. At some point I might switch the default to Ubuntu once I figure out what works better with this hardware.

Update: 8.10

I finally managed to upgrade the box to Ubuntu 8.10. I had to do a remote upgrade, since I'm now half way around the world from the box. The upgrade is pretty easy. Just follow the upgrade instructions listed on the ubuntu site. You need to go through the section titled "Network upgrade for ubuntu servers".

The upgrade took almost two days to complete because the network was really slow, and it required me to hit "y" a few times, so it could not be automated (the do-release-upgrade script does not accept a -y flag), but other than that, it was really smooth.

Note: If the upgrade terminates partway, you need to resume it within a day. The first time it failed, I resumed after three days, and it restarted from scratch. The second time it failed, I resumed after 6 hours, and it continued from where it had left off.

The only problem with doing a remote upgrade is that I could not easily test a few things. For starters, I did not know if gnome was working correctly, however, this can be tested remotely. ssh to the box, and look at /var/log/Xorg.0.log. Look for errors (anything starting with (EE)). When I checked this, I found errors saying that there were no usable screen configurations.

I also found that /etc/X11/xorg.conf had been replaced by the upgrade. Restoring it from the original did not help, so I replaced the vesa driver with the intel driver (the one that Fedora worked with), and tried again:
   sudo /etc/init.d/gdm restart
This time it worked, and I confirmed with my dad on the other end that the track pad was working as expected.

The other things I could not test were the webcam, microphone and speakers, but I got my dad to test all three using Skype, and we had a successful VoIP chat - no crashes.

This system is now in a fully working condition.

Thanks for all the comments so far, they definitely helped me push on.

Tuesday, October 07, 2008

Platform dependent locales

Here's a simple snippet of PHP code:
        setlocale(LC_TIME, 'de_CH.UTF-8');
echo strftime("%x");
I run this on RHEL5 and Ubuntu 8.04 and I get different results:

RHEL5:
       2008-10-07
Ubuntu 8.04:
       07.10.2008
So I look through /usr/share/i18n/locales/de_CH for a hint, and I find it.

On RHEL, d_fmt in LC_TIME maps to <u0025><u0059><u002d><u0025><u006d><u002d><u0025><u0064>, which in English, is %Y-%m-%d, while on Ubuntu, it maps to <u0025><u0064><u002e><u0025><u006d><u002e><u0025><u0059>, which in English is, %d.%m.%Y, which is exactly where this discrepancy arises from.

Now I have no idea how to verify which is more recent, because Ubuntu and RHEL do not package things in the same way. Any ideas?

Wednesday, June 04, 2008

Hardy b0rked

On Friday I upgraded Ubuntu to 8.04. There are a bunch of problems with it.

Right at the start I noticed that my display wasn't working correctly. It was very jerky - even just drawing windows on screen was slow. Scrolling was impossible.

It turns out that while they chose to install the fglrx driver for my ATI card, they also installed the Mesa OpenGL drivers. The two aren't compatible. You'd think that there would be some simple package conflicts with this, but somehow the upgrade got both in. I got rid of the Mesa OpenGL package and reinstalled the fglrx package and display worked.

The next thing I noticed was that Firebug wouldn't work anymore. Hardy comes with the brand new Firefox 3, except that the version they chose isn't the latest, but is an older buggy version. The default installed is Firefox 3.0b5, while the latest available from getfirefox.com is 3.0rc1. The weird numbering is because it's still pre-release, but there have been significant fixes between 3.0b5 and 3.0rc1 that, for starters, make firebug work. Since most people who'd use Firefox 3 at this point in time are web developers, they'd also use Firebug, so picking a version that doesn't work with firebug just doesn't make sense.

I downloaded the new Firefox from getfirefox.com and got Firebug 1.1 from getfirebug.com and things worked.

Oh, the older version of Firefox also crashes regularly.

The third problem was video. mplayer said that it couldn't find a compatible xvideo device. This was easy to fix. /etc/mplayer/mplayer.conf had vo set to xv. In other words, the default video output device was xvideo, which doesn't appear to be supported. Why they'd use an unsupported output device by default is beyond my understanding, but I changed it to gl and it worked.

The better default would have been to just not put anything there. mplayer's fairly good at detecting these things at runtime. It's a small startup cost to pay, but it's better than having no video at all, and people who really want it to load faster will figure out the config options anyway.

Next is seahorse - the daemon that caches GPG and SSH keys. It wasn't starting up correctly. Instead, I noticed that gpg-agent was running and seahorse was running as a subprocess of gpg-agent. Why is this a problem? It's a problem because seahorse caches keys so that you don't have to enter your passphrase every time. Without this, I'd have to type in my GPG passphrase for every email I send so that it could be signed. While this is good on a multi-user system where you want things to be secure, I have a single-user box, and this just gets in the way.

The problem was in /etc/X11/Xsession.d/. There's a file called 90gpg-agent which starts up gpg-agent and overrides seahorse. I deleted this file and restarted X, and seahorse started up correctly.

Finally, and this is the most annoying thing I've come across so far.

My network interfaces are not recognise unless there is an active network available on an interface at boot-up time. Let me explain this with an example.

At home, I have a wireless network, while at work, I have a wired network. Now, I boot up my machine at home, and it detects the wireless network, and connects to it (eth1), and it also brings up lo, however, since I'm not connected to a wired network, my wired ethernet interface - eth0 - suddenly becomes non-existent, and there's no way to bring it up. It's as if the kernel hasn't detected its presence.

The only way to get the wired interface detected is to plug in an ethernet cable, and reboot the machine. Of course, when I do this, I also disable the wireless interface, so now that no longer exists, even if I re-enable it after booting.

This happened rarely with the older version, but for the most part, all my network interfaces were visible when I booted up, whether they were connected or not. This is a definite step backwards.

I haven't looked for a fix for this yet, but will post here once I find one.


On the plus side though, suspend now works quite well, and resume is quite fast. Of course, there's no point suspending if I'm going to need a different network interface when I resume.


A few more annoyances:

- My weather applets suddenly started showing the temperature in Fahrenheit instead of Celsius, which is what I'd set it to
- Shift+Space doesn't insert a space any more - it does nothing.

I fixed the space problem by going to Keyboard Preferences, then choosing Layouts, and under my selected Layout, choose Layout Options. Under that, go to the section on Using space key to input non-breakable space character, and set it to Space key outputs usual space at any level.

Friday, March 07, 2008

Creative Vista Webcam VF0330 on Ubuntu

Got back home a couple of days ago, and there was a new webcam sitting on my box. It was being used on windows, which I'm naturally allergic to. I decided to try and get it working on my ubuntu laptop.

Now I've set up webcams on linux before, and it was a pain, but it got done. This was over five years ago, so I'd assumed things may have gotten easier by now. They hadn't. New webcams were out, with just as bad support as there was five years ago. All the same, documentation on the web is good if you know where to find it. That's what this doc is for.

The first thing to do was find out what model my webcam was. I knew it was Creative, since that's what was written on the cam itself. Plugged it in, and dmesg just said that a new USB device had been plugged in. Then I ran lsusb, which gave me this:

Bus 005 Device 001: ID 0000:0000
Bus 001 Device 013: ID 041e:405f Creative Technology, Ltd
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000

So the vendor ID was 041e — which is Creative, and the product ID was 405f, which probably maps onto some name, but that's immaterial.

Most webcams (well, creative ones at least) work with the ov511 driver that comes packaged with most distros, but this cam didn't, so I started searching around for support for this particular product ID. Found out from RastaGeeks that this was a Creative Vista Webcam VF0330 (the VF0330 matched the model number at the back of the cam), and that it was supported by the ov51x-jpeg driver, version 1.5.2 or higher.

The Ubuntu Webcam page had instructions on setting this up, which I followed and met with success.

Now, chances are that you'll find other information as well about this driver. One of the steps I'd followed was to install the ov51x-jpeg-source and module-assistant packages using apt, and then build and install the module using module-assistant. Unfortunately, this installed an older version of ov51x-jpeg, which didn't work with the camera. That led me to believe that the driver didn't work, until I tried the newer version.

If you've done this, then you will need to apt-get remove ov51x-jpeg-modules-2.6.22-14-generic first, then install the new driver and then run depmod -A.

...===...