Sunday, March 15, 2009

iTunes for Ubuntu

Since long I have been finding a replacement for iTunes on Ubuntu, but in vain. I don't want to use CrossOver Office as it's proprietary, and don't want to install the bloated Windows Vista in VirtualBox and waste many GBs of storage just for the sake of one iTunes. Since making the switch to Ubuntu/Kubuntu twins, I haven't missed Windows at all. In fact, now I am realising what I was missing with OEM windows running on my Dell laptop. Nowadays, I feel disgusted even at the thought of going back and installing Windows.

The next thing on my agenda is of-course trying to get iTunes running through Wine, though, I have read pretty many comments about problems in this approach. I am not very positive about it.

That leaves me with the thought - why doesn't Apple come out with an iTunes version for ubuntu (or linux in general)? Especially when Ubuntu has gone mainstream with a bang, with many hardware manufactures (like Dell) shipping their units with Ubuntu. Though I don't know exact figure of ubuntu users, given the life in the ubuntu community and forums, it's easy to guess that there is a sizeable amount in there.

If you are an ubuntu user, and you think on the similar lines, I request you to sign the iTunes for Ubuntu Petition.

There are currently 2000 odd signatures there. It doesn't take time to sign the petition. Every sign will help, so please sign the petition.


Saturday, March 14, 2009

Skype / Ekiga on Ubuntu 8.04 Hardy Heron

As GTalk doesn't support Linux for VoIP communication, I needed some alternative VoIP software, that works well on Ubuntu. There were couple of them Ekiga and Skype.

Ekiga comes pre-installed in Hardy. So I started with Ekiga and registered for a SIP address on ekiga.net. But unfortunately, ekiga failed to communicate with sound hardware on my Dell Vostro 1500 laptop. So I downloaded Skype for Ubuntu. Same story.


So I searched the net, and finally got it working. It turned out that the pulseaudio package was the culprit. Skype and Ekiga both don't work with pulseaudio. They work with esound package. So I decided to remove pulseaudio and install esound instead. Before removing pulseaudio, I disabled PusleAudio Session Management from System->Preferences->Sessions.




And then -

killall pulseaudio
sudo apt-get remove pulseaudio
sudo apt-get install esound

On some setups (probably on intrepid), it might be required to remove a file from /etc/X11/Xsession.d so that the Ubuntu login process doesn’t break.

sudo rm /etc/X11/Xsession.d/70pulseaudio

This is not required on Hardy though; there is no such file in Hardy. I think disabling of PulseAudio Session Management, does the trick instead.

After installing esound, and restarting both skype and Ekiga, though I could hear Ringing, and Sound Outs from Skype, the mic was still not working in test call. Then after playing with the system for sometime I realised that the mic was muted. I had to enable mic boost control from Volumn Control->Edit->Preferences and tick Capture and Capture-1.



And then, when I un-muted the mic, skype worked flawlessly. And after skype, Ekiga also started working when I set Audio In and Audio Out devices to HDA Intel.


Interesting Part

