google talk voice chat on GNU/Linux

by Ramakrishnan Muthukrishnan

Since this year March, I had been a heavy user of VoIP. I had been trying various options, asking other users on which service works best and so on. If not for VoIP, I would have been spending massive amount of money on Telephone to call home. One of the hard requrement was that it should run on GNU/Linux and should be Free (as in Freedom). But after trying out afew programs, I decided to relax that condition and decided to be a bit more pragmatic, but this requirement was always in the back of my mind. I had been mainly using Google Talk and occassionally Skype. I like the voice quality provided by Google Talk very much and the simplicity of their client program. The only bad part had been that it works only on Windows. I had to boot into Windows (which came pre-installed) on my laptop. Not anymore..

Google released the library called libjingle. I (together with my friend Anoop) was one of the first to try it out way back in 2006 if I remember – in vain. But last week I started looking into libjingle again. The inspiration came from this page and after afew late night hacking, it all works and this post will enable the reader equipped with a GNU/Linux machine to do it too. From now on, I am going (if time permits) to maintain a branch of libjingle and hope to release updated versions and also integrate it with a simple chat client. Those are for later.

0. Download the tarball. All the required changes to get libjingle to compile and work, is in this tarball.

1. Install SSL, ALSA libraries, Speex development files (i.e. libssl-dev, libasound2-dev, libspeex-dev). Needless to say, you need to have a working toochain setup. If not install gcc 4.x and its cousins.

2. libjingle 0.4.0 specifically depends on ortp 0.7.1. This will change in future, one of the things in my list is to make it work on the current latest version of ortp. ortp-0.7.1 is included in the above tarball. Do:

./configure && make && make install

This should install ortp libraries and header files into /usr/local.

3. Install iLBC libraries. Do:

$ cd msilbc-2.0.0

$ tar zxvf ilbc-rfc3951.tar.gz

$ cd ilbc-rfc3951

$ ./configure && make

$ sudo make install

iLBC is a royalty free codec, supposedly. But the version of code which is included in the above tarball is not really Free as in Freedom. One can use it only for non-commercial personal use. The specification are however, freely available, for anyone to implement a Free version. Any volunteers?

4. Go into libjingle-0.4.0 directory. Do:

./configure --with-speex=/usr --with-ilbc=/usr/local

After afew minutes of compilation, you will have the library and the programs in the example directories built.

5. Go to talk/examples/call. Run:

$./call

Alternatively, you can do a make install and just invoke call. call -d spits out some of the xmpp traces and debug information which was very valuable in debugging certain stuff.

It will ask you your JID. Give the full gmail ID (for eg: abcdef@gmail.com) and give the password. I think the rest of the things are self-explanatory. It has a very simple command system. Type roster to see who is online or away. Use ‘call’ to call someone. Once you are in a call, it gives you another set of commands to hangup or mute/unmute calls.

6. There are afew issues with the program and occassional crashes. We will fix them on the way.

7. Please report success, problems and fixes to my email ID.

8. I have started maintaining my own svn repository of this code with the aim of improving it a bit. Contributors are welcome. I will publish the repository when I have something to show. One of my goals with libjingle is to do remote amateur radio operation. i.e. Control, recieve and transmit the radio sitting at your house connected to a computer and a broadband connection from anywhere in the world. What has been accomplished is just a baby step.

Surprisingly, I found in the initial xmpp capability exchanges that the latest windows build of google chat client is not using speex. It uses a bunch of propreitary codecs which is not supported by the above code, so it switches to the PCM/U at 8kHz sampling rate. [Update: Looks like I was wrong. Speex seem to be well supported. Sorry for misinformation.]

A big thanks to Google to publish libjingle as free software. The libjingle documentation is also a great piece of work. It will be a shame if no one used it to the maximum.