* [http://www.music.mcgill.ca/~gary/rtaudio/index.html RtAudio]. At the time of writing, the most current version is 4.0.11 which can be downloaded [http://www.music.mcgill.ca/~gary/rtaudio/release/rtaudio-4.0.11.tar.gz here].

* [http://www.music.mcgill.ca/~gary/rtaudio/index.html RtAudio]. At the time of writing, the most current version is 4.0.11 which can be downloaded [http://www.music.mcgill.ca/~gary/rtaudio/release/rtaudio-4.0.11.tar.gz here].

* '''A USB soundcard''' which has an audio-in port. voicepcmhost-rtaudio fails if it can't connect to an audio input, and the Pi's onboard sound only has an audio-out connection. Connect the device before you turn on the Pi; if its chipset is supported, drivers will be loaded at boot.

+

* '''A USB soundcard which has an audio-in port.''' voicepcmhost-rtaudio fails if it can't connect to an audio input, and the Pi's onboard sound only has an audio-out connection. Connect the device before you turn on the Pi; if its chipset is supported, drivers will be loaded at boot.

* '''Premake''', a build utility which generates a correct makefile for voicepcmhost-rtaudio.

* '''Premake''', a build utility which generates a correct makefile for voicepcmhost-rtaudio.

About SkypeKit

Sadly, there's no desktop Skype application currently available for the Raspberry Pi. However, Skype do have a Developer Program, and through that program it's possible to get the basic bits & pieces needed to put together a Skype client that will run on the Pi.

SkypeKit is an SDK & set of runtimes provided by Skype to developers who want to create applications with Skype-based functionality.

You can think of a runtime as a 'headless' version of Skype: it's an executable which has no interface, runs on the commandline & connects to the Skype network and provides stuff like contact lists and the ability to make calls. The SDK allows you to write code which talks to the runtime. You're never dealing with the Skype network directly; just manipulating the runtime.
When you're developing with SkypeKit, presenting an interface to the user is your responsibility. The core Skype functionality is the runtime's responsibility.

There are a number of runtimes available for various combinations of OS & architecture. Luckily for us, there's a linux-armv7le-eabi runtime which runs on the Pi.

Handily, the SDK also comes with a bunch of example code which lets you do things like chat & make and receive calls on the command-line.

The purpose of this guide is to get you to a point where you can hack about with SkypeKit on the Pi. It's not a canonical guide to making Skype calls on the Pi, although hopefully may make such a thing possible in the future.

Prerequisites

There's a fair bit of footwork required to get to the point where you can get your Pi connecting to Skype. Firstly, most importantly, and the reason that this stuff is currently only useful to developers is the fact that you'll need to sign up to the SkypeKit Developer Program to get the runtime and the application keys needed for its use.

Getting the SkypeKit SDK & runtime

Once you're signed up to the Developer Program, you'll need to sign up to the "SkypeKit for Embedded" Program to download the runtime for Pi. Go to http://developer.skype.com/account/projects and click the link that says Join for US $5 on the "SkypeKit for Embedded" line in the Programs section. The astute will already have realised that it costs $5.

Once you're signed up to the SkypeKit for Embedded program, you'll need to create a Project to get the key pair that the runtime requires to run. Visit http://developer.skype.com/account/projects again; you should now see that where the Join for US $5 link was which you used to sign up to the Embedded program, it now says "Create a new project". Click that link and follow the instructions to create a project.

Once you've created a project, you'll be able to download the SDK, runtime & key pair you need to run a runtime on the Pi. Visit http://developer.skype.com/skypekit/releases. Remember, we're interested in the Embedded runtime for the Pi's ARMv7 chip; at the time of writing, this download is the 4.2.1 for Embedded SDK from the Step 1 section.

You'll need to request the runtime, since they're built uniquely against a Developer Program account. Click "Request a runtime" in Step 2: Request and download runtimes. We're after a Linux / ARMv7 runtime, so select those in the dropdowns at the column headings in the table which appears. There's a few which can be used; I'm currently working with linux-armv7-skypekit-voicepcm-novideo, so that's as good a choice to make as any at this point.

Finally, we'll request a key pair. Go back to the project that you created and click "Development key pair". Then click "Request a new key pair" and give it a name (I use dates). Click "Request key pair" after proving you're a human, then "Download the key pair"

That's it! You now have everything you need to start slapping together a simple Skype-connected app

Building an Audio Host & running an example app

Now we've got the SDK, runtime & keyfile, we're ready to start putting things togeher on the Pi. Copy over linux-armv6-skypekit-xxx.gz, linux-armv6-skypekit-xxx.tar.gz, skypekit-sdk_sdk-xxx.tar.gz and the .pem keyfile to a sensible place on your Pi (I made ~/dev/skype and put them there) and uncompress both archives with:

tar xvzf filename.gz

The rest of this guide is all Pi-side, since I'm not quite ready to attempt to get my Mac cross-compiling for the Pi just yet.

About Audio Hosts

The Skypekit ARM runtime needs to connect to an Audio Host at the time that it connects to the Skype network, even if we're not actually interested in making calls (say, using the runtime for chat). An Audio Host is a standalone binary which runs alongside the runtime and provides it with access to audio in & out connections. The Audio PCM Quick Start guide on http://developer.skype.com gives more detail about this setup, but the practical upshot is that we'll need to compile an Audio PCM Host before we can use any of the services provided by the runtime.

Most of this information is extracted from Skype's Audio PCM Quick Start guide, but this doc seems to lag behind regarding the build system used in more recent versions of the SDK (4.2.1 at time of writing). There's some tidbits of information about the new build system in the Release Notes for 4.2.1, but other stuff I've basically guessed at/worked out through trial & error. YMMV.

Building voicepcmhost-loopback

The simplest reference Audio Host provided in the SDK is voicepcmhost-loopback, which as the name suggests, just copies audio data from its input back to its output.

Hopefully, we should now have a built binary at ~/dev/skype/skypekit-sdk_sdk-4.2.1.97_1379776/reference/voicepcmhost-loopback/build/voicepcmhost-loopback.

Building voicepcmhost-rtaudio

If you'd like to try making a call through to actual audio hardware on the Pi, you can build voicepcmhost-rtaudio which uses the RtAudio library to connect to an audio device.

Prerequisites

RtAudio. At the time of writing, the most current version is 4.0.11 which can be downloaded here.

libasound2-dev, the ALSA shared library which RtAudio needs to connect to ALSA (if you're wondering, ALSA is the Linux sound system[1]). Install this library with

sudo apt-get install libasound2-dev

A USB soundcard which has an audio-in port. voicepcmhost-rtaudio fails if it can't connect to an audio input, and the Pi's onboard sound only has an audio-out connection. Connect the device before you turn on the Pi; if its chipset is supported, drivers will be loaded at boot.

Premake, a build utility which generates a correct makefile for voicepcmhost-rtaudio.

Make a link to the RtAudio source. The makefile for voicepcmhost-rtaudio expects the source for RtAudio to be present in this folder at compile-time. We'll make a link back to the extracted source to keep things tidy.

ln -s ~/dev/rtaudio-4.0.11 ./rtaudio-4.0.6

Note that the link is named rtaudio-4.0.6: the makefile is expecting an older version of RtAudio, and rather than mucking about with the makefile, it's probably just better to be a little disingenuous with the link name. This strategy works fine at the time of writing with rtaudio-4.0.11 standing in for 4.0.6.

Generate the correct makefile for voicepcmhost-rtaudio, since the default one doesn't work.

make

This will generate a bunch of makefiles and try to build voicepcmhost-rtaudio, which will fail. This is OK though, since we'll build it in the next step.

If all of this worked, you should be left with a built binary at ~/dev/skype/skypekit-sdk_sdk-4.2.1.97_1379776/reference/voicepcmhost-rtaudio/build/voicepcmhost-rtaudio.

Making a test call to the Pi

Let's try putting the whole thing together and making a test call to the Pi. If it works, we'll hear our own voice echoed back to us through the loopback host. You'll need the logins for two different Skype accounts: we'll use on the Pi and one on your desktop. You'll also need Skype installed on your desktop.

Copy the .pem keyfile to ~/dev/skype/skypekit-sdk_sdk-4.2.1.97_1379776/examples/python/tutorial. We'll use it later to run a test app. Edit ~/dev/skype/skypekit-sdk_sdk-4.2.1.97_1379776/examples/python/keypair.py to reflect the filename of the keyfile.