Wednesday, 13 January 2010

Changes a foot

In the last few days I've seen quite a few updates available. Two very major ones for me was the update for KDE4 and kernel image 2.6.31-18.  For me personally, the kernel update brought about a very welcome surprise. The microphone has started to work again! I'm not sure which particular part of the update got my microphone to work, but whichever part it was has certainly made me very happy!

KDE4 has also brought about welcome changes. The lag I was previously experiencing has been significantly reduced.Unfortunately as I have already changed to Gnome, the effort it will take to return to KDE just doesn't seem worthwhile. I might choose to return to KDE another time at least on my desktop as my notebook still runs KDE.

With the release of 10.04 due out in April bringing along the next long term support version, my initial reaction is to upgrade. This next version shouldn't have any big surprises if they intend it to be a long term support version and should bring even some more welcome patches. I will certainly be looking forward to it.

Thursday, 31 December 2009

Three Computers, Three Results, Three Very different problems.

A new year is about to begin and as with any TV channel around the world they all do a recap of the year just passed. After installing Ubuntu linux variations on three different computers, I have certainly have had three very different experiences and as it is also the end of the year, it is a good time to do a review.

The first time I installed Ubuntu was on my desktop computer, which most of my articles are based on and is the longest running Ubuntu linux machine i have. The machine itself is five years old with a Pentium 4 processorm an ATI 9600 graphics card and on board Realtek sound card. I'm not sure who produced the motherboard as it came with the case from Shuttle. First installation candidate on the machine was Ubuntu hardy 7.10 LTS and the initial installation was anything but smooth. The two contributing problems were my out of date knowledge of nix systems and a very young Ubuntu distribution. I had tried Suse, Red Hat (before Fedora), Slackware and other distros before hand but couldn't stay with them. There were too many options and too many decisions to make. The beauty of Ubuntu is the decisions are pre-made and works very well out of the box.

Moving on, Ubuntu at the time was still very young. Gnome didn't work out very well for me at the time and I had consistent problems with the graphics card, webcam, virtualisation and NTFS. Some of these problems were solved over time, while others never were. Most problems were resolved and I was happily running Hardy with KDE3.5 for quite some time. Problems started when I saw all the new stuff coming out which I couldn't use on Hardy. That made me want to upgrade to the new Karmic.  Now the machine is on Ubuntu 8.10 Karmic and in hindsight I should have stayed on Hardy. Karmic has brought more problems than solving the old ones. Hopefully the next version will resolve many of the problems I am currently experiencing. As far as my desktop experience goes, I am not very happy with Karmic.

Next is my Asus eee pc 701. Xandros was getting to old and there just did not seem to be a straight forward way to upgrade the installation. Personally it is a shame Xandros made it so difficult as I actually like the Xandros distro. It was fast and I thought very practical. As it got so old, I was lucky to have discovered Ubuntu Netbook Release. There is very little I don't like about UNR. Installation was easy and there were very little problems. Main problem was the wireless with regards to hidden SSID. Luckily there is a work around and I learned how to connect to a wireless network via the terminal. Beside hibernating still not working (I'm beginning to suspect it's a space issue), everything works fine which impressed me.

The last system which I've only recently installed it on is my Toshiba notebook. This is a Toshiba Satellite A100 and is primarily my Windows machine. I am not prepared to go full Linux on it, but then I heard about Wubi on FLOSS Weekly, which I thought i would give it a try especially as it leaves my current Windows installation alone. Too my surprise this has so far worked completely flawlessly. Graphics, hibernating, standby, audio, touchpad, keyboard, everything that comes with notebook worked completely flawlessly with Ubuntu Karmic. So far I have found nothing to be a problem. I have yet to test the microphone and the multi card reader, but my impression so far has been very positive.

Ubuntu and linux has certainly come a long way in the past few years and despite all the problems on the way, I have been pretty impressed. The biggest dissappointment has been with my desktop computer which is also the oldest PC still running. I expected the support to be better than some of my newer machine do to its age, but I'm finding the newer machines tend to be better supported. This is a strange turn of events as traditionally linux has always run better on old machines than new.

Wednesday, 16 December 2009

Why I use linux

A friend asked me the other day why I use Linux and he made a good argument why M$ is the better choice. His point of view was M$ provide a piece of software, making sure as much of it is ready for the end user to sit down and use. They have included everything that you possibly want and browse the internet without installing anything extra. For example, they have given you wordpad to type letters, internet explorer to browse the web, media player to manage your music, videos etc. M$ have even included a basic firewall and virus protection as default. Even video editing is included in Media Player. There are GUIs to set everything you need and with Windows 7 you can supposedly even do multi-touch. Without installing all the drivers out there and lots of other software, Windows is very stable. Overall windows is the perfect software for the general user.

