Audio setup

From Ekiga
(Difference between revisions)
Jump to: navigation, search
(Troubleshooting)
(How to set up ?)
Line 23: Line 23:
  
 
<pre>
 
<pre>
# Useful so that all settings can be changed to a different card here.
 
 
pcm.snd_card {
 
pcm.snd_card {
type hw
+
        type hw
card 0 #Assume your sound card is 0
+
        card 0
 
}
 
}
  
# Allow mixing of multiple output streams to this device
 
# Dmix resample all streams to 48000 Hz (see the line below "rate 48000")
 
# You can try 44100 but downsampling sound from 48000 (ie. from a DVD) unfortunatelly
 
# does'nt work wery well (there are some syncronization problems with some players).
 
 
pcm.dmixer {
 
pcm.dmixer {
type dmix
+
        type dmix
ipc_key 1024 #This must be unique
+
        ipc_key 1024
slave.pcm "snd_card"
+
        slave.pcm "snd_card"
slave {
+
        slave {
# This stuff provides some fixes for latency issues.
+
                period_size 256
# buffer_size should be set for your audio chipset.
+
                buffer_size 2048
period_time 0
+
                rate 44100
period_size 1024
+
        }
buffer_size 4096
+
rate 48000
+
+
}
+
 
+
bindings {
+
0 0
+
1 1
+
}
+
 
}
 
}
  
# Allow reading from the default device.
 
# Also known as record or capture.
 
# While the Dmix plugin is for mixing multiple output(playback) streams together,
 
# if you want to use multiple input(capture) clients you need to use the dsnoop plugin
 
 
pcm.dsnooper {
 
pcm.dsnooper {
type dsnoop
+
        type dsnoop
ipc_key 2048
+
        ipc_key 2048
slave.pcm "snd_card"
+
        slave.pcm "snd_card"
 
+
# Possible artsd full duplex fix:
+
    slave {
+
          period_time 0
+
          period_size 1024
+
          buffer_size 4096
+
  rate 48000
+
    }
+
  
bindings {
+
        slave {
0 0
+
                period_size 256
1 1
+
                buffer_size 2048
}
+
                rate 44100
 +
        }
 
}
 
}
  
# This is what we want as our default device
 
# a fully duplex (read/write) audio device.
 
 
pcm.duplex {
 
pcm.duplex {
type asym
+
        type asym
playback.pcm "dmixer"
+
        playback.pcm "dmixer"
capture.pcm "dsnooper"
+
        capture.pcm "dsnooper"
 
}
 
}
  
# Setting the default pcm device using "plug" allows
 
# the conversion rate to be selected on the fly.
 
# duplex mode allows any alsa enabled app to read/write
 
# to the dmix plug.
 
 
pcm.!default {
 
pcm.!default {
type plug
+
        type plug
slave.pcm "duplex"
+
        slave.pcm "duplex"
 
}
 
}
 
</pre>
 
</pre>
  
Just copy those lines in your editor and save it under the name .asoundrc in your home.
+
Just copy those lines in your editor and save the file under the name .asoundrc in your home directory.
  
 
Now you should be able to have several applications using the sound card at the same time. You may need to restart them.
 
Now you should be able to have several applications using the sound card at the same time. You may need to restart them.

Revision as of 20:26, 15 May 2006

Contents

What can you expect ?

After setting your GNU/Linux system as following, you can listen music or watch a movie and you will heard Ekiga ringing.


What do you need ?

This documentation will show you how to setup the Advanced Linux Sound Architecture (ALSA) to achieve this goal using the Dmix plugin and the Dsnoop plugin. It provides for direct mixing of multiple audio streams.

ALSA is now shipped with the Linux kernel.

Note : For ALSA 1.0.9rc2 (Linux kernel 2.6.12) and higher you don't need to setup Dmix. Dmix is enabled as default for soundcards which don't support hardware mixing. To get ALSA version : $ cat /proc/asound/version. Even in this cas, following the instructions below will help tuning it or you can try configure Ekiga to use the "Default" of ALSA -which should use Dmix- as explained in the next chapter "How to set up ?" -> Ekiga.

How to set up ?

  • ALSA

To setup ALSA using Dmix you have to create a file .asoundrc (the dot is important) in your home ($HOME/.asoundrc) or for a system wide configuration create this file : /etc/asound.conf

Here is an exemple .asoundrc know to work in some cases. But I do not provide warranty for all hardware... Just try it !

pcm.snd_card {
        type hw
        card 0
}

pcm.dmixer {
        type dmix
        ipc_key 1024
        slave.pcm "snd_card"
        slave {
                period_size 256
                buffer_size 2048
                rate 44100
        }
}

pcm.dsnooper {
        type dsnoop
        ipc_key 2048
        slave.pcm "snd_card"

        slave {
                period_size 256
                buffer_size 2048
                rate 44100
        }
}

pcm.duplex {
        type asym
        playback.pcm "dmixer"
        capture.pcm "dsnooper"
}

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

Just copy those lines in your editor and save the file under the name .asoundrc in your home directory.

Now you should be able to have several applications using the sound card at the same time. You may need to restart them.

Note : Be sure all the audio aplications are using ALSA as a sound system and "Default" as device.

  • Ekiga

Now you have to setup Ekiga acordingly.

Go to the menu Edition -> Preferences -> Devices -> Audio Devices
- Select "ALSA" as the audio plugin
- Select "Default" as output
- Select "Default" as input

Then go to the menu Edition -> Preferences -> General -> Sound Events
- Select "Default" as alternate device output

The "Default" will use the configuration provided by your .asoundrc

That's all. Enjoy.

Troubleshooting

  • Choppy sound using default dmix configuration or dmix crashes Ekiga ?

ALSA version 1.0.11 bug: DMIX crashes Ekiga. To check your version : $ cat /proc/asound/version.

There is some workarounds, but none seems to work for everybody. My advice is to downgrade to version 1.0.10 until this bug is fixed. Or you can setup Ekiga to use directly your sound card instead of "Default", but you won't be able to use Ekiga and another sound application at the same time.

Feedback

Concerns or Compliments?

Please join the Ekiga users mailling list (don't be confused by the "gnomemeeting" word, this is history...) or join us on IRC : irc.gnome.org/6667 channel #ekiga

Yannick

Personal tools