Skype and Pulseaudio Woes

March 13th 2013

The computer over at my parents' is a Pentium 4 and it sports a Soundblaster AWE32 as well as an on-board chip. Suffice to say, the computer was slow as hell running on Windows XP. It had been infected with malware, so I decided to go the extra mile and get rid of windows altogether and install Ubuntu 12.04.
It just makes sense. It fits their normal use, it’s a current OS and it runs fast on such ‘dated’ hardware.

I wasn’t even done configuring it when the next day, much to my surprise, my father was already using it, seemingly not even bothered by the odd skipping of the window controls to the left, clock and tray to the top and the misterious disappearance of the long revered ‘start’ button. Everything he needed was just there on the Unity launcher. Everything but Skype.

So, here was my pickle. Audio was fine otherwise, but Skype calls were really slow and stuttering. It seems all the mixing is being done on the software level. And you can’t do much about it on Skype because when you try to tinker with the audio options it just directs you to pulseaudio.

While it does have its shortcomings, removing pulseaudio is a terrible idea. A way to circumvent it is to pause it with:

pasuspender -- skype

This will suspend pulseaudio while the program is running and wait for it to exit to resume. It’s good enough if you’re planning on making a call when you open Skype. The downside is, well, you wont get audio from anything else.

Another way to go around this is to trick an instance of pulseaudio just for Skype on localhost. Pulseaudio becomes inacessible, so Skype will give us all the available hardware options. This will allow you to specify what device you want for audio input and output separately.
As an example, I set my usb webcam with integrated mic for audio input, and the on-board soundcard for output and ringer.
This means pulseaudio will happily keep on working and stick to the SoundBlaster. Then we trick it to not run on Skype, which in turn will connect with the on-board card and webcam mic directly. The on-board card is connected to it’s own speaker. Better yet, should there be an incoming call and the system-wide volume set low or muted, the ringer will go off on full volume anyway, so we wont miss a call.

It may not be ideal for some, but as they use Skype as a telephone anyway, they are in fact expecting incoming calls.

We begin by creating our script:

sudo gedit /usr/bin/skype-nopulse

With the following content:

#!/bin/bash
PULSE_SERVER=127.0.0.1 /usr/bin/skype &

Finally we change it so it is executable:

sudo chmod +x /usr/bin/skype-nopulse

Don’t forget to also change the desktop file so that the new script will be called when opening Skype from the launcher. We edit the file:

sudo gedit /usr/share/applications/skype.desktop

and change where it reads:

Exec=skype

to:

Exec=skype-nopulse

I have Skype set to run on startup, so we want it to use our script instead. Under Startup Applications… we create an entry for it and set it to run the command:

/usr/bin/skype-nopulse

To undo this, we can simply change back the line we edited in skype.desktop and change our entry in Startup Applications… to just “skype” or delete it altogether.

« return to blog