Now, here is the interesting part. After playing around with skype and ekiga for a lot of time, I came to know that I had an uninterruptible process (elisa media player) parented by a python zombie process. I rebooted the system, since there is no other effective way to get rid of these zombies, and elisa was consuming 100% of my CPU2 (at least that's what the system monitor reported).

Ubuntu got stuck during reboot, I am not sure for what reason. So I had to power the system off. When I powered it back up again, I could login and there were no error messages related to pulseaudio. But the UI was totally unresponsive, as if it has hanged. iThen I switched back to command line mode using CTRL-ALT-F5, logged in, removed esound and reinstalled pulseaudio.

sudo apt-get remove esound
sudo apt-get install pulseaudio
sudo reboot


And after reboot, the UI was back to life again. So it was the pulseaudio which caused this freeze. Out of curiosity, I started Skype and made a test call. And to my surprise, both mic and audio playback worked!!! Now this was not expected, as skype initially refused to work with pulseaudio. So did ekiga.

I started the PulseAudio Session Management as well, still Skype and Ekiga worked perfectly.


Conclusion

It seems that, on Hardy, Skype and Ekiga, both work with pulseaudio, and it was probably due to  the zombie process of elisa media player hogging the sound device that caused problems with audio playback and mi, in Skype/Ekiga.

So finally, it seems that, on Ubuntu 8.04 Hardy Heron, you don't need to remove anything or install anything, to get Skype and Ekiga working!!! And this whole post of mine turns out to be a pure waste of time and energy!!!! :(


An Update -

Just in case somebody is interested, there is a very informative post about pulseaudio and how to get it working, on ubuntuforums.org - HOWTO: PulseAudio Fixes & System-wide Equalizer Support


Technorati Tags: , , , , ,

Sunday, March 1, 2009

Setting up Debian APT behind Proxy Server

Setting APT to run behind a proxy server is a pretty easy and quick procedure. Login as root user, and then All you need to do is set http_proxy environment variable in http://username:password@proxy.server.com:port_no/ format.

debian:~# export http_proxy='http://shreyas:myPassword@myproxyserver.co.in:8080/'
debian:~# echo $http_proxy
http://shreyas:myPassword@myproxyserver.co.in:8080/
debian:~# cat /etc/apt/sources.list
#
deb http://ftp.us.debian.org/debian/ etch main
debian:~# apt-get update
Err http://ftp.us.debian.org etch Release.gpg
Could not resolve myproxyserver.co.in
Ign http://ftp.us.debian.org etch Release
Ign http://ftp.us.debian.org etch/main Packages/DiffIndex
Err http://ftp.us.debian.org etch/main Packages
Could not resolve myproxyserver.co.in
Failed to fetch http://ftp.us.debian.org/debian/dists/etch/Release.gpg Could not resolve myproxyserver.co.in
Failed to fetch http://ftp.us.debian.org/debian/dists/etch/main/binary-i386/Packages.gz Could not resolve myproxyserver.co.in
Reading package lists... Done
E: Some index files failed to download, they have been ignored, or old ones used instead.
debian:~#

Here as the proxy server address is fictitious, apt reports an error. But that's not the point really. The point is, if you observe, what apt does with the http_proxy URL is, it separates out the host (in this case, myproxyserver.co.in) from the URL. And how does it do that? Simply by finding '@' sign in the http_proxy URL and then taking the part from '@' to ':'.

This is fine, but only as long as our password is plain alpha-numeric. The moment password contains a special character, like an '@', this whole thing goes for a toss.

debian:~# export http_proxy='http://shreyas:my@Password@myproxyserver.co.in:8080/'
debian:~# echo $http_proxy
http://shreyas:my@Password@myproxyserver.co.in:8080/
debian:~# apt-get update
Err http://ftp.us.debian.org etch Release.gpg
Could not resolve Password@myproxyserver.co.in
Ign http://ftp.us.debian.org etch Release
Ign http://ftp.us.debian.org etch/main Packages/DiffIndex
Err http://ftp.us.debian.org etch/main Packages
Could not resolve Password@myproxyserver.co.in
Failed to fetch http://ftp.us.debian.org/debian/dists/etch/Release.gpg Could not resolve Password@myproxyserver.co.in
Failed to fetch http://ftp.us.debian.org/debian/dists/etch/main/binary-i386/Packages.gz Could not resolve Password@myproxyserver.co.in
Reading package lists... Done
E: Some index files failed to download, they have been ignored, or old ones used instead.
debian:~#

Now if you observe, because of the '@' in password, apt thinks the username is 'shreyas', password is 'my' and the host is 'Password@myproxyserver.co.in'!! Try using escaping the '@' with a '\' and you will still get the same result.

This is the problem I had been facing since last couple of days. Few of the other guys have also reported this problem in other debian and ubuntu forums, and it's around for almost an year now. It has also been filed in Debian Bug Tracking System (BTS) as bug #500560.

Though this might seem as a rare occurrence, passwords with special characters are a norm in password policies of several organizations, as it is with mine. So I had no option but to either say goodbye to Debian, or fix it myself. And given the regard and love I have towards Debian, I had to at least have a go at fixing the bug. Saying goodbye to such a fantastic distro just because of this minor problem would have been very painful.

Bugfix for APT Bug #500560

And the bug is fixed! As I said, what APT used to do was to look for '@' and a ':' just after that to resolve the Host from http_proxy URL.

After the bugfix, now APT supports escape character '\' before '@'s and ':'s, formulates the correct password. For example, if your password contains an '@' character, all you need to do is prefix the '@' with a '\' while exporting the http_proxy environment variable.

debian:~# export http_proxy='http://shreyas:my\@Password@myproxyserver.co.in:8080/'
debian:~# echo $http_proxy
http://shreyas:my\@Password@myproxyserver.co.in:8080/
debian:~#

I have prepared this bugfix patches for both Lenny and Etch distributions. And they are available at my bugfix post.

For ready reference, here are the cross links to the patch files – 

  1. Debian Lenny - Bug #500560 Patch for APT v0.7.20.2

  2. Debian Etch - Bug #500560 Patch for APT v0.6.46.4.1

These patches have been tested on a Debian 'etch' 4.0 r4a distro running on a Dell Vostro 1500 latop (core 2 duo, 2GB).

Please report if you face any issues with the patches.