I think my friend has made a very good point except for the stability which I tend to disagree. I've had XP fail on first installation, but I agree with the rest of the argument. If you just want to do the basic stuff, windows is actually a very good package. But for anybody who wants to do more than just the basics will find Windows good for some things and bad for others. I come from a CS background and for me Windows has always been limited for my needs. I occasionally do some dabbling in software developments, web development and general hacking (the legal kind). The majority of software I end up running on windows are nix things for windows, like vi, VirtualWin (multi-desktop for windows), tail, gcc, cygwin, qt4, gtk etc. Even some of the windows software I run are also available for nix systems like OpenOffice, Dia, Gimp, Inkscape, Skype and Firefox to name a few. It does suggest I might as well be running linux doesn't it? The only things I can think of I need windows for is Picasa (doesn't run that well under linux, but works), iTunes ('cause I got an ipod), SketchUp (don't actually use it that much anyway), M$ Office (because everybody seems to be producing documents with it) and my Hauppauge HVR-900H with a few bits of hardware that works only with windows. That is actually the only reason I still keep a windows machine around.

The worst being my Hauppauge HVR-900H TV card. This particular TV card has according to http://www.linuxtv.org/wiki/index.php/Hauppauge_WinTV-HVR-900H website a TM6010 chip inside, which:

a) the company do not produce linux drivers (http://www.linuxtv.org/wiki/index.php/Trident_TM6000#TM6000_based_Devices), 
It is important to notice that the vendor (Trident) doesn't seem to want helping with open source development. Contacts with the vendor were tried during 2007 and 2008 in order to get their help by opening docs, via Linux Foundation NDA program, without success. 

b) design according to http://www.linuxtv.org/wiki/index.php/Trident_TM6000#TM6000_based_Devices is buggy

Those chips are very buggy and they behave badly if the driver doesn't do exactly the same thing as the original one (it starts to loose frames). The reason is unknown, but it is suspected that there is a firmware or hardware bug at those chips. 
 and c) the open source developer hasn't got the time to work on it.

The driver is still at the TODO list, however its development is currently frosen. Mauro intends to return back to it, but this is not on his current top priorities. 
Thus, I've bought a piece of hardware which doesn't work on linux. I would help out if I could, but driver programming is unfortunately an area I am not familiar with. I wished I knew more about it though. Similarly my M$ web cam which is a very good web cam under windows, but just doesn't work quite right under linux. Image is too dark, colours are all wrong. Now I use a Logitech webcam, which works right out of the box. Even the microphone on the camera works!

Is linux better than Windows? The simple answer for me is no. I think it is similar to the argument over KDE or Gnome. Whatever works best at that time for the purpose. For me, linux is the obvious choice, but for my wife and kids Windows is the obvious choice (but I still force them to use Linux).

I would like to try the Mac, but not at the prices they are charging......

Monday, 7 December 2009

Wine raises your PulseAudio

It figures! When you think you've solved everything, something else turns up again. This time, purely by chance I discovered when something is running in wine, the rest if the sound system is locked up. I was running a computer game in wine when Skype rang. I saw the message come up that I had a phone call, but I didn't hear it ring. I picked it up and couldn't hear the other end. That was when I realized wine had locked up the sound system.

So the question is how do I run win/dos programs in wine with PulseAudio? Running winecfg and looked at the audio settings. Unfortunately there was nothing for PulseAudio. There was Alsa, Esound, OSS and Jack, but no PulseAudio. Time to google the net again and I came across the following site:
Make Wine and PulseAudio get along

[EDITED]
First, we need to set up Wine correctly. Run this command to set up Wine:

padsp winecfg


The padsp part is important, it makes a virtual OSS device that will talk to the PulseAudio daemon. Next, go to the Audio tab and set the OSS device.

While my initial leaning was to use the ALSA or ESound driver as they would both theoretically work better, ALSA wouldn’t work at all and ESound had issues with skipping (either it’s naively coded or difficult to do in Wine, not sure; I’d guess the latter). So we can use the OSS driver, yet have full mixing and no weirdness due to using the virtual device. Next, to run the program (in this example, we’ll use Starcraft ;) )

padsp wine ~/.wine/drive_c/Program\ Files/Starcraft/starcraft.exe

You should have sound playing without any problems – I don’t know if this method would stand up to a lot of stress though, it uses emulated DirectSound but I had no problem with SC.

Written by Paul Betts
May 27th, 2007 at 7:42 pm

http://blog.paulbetts.org/index.php/2007/05/27/make-wine-and-pulseaudio-get-along/


Changing the audio to OSS and starting the program with padsp has solved the problem for me. I'm hoping they will bring out support for PulseAudio, but based on the following posting:
Acording to Scott Ritchie, during the WineConf 2009 they agree to:

"We’re giving up on separate Pulse/ALSA/OSS/Jack sound driver layers and instead doing the smart thing: passing everything to OpenAL. Maarten Lankhorst will handle most of it."

More info: http://yokozar.org/blog/archives/171

Jaime Rave wrote on 2009-11-17 comment #46 https://bugs.launchpad.net/wine/+bug/371897


Looks like there won't be a solution in the foreseeable future and we'll just have to use padsp in the meantime.

Sunday, 6 December 2009

WPA and Netgear

I've been running WEP on my wireless network for some time now. The only reason I haven't moved to a more secure network is because it has always been a big headache to get wireless working in the first place. But that was a long time ago and I really should move to a more secure network. This was also one of the reasons I started using OpenVPN. Somebody might be able to get into my network, but they won't get into my files that easy. But as they say, secure is never that secure. So, as I'm having so much problem with networking, I must as well give WPA a chance.

