################################################################# # # # PCM output devices # # # # Define pcm output devices using dmix for mixing and # # the appropriate hardware device for output. In most # # cases there will only be one here but if you have a # # second sound card or USB headset then you can define # # more. # # # ################################################################# # First sound card uses hw:0,0 as the output device pcm.output_main { type dmix ipc_key 1024 ipc_perm 0666 slave { pcm "hw:0,0" period_time 0 period_size 1024 buffer_size 8192 #rate 8000 } } # Use only the first two channels for dmix bindings { 0 0 # from 0 => to 0 1 1 # from 1 => to 1 } ################################################################# # # # PCM input devices # # # # Define pcm input devices using dsnoop for mixing # # and the appropriate hardware device for input. In # # most cases there will only be one here but if you # # have a second sound card or USB microphone or headset # # then you can define more. # # # ################################################################# # First one for the first sound card pcm.input_mic { type dsnoop ipc_key 2048 slave.pcm "hw:0,0" } # Then one for the second sound card, which is my case # is a USB microphone which I use with Skype. pcm.input_usbmic { type dsnoop ipc_key 2049 slave.pcm "hw:1,0" } ################################################################# # # # Asym devices # # # # Sometimes you don't want to use the inputs and outputs from # # the same card at the same time. Here I define some asym # # devices to allow this. # # # ################################################################# pcm.asym_main_mic { type asym playback.pcm "output_main_control" capture.pcm "input_mic" } pcm.asym_main_usbmic { type asym playback.pcm "output_main_control" capture.pcm "input_usbmic" } ################################################################# # # # Hardware control devices # # # # These devices allow ALSA to control various aspects of the # # sound cards. Below are simple mixer definitions for two # # devices. # # # ################################################################# ctl.mixer0 { type hw card 0 } ctl.mixer1 { type hw card 1 } ################################################################# # # # Volume controls # # # # Here we will define some SoftVol controls # # # ################################################################# pcm.output_main_control { type softvol slave.pcm "output_main" control { name "All" card 0 } } # One for the default output from things that # we haven't or can't configure pcm.default_control { type softvol slave.pcm "asym_main_mic" control { name "PCM" card 0 } } # One for music output from things like xmms pcm.music_control { type softvol slave.pcm "output_main_control" control { name "Music" card 0 } } # One for video output from things like xine/mplayer pcm.film_control { type softvol slave.pcm "output_main_control" control { name "Film" card 0 } } # One for the system output such as Gnome pcm.system_control { type softvol slave.pcm "output_main_control" control { name "System" card 0 } } ################################################################ # # # Default ALSA devices # # # # Default pcm devices should use our asymetric device too # # # ################################################################# pcm.!default { type plug slave.pcm "default_control" } pcm.default { type plug slave.pcm "default_control" } # Custom plug devices pcm.music { type plug slave.pcm "music_control" } pcm.film { type plug slave.pcm "film_control" } pcm.system { type plug slave.pcm "system_control" }