How to use Skype with ALSA

From ArticleWorld


The Linux version of Skype does not work with ALSA by default, as it uses another sound layer. However, you can still use Skype with the ALSA subsystem, by using a slightly tweaked .asoundrc file.

Procedure

1. Install and configure ALSA normally, and make sure you are using dmix to allow more than one program to play sound.

2. Install Skype normally as well, either from your distribution's package repository or by downloading it from the Skype website.

3. Use your favorite text editor to open (or create if it does not exist) the file .asoundrc in your home folder and paste the following lines:

pcm.skype {
   type asym
   playback.pcm "skypeout"
   capture.pcm "skypein"
}

pcm.skypein {
   type route
   slave {
      pcm "skypedsnoop"
      format S16_LE
   }
   ttable {
      0 {0 0.5}
      1 {0 0.5}
   }
}

pcm.skypeout {
   # Just pass this on to the system dmix
   type plug
   slave {
      pcm "dmix"
   }
}

pcm.skypedsnoop {
   type dsnoop
   ipc_key 1133
   slave {
      pcm "hw:0,0"
      period_size 256
      periods 16
      buffer_size 16384
   }
   bindings {
      0 0
   }
}

4. In order to run skype, type the following command in a console window, or use it to create a new desktop or menu shortcut under KDE, Gnome or whatever you use:

ALSA_OSS_PCM_DEVICE="skype" aoss skype

Notes

Do note that Skype will block the mic input on the soundcard it uses. Therefore, you will not be able to record yourself while Skype is running. This seems to be Skype's problem and not the soundsystem's.