HOWTO: Hear multiple sounds using both esd and ALSA

(taken from http://www.ubuntuforums.org/printthread.php?t=32063&pp=40)

These are the instructions on enabling software mixing, to avoid application problems like Audacity needing killall esd to work while another application is playing music.

(1) libesd-alsa0 should be installed (it already is in dapper)

(2) We need to create /etc/asound.conf, including the following lines:

pcm.card0 {
  type hw
  card 0
# mmap_emulation true
}

#pcm.dmix0 {
#  type dmix 
#  ipc_key 34521 
#  slave {
#    pcm "card0" 
#  }
#}

pcm.dmix0 {
        type dmix
        ipc_key 1024 ## needs to be a power of 2
        slave {
                pcm "hw:0"
                period_time 0
                period_size 1024
                buffer_size 8192
              # format S16_LE
                rate 44100 ## not necessary
        }
#slowptr true
}

pcm.dsnoop0 {
  type dsnoop 
  ipc_key 2048
  slave {
    pcm "card0" 
  #  rate 48000
  }
}

pcm.asym0 {
  type asym 
  playback.pcm "dmix0" 
  capture.pcm "dsnoop0"
}

pcm.pasym0 {
  type plug 
  slave.pcm "asym0"
}

# 'dsp0' is expected by OSS emulation etc.
pcm.dsp0 {
  type                  plug
  slave.pcm            "asym0"
}

ctl.dsp0 {
    type                hw
    card                0
}

pcm.!default {
  type                  plug
  slave.pcm            "asym0"
}

ctl.!default {
    type                hw
    card                0
}

(3) Also, we need to change /etc/esound/esd.conf contents so:

[esd]

auto_spawn=1

spawn_options=-terminate -nobeeps -as 2 -d default

spawn_wait_ms=100

# default options are used in spawned and non-spawned mode

default_options=

(4) Now we need to change ubuntu sound server to alsa (we can leave it ESD but we better use alsa because it has better sound handling): "gstreamer-properties" -- Change both (in the Audio Tab not the Video) from ESD to ALSA.

(5) All that's left now is to restart computer (after restart you must hear sound) to enable these changes. Also configure XMMS or Beep-media-player (or any player) to use ALSA instead of eSound/ESD. If you hear a strange sound, just change everything back to ESD. If everything worked correctly, now Audacity & Skype will work normally and all the program will play sound using either Alsa or ESD.

Notes


CategorySoftware

EnableSoftwareMixing (last edited 2011-04-08 15:13:23 by D9784B24)