Unofficial Skype + Linux Sound FAQ
Q: I have no sound in Linux at all!
In order for Linux to recognize and use your soundcard, you have to load the appropriate driver. As of the 2.6 version of the kernel, that means enabling the ALSA (Advanced Linux Sound Architecture) driver for you card. Take a look at the ALSA Soundcard Matrix to determine which driver you are supposed to use for your speciffic card.
Now, you will have to modify your /etc/modules.conf or /etc/modules.d/alsa (check your distribution for details on the correct way to load and configure modules) and add the following:
CODE
# This sets up the ALSA and OSS portion
alias char-major-116 snd
alias char-major-14 soundcore
# Replace "driver" with the driver for you soundcard
alias snd-card-0 snd-driver
alias sound-slot-0 snd-card-0
# Configure the OSS emulation layer
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss
# If you have more than 1 card, set this number to the correct value
options snd cards_limit=1
options snd-pcm-oss nonblock_open=1
Note that a lot of this configuration is dedicated to something called OSS (Open Sound System) emulation. This mimics the behaviour of the old Linux sound system so as to be backward compatible with older software that does not yet support the new sound system. One such piece of software is Skype - so it is important that it is running and configured correctly.
Now, it is time to load the drivers. How you do that depends on your distribution - you may have an /etc/init.d/alsa or similar script that will do it for you. If you are unable to figure it out, a reboot will do it.
For a great and detailed walkthrough on setting up ALSA and setting the ALSA mixer correctly, please read roothoricks excellent post on the subject here.
Q: My driver loaded correctly but I still have no sound!
The first thing you should do is run the "alsamixer" program. By default, all channels are muted on a newly installed ALSA system so you will have to manually unmute the ones you want. The best tool for the job is alsamixer, which can access all the different channels offered by ALSA.
It might also be a permission problem. Initially, though that might depend on your distribution, I believe the sound devices are owned by root and only root has read/write permissions on it. If you system has an "audio" group in /etc/group, try adding yourself to that one. As root, execute the following command:
CODE
usermod -Gaudio username
Replace username with the name of the user you're going to run Skype with. You can also change the ownership of the dsp device so you can access it as a regular user, or set the permissions so that all users have read/write access to the device.
CODE
chown username /dev/dsp
chmod 666 /dev/dsp
The first line will make username the owner of the device. The second line will give everyone with an account on the system read/write access to the sound device. Note: You might have a /dev/dsp device even if you are using devfs - this will just be a symlink to /dev/sound/dsp so you do not have to fiddle with it.
CODE
# With devfs
$ ls -l /dev/dsp
lr-xr-xr-x 1 root root 9 Jul 2 02:03 /dev/dsp -> sound/dsp
# Without devfs
$ ls -l /dev/dsp
crw------- 1 username audio 14, 3 Jan 1 1970 /dev/dsp
Q: OK, now I can hear sound, but noone can hear me speak!
Read the section above again - and make sure you have both read ® and write (w) permissions to the dsp device. To learn more about UNIX file system permissions, take a look at the chmod man page.
CODE
man chmod
Also verify that your sound driver supports "full duplex" - that is, if it can both play and record sound at the same time. A lot of OSS drivers do not support that, however most ALSA drivers do. Also, see below on how to configure KDE's sound system to use full duplex.
Q: Weee! Now I can listen to music and record my voice! But I still can't hear anything in Skype?
Are you using a desktop environment such as KDE or Gnome? Those both have "sound daemons" that take over control of the soundcard once it starts, and unless an application knows how to communicate with those sound systems they will not be able to use the sound device. Unfortunately, Skype will try to access /dev/dsp directly, instead of querying any running sound daemons. However, both Gnome and KDE have means to "redirect" such requests to the respective sound systems by launching uncooperative applications through a special wrapper - artsdsp for KDE and esddsp for Gnome.
CODE
# For KDE
artsdsp -m skype
# For Gnome
esddsp skype
In order for artsdsp to work correctly with Skype, you need to make sure that Full Duplex mode (see above) is enabled. Open up your controlcenter, select "Sound & Multimedia"->"Sound System". On the "Hardware" tab, check the box next to "Full duplex".
Please note that this checkbox will be enabled wether or not your soundcard actually supports full duplex operation. Enabling full duplex in the KDE sound system with some OSS drivers that do not support it, will make artsd crash horribly and possibly hang your computer. Needless to say, you might not want to do that,
Q: I have a USB headset - why doesn't Skype use it?
Please make sure you are running the latest version of Skype. Version 0.91.0.12 and up support using alternate DSP devices for sound IO, selectable from the "Hand/Headsets" tab in the Options dialog. Your primary soundcard will most likely be /dev/dsp, and any additional sound devices such as USB headsets will be /dev/dsp1, /dev/dsp2 and so on. If you have multiple USB devices (such as webcam mics) you may have more than one additional sound device. Please note that currently you cannot use separate devices for input and output, so make sure the device you are using supports both.
Q: Skype works now - but why is there a horrible echo?
This could be caused by a few things. First of all, using a microphone and loudspeakers is not a good idea, and might cause echo. You may still experience echo even if you are both using headsets. This is usually caused by something called the "Capture" channel - a channel present in some soundcards, and often enabled by default. Start up your mixer application, and verify that the "Capture" channel is muted. Good (input) mixer settings for Skype should look something like this:
An unmuted "Capture" channel can also cause bad sound quality and other artifacts, so always leave this muted.
Q: I have Skype working with artsd/KDE - but there is several seconds of latency/delay
There are two things you can do to reduce this delay. Open up your "sound system" config in Controlcenter and check two things:
o Is artsd running with realtime priority? If not, check the appropriate box. If you get an error message, you may need to set the SUID bit on artswrapper (make it run as root when launched). To do this, execute:
CODE
chmod +s `which artswrapper`
o Check your buffer settings ("Skip prevention"). A large sound buffer will cause more latency. Decreasing the buffer size may cause sound to skip when CPU loads go up, but running artsd with realtime priority should drastically reduce the chances of this.
Q: Additional notes about kernel and drivers
If you are having issues with your sound drivers or OSS emulation not working properly, there are a few things you can check. First of all, avoid the native 2.4 kernel OSS drivers if you can, especially for newer or less common sound cards. These drivers are all but obsolete and poorly maintained, and a lot of them do not support full duplex operation or even sound recording.
If you experience a lot of sound issues after building your kernel and drivers, it could be a good idea to disable support for ACPI (Advanced Configuration and Power Interface) when you are testing. ACPI support on some motherboard/BIOS setups is horribly broken, and the kernel ACPI drivers cannot work around this. The drivers are in themselves a bit experimental, which does not help the issue at all.
Common problems with ACPI is hardware not being detected properly, hardware performing erratically or even hanging the computer etc. I have personally worked with machines that would even crash and hang indefinitely during boot when ACPI was enabled. Disabling ACPI can be done at kernel compile time by disabling it, or at boot time by appending "acpi=off" on the boot prompt (LILO) or by editing the boot parameters (Grub). Disabling ACPI will have no adverse effects on a desktop computer, but you will not be able to monitor the onboard fan/temp sensors if you disable ACPI. On a laptop computer you might be a bit worse off though, since you will have no power management facilities.