Wednesday, January 14, 2009

rt73usb problem with Ubuntu Intrepid

Recently, my wireless connection seems unreliable. It keeps dropping from time to time unpredictably. I cannot just reconnect it with network-manager. I had to unplug my Linksys WUSB54GC usb stick and plug it again to work.
After getting frustrated with this, I finally did a quick google search and found out that this is somewhat a know issue with as describe in https://bugs.launchpad.net/ubuntu/+bug/283759
The suggested solution is to install linux-backports-modules-generic package.
I am trying it out now and I'll update this later if it works out well.

UPDATE:
Nope, not working for my current intrepid kernel:
$ uname -rv
2.6.27-9-generic #1 SMP Thu Nov 20 22:15:32 UTC 2008

The kernel module won't even load due to some "unknown symbols" error in the syslog

Next, I have also tried compiling the compat-wireless from http://linuxwireless.org/en/users/Download but also could not work. This time, the kernel modules could load, but could not connect at all due due to time-out errors.

Finally and hesitantly, I tried the legacy rt73 serialmonkey drivers. Thanks to the instruction from http://linuxbidouille.com/2008/10/25/wifi-rt73-rt73usb/ [ it is in french, but the shell commands is a universal language ;-) ], I had to blacklist rt73usb and then compile and install rt73 module with the following steps (slightly different steps, probably due to newer CVS version).

First, download the latest legacy rt73 package from http://rt2x00.serialmonkey.com/wiki/index.php?title=Downloads
Then, decompress and compile it with the following commands:
tar xvf rt73-cvs-daily.tar.gz
cd rt73-cvs-*/Module/
make -j4 # where 4 is the number of concurrent jobs; I have a quad core Phenom X4.

Next, I unloaded the drivers, blacklist the existing drivers by adding two lines to /etc/modprobe.d/blacklist and add the new module to /etc/modules
sudo ifconfig wlan0 down
sudo modprobe -r rt73usb
sudo modprobe -r rt2500usb
echo 'blacklist rt73usb' | sudo tee -a /etc/modprobe.d/blacklist
echo 'blacklist rt2500usb' | sudo tee -a /etc/modprobe.d/blacklist
echo 'rt73' | sudo tee -a /etc/modules

Then, install and reload the modules
sudo make install
sudo depmod -ae
sudo modprobe rt73


Because legacy serialmonkey drivers are not supported by Network Manager, I need to manual configure the wireless network before I could bring up the network interface by adding the following lines to /etc/network/interfaces:
auto wlan0
iface wlan0 inet dhcp
pre-up iwconfig wlan0 essid "YourWirelessSSID"
pre-up iwpriv wlan0 set AuthMode=WPA2PSK # or WPAPSK
pre-up iwpriv wlan0 set EncrypType=AES # or TKIP
pre-up iwpriv wlan0 set WPAPSK="Your_WPA_Password"

If you worry about storing the password as cleartext, it can be encrypted using wpa_passphase command:
$ wpa_passphrase YourWirelessSSID
# reading passphrase from stdin
Your_WPA_Password
network={
ssid="YourWirelessSSID"
#psk="1234password5678"
psk=6d5a47c07977445329d6701c78a26ce1df86263c9779aa83b4e8d125637b9d5b
}

then copy the long hexadecimal string to /etc/network/interfaces to replace the line
pre-up iwpriv wlan0 set WPAPSK="your WPA password"

with
pre-up iwpriv wlan0 set WPAPSK=6d5a47c07977445329d6701c78a26ce1df86263c9779aa83b4e8d125637b9d5b


Finally, bring up the network with:
sudo ifconfig wlan0 up


Wireless should be working fine now, so far I have been running KTorrent for almost whole day and wireless connection is still working, no connection drop :-)

The only disadvantage is if you are using laptop and roam between wireless networks and you have to manually configure the /etc/network/interfaces. I believe wpa_supplicant could be used, but I have not figure out that part yet. Perhaps next time...


Update May 2009: I have upgraded to Kubuntu Jaunty, and they have finally got it right. I am using the default drivers and things work out of box, so far it has been reliable, not drop connections and download speed is good. So no need for the above workaround unless you really want to stay with Intrepid.

Thursday, January 1, 2009

Native 64-bit Adobe Flash Player 10 for Linux x86_64

Recently I have upgrade my machine to a Phenom 9650 with 4GB RAM. So I decided to use install Kubuntu 64-bit. However, I had to install the 32-bit libraries and nspluginwrapper for Adobe Flash Player to work as it previously only 32-bit binaries was release. Now, Adobe has released an Alpha "refresh" version of native 64-bit Flash Player to enable pure 64-bit web surfing experience!
To install, first uninstall currently installed flashplayer with the following commands:
sudo apt-get purge flashplayer-nonfree nswrapperplugin

Then download Flash Player 10 for Linux 64-bit from here.
and extract libflashplayer.so to the following directories:

~/.mozilla/plugins/
/usr/lib/firefox/plugins/
/usr/lib/mozilla/plugins/

Restart firefox and go to your favourite flash site.
For me, youtube.com and various flash site works well!
The only problem is that konqueror doesn't seems to like it and does not display properly and it has been reported as bug 169626.

VirtualBox Hardware Virtualization and Nested Paging

Recently discovered that I could enable nested paging for Virtualbox 2.1.
Nested paging is a new hardware virtualization extension on AMD K10 Barcelona/Phenom and Intel Core i7 Nehalem processors that allows processor to offload memory paging required by the guest OS that is traditionally done by the VM with shadow paging.
Since it is a new feature, it is not available in the configuration UI yet.
First, you will have to enable hardware virtualization (VT-x/AMD-V) in Settings -> Advanced. Then, nested paging can be enabled as described in the VirtualBox User Manual with the following command:
VBoxManage modifyvm   -nestedpaging on

The performance boost is quite noticeable.
The boot up time for my virtual Windows XP has drop from about 25 seconds to 18 seconds.
Super PI Mod has dropped from 39.159s to 36.016s
Various benchmarks on the net show performance boost up to 30%.
I'll run more benchmarks next time.