Monday, October 30, 2006

Free the Platform!!

Can anyone tell me why I cant upgrade my mobile phone software?? Not some Java application on the phone, but the actual operating system. How much of a difference is there between a Nokia series 40 and Nokia series 60 phone in terms of hardware? Should I not be able to swipe the existing JVM which was based on an older Java implementation to a newer one? Will I ever be able to customise the hardware in the phone? Maybe we'll have to wait a bit longer for programmable hardware.. probably through FPGA's.

In a few years the mobile phone will be more important the the average computer. More people will use handheld devices for their daily tasks like browsing the net and listening to music. Developers will follow.. creating the next generation of killer applications.. followed by hackers to free the platform.. and by then google will own all your data

Tuesday, October 24, 2006

Ubuntu 6.06 (Dapper Drake) on Acer AS3004WLCi

I had installed Dapper Drake on my Acer AS3004WLCi Laptop a few months back. I've been happy with it but there were several things that didn't work. I've been pretty lazy but I think I've finally resolved most, if not all, of them. Here's a run down.

Firstly, what didn't work:

  • After booting up and picking Ubuntu from the grub menu list, a few kernel messages would show up and then there would be a blank screen until X Server started up with the login box. Similar issue when shutting down... didn't see any messages.

  • Same thing for Virtual Terminals... Ctl-Alt-[F1-F6] would bring up a blank screen.

  • Resolution for the 15.4 inch screen would only bring up 640x480, 800x600 and 1024x768 options. No wide-screen 1280x800 resolution.

  • Touchpad scrolling would not work.

  • Suspend/Hibernate would work the first time after booting up, but after resuming there would be a message saying there was a problem and on subsequent attemps would fail. It would look like it's doing something, screen would go blank, then all of a sudden some garbled text would be displayed at the top of a black screen and the screen saver would start up.

  • Wireless would not work. Would not detect the card.

  • Issues with sound... If multiple applications which use sound such as a music player, a flash site and skype were open, things would be very erratic. Skype would give errors like 'Problem with sound device'. Flash based sites like YouTube or Google Video would not have sound etc...


What I did to resolve these issues:

  • Turns out that the blank 'bootup/shutdown screen' and blank virtual terminals are related. When you pick Ubuntu from the grub menu list, it loads up the linux kernel which in turn loads a basic video driver to show the kernel messages. The video driver is considered to be basic and compatible with most screens. If the vga parameter is not passed to the kernel it defaults to vga=normal. It seems it wasn't with my Acer screen. So this needed to be changed. Edit /boot/grub/menu.lst. Add vga=792 to the kernel /boot/vmlinuz-<version> root=<hda> ro quiet splash line.

    HOWTO: Change bootup resolution was really helpful. It goes into further details about the bootup process etc... Also read it to understand the 792 value.

    The kernel uses the same driver for both the 'bootup/shutdown screens' as well as the virtual terminals. The vga parameter fixed both these issues.

  • The touchpad scrolling problem and the screen resolution problem had a common resolution.

    lspci | grep VGA
    shows
    VGA compatible controller: Silicon Integrated Systems [SiS] 661/741/760/761 PCI/AGP VGA Display Adapter
    on my Acer laptop.

    So we need a sis driver. Looking at /etc/X11/xorg.conf showed that it was loading the vesa driver. To fix this run
    sudo dpkg-reconfigure xserver-xorg.

    Go through all the screens and answer the questions. For most, the default will do. When you get to the video screen, pick the sis driver and the desired resolution (1280x800). Make it the default. After this is done restart X-server (Ctl-Alt-Backspace). It should start with the crisp widescreen resolution.

    The Strange screen resolution thread got me the lead on trying dpkg-reconfigure.

    Check this page for some bedtime reading on sis drivers.

    The touchpad scroll started working after going through the reconfigure. I didn't do anything specific. I think I just picked default options for the touchpad/mouse screen.

  • The Suspend/Hibernate issue was related to Wifi not working. Funny how these things are related no? The garbled text that was displayed after a failed suspend became clear after the virtual terminal issue was resolved. It was outputting bcm43xx: Error: Microcode "bcm43xx_microcode5.fw". dmesg showed the same error.

    lspci | grep Wireless
    shows
    Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02)
    on this Acer laptop.

    So this is the wi-fi driver. After some searching, came upon How to: Broadcom Wireless cards (These How-Tos are amazingly helpful!). I followed the instructions and it seemed to work. iwconfig brings up the wireless network interface information + iwlst <eth> scanning shows the wireless connections available.

    After suspending and resuming, looking at the dmesg output, the errors weren't there anymore.

    Check this page for some insight into the suspend/hibernate process.

  • The sound issues took care of themselves really :) Upgrading the kernel to 2.6.15-27-386 seemed to resolve all of them. Also upgrading to Skype 1.3.0.53 helped.


Most problems have solutions out there. All it needs is a bit of searching/reading/trying.

Lets see how many of these issues are resolved in Egdy Eft which comes out tomorrow!

Saturday, October 14, 2006

Monday, October 09, 2006

hd internals

A cool demo of the hardworking hd in action.

Thursday, October 05, 2006

Ubuntu on a Dell 6400

Yipee.. I recently purchased a Dell laptop - Inspiron 6400 (also known as E1505). The first thing I had to do was to install Ubuntu. Luckily for me this is a common model and comes with some standard components and most of the things work with little or no configuration.

By default I got a resolution of 1028x768 on the widescreen which supports 1280x800 natively. So things were looking pretty stretched. The i915 wiki page explains pretty well howto get the correct resolution.

Another fun thing I did was to get the GKrellM with i8kutils. GKrellM is used to monitor the system. Its something I need to look more into. i8kutils is a dell laptop specific lib for intrumentation of the processor fans. Installation was explained in the Ubuntu forums over here. However after installing everything as explained, GKrellM still does not show any fans. For that, within the GKrellM configuration, the i8k plugin needs to be enabled first. After that two fans will be visible. Clicking on the fan can be used to toggle to Manual mode for fan and set the speed as well which you can confirm by listening to the low buzzing noise!! However I dont expect the processor to burn as the author says :) as the Intel motherboard automatically sets the fan speed based on heat.

Sunday, October 01, 2006

final by default

When talking about 'good programming practices', one thing that was recommended by a good professor of mine was to declare variables that you aren't going to modify as final. It serves two purposes:
1) A self check for yourself so you don't accidentally modify the variable down the line somewhere
2) Self documents the code: Other's reading your code know immediately of your intent.

While trying to follow this (in Java) I found all these 'final' keywords all over the place. I began to feel that it wasn't really helping. Just cluttering the codebase with 'final's.

So why not just have all variables be final by default?

Along these lines, I feel providing all the abilities of C++'s const to Java's final would be a tremendous boon. Your contracts can be better defined - not just on references but on the objects themselves.

<soapbox>Code maintainability - getting up to speed on a codebase and changing someone else's code is something that is done far more than adding new code. Anything to make readability better by clearly defining contracts/intent can only be a benefit and should be strived for.</soapbox>