Unfortunately my Netgear box doesn't support WPA2. It is a bit old now, but still works so no particular reason to replace it. Reading all the postings in the forum regarding WPA, it sounded like a nightmare. Too many situations where WPA does not work. I guess the only way to find out was try it myself.

First thing I did was changed from WEP to WPA on the Netgear box. Simple enough of an exercise. Next step I needed to do was set my eee pc to support WPA. Luckily with the kernel update, I had to switch back to the ath5k driver which according to forum posts supports WPA, but MadWifi doesn't. No idea if that is true or not, but I'm not going to test that theory. First thing I needed to do was understand wpa_supplicant which is used to connect to a WPA network. The man pages were very helpful in this case.
First, make a configuration file, e.g. /etc/wpa_supplicant.conf, that describes the networks you are interested in. See wpa_supplicant.conf(5) for details.
I can't find the particular paragraph that tells you this, but you need to execute wpa_passphrase to generate the configuration file, which is simple to do. Type the following:

wpa_passphrase MySSID MyPASSPHRASE > mywlan.conf

You need to pipe it to a file or else it will just display it on the terminal.

Next all you have to do is the following:

sudo ifconfig wlan0 up
sudo iwconfig wlan0  essid MyESSID
sudo wpa_supplicant -c mywlan.conf -B -i wlan0
sudo dhclient wlan0

And hopefully you should be connected to the network. Let's go through each line. The first line brings the device wlan0 up. The next line tells the device what ESSID to use. Not necessary if your SSID is broadcasted. In my case my ESSID is hidden and I need to tell it what it is. wpa_supplicant will then attempt to connect to a box on the wlan0 interface using the SSID and password you provided when generating the configuration file and the -B is to tell it to run as a daemon. The next step is to query the DHCP server and give you an IP address. If you want to see what wpa_supplicant is doing, drop the -B. Then you don't have to go through log files hunting for the output.

And that was basically it! It was simpler than I expected. I was expecting a lot of problems, this not working that not working but none of it happened. It was one of the most straightforward changes I've done in a long time. Hope your experience is just as good.

WiFi Drivers

When you think you've finally solved what can be solved, you find something else that needs fixing. In this case, there were actually two things but I tell you the other one in a separate post. The first problem is I upgraded my kernel from 2.6.31-14 to 2.6.31-16 and my wireless on my eee pc stopped working. When I use ifconfig -a (displays all the devices available) it only shows my cable connector and loopback. I should have an ath0 or wlan0 device for my wireless. Neither of them are listed.

My search resulted in finding bug #471877 unable to launch wireless connection after upgrading to karmic with ar5001x. Particularly this posting was interesting.
All you need is to compile the kernel with the MadWIFI controllers again

uwe posted 2009-11-16 comment #6


Does that mean I have to recompile MadWifi everytime the kernel gets updated?

Hi uwe. I believe that recompiling your kernel every time it's updated is a less than ideal solution. If the ath5k driver works for you that process would be unnecessary.

dimas posted on 2009-11-17 comment #7


Sounds like I should try out the ath5k driver again and disable MadWifi. Going into System -> Administration -> Hardware Drivers I disabled MadWifi. Then I edited the file blacklist in /etc/modprobe.d/ and commented out the two lines:

blacklist ath9k
blacklist ath5k

Rebooted and tried to log onto the network via the terminal. One thing did change though, ath0 no longer exists and has become wlan0. So here is what I did:

sudo ifconfig wlan0 up
sudo iwconfig wlan0 essid MyESSID key MyKey
sudo dhclient wlan0

And voila! I was back up and running. Wicd didn't seem to want to play ball till I went into the preference and discovered it was still looking for ath0. Changed it to wlan0 and it was happy too!

ATI? Never again.

ATI is like my Land Rover. I will never buy either of those things ever again. ATI in their wisdom have decided not to support some of the older graphics cards. This means any kernel above 2.6.24 has absolutely no supporting graphics driver for ATI 'legacy' cards. For those of us who still have those 'legacy' cards will have to resort to using the open source driver. Here is a link to ATI listing the cards not supported anymore: http://support.amd.com/us/gpudownload/linux/Legacy/Pages/radeon_linux.aspx?type=2.4.2&product=2.4.2.3.4&lang=English

Personally I have nothing against using the open source driver, but the open source driver just is not that advanced. 2D it's fine, but 3D isn't very advanced and it is very slow. I think 2D is slow too, but it isn't noticeable. Windows games using 3D under wine suddenly become unplayable and tuxkart runs into trouble when there are more than 2 karts in view. Hopefully the open source driver will improve in time, but I guess in the mean time this'll have to do.

As an additional note, Flash stutters on my machine and I just found out how to resolve it. Originally I wondered if it had to do with the graphics drivers, but in fact it turned out to be desktop effects. I don't really understand why, but turning desktop effects to none in Preferences -> Appearance -> Visual Effects resolved my flash problems. Go figure!