Sound output
On GNU/Linux PyTraffic allows for the selection of some common
sound output devices (via the "Settings" menu). Don't bother with this
if things work for you. Note that you have to restart PyTraffic for
any changes to take effect.
-
Default: Leave the selection of the output device to
the underlying SDL library.
- OSS: The "Open
Sound System", the standard sound system on GNU/Linux and other
Unix variants. It does not allow for multiple applications to share the
sound card.
- Alsa: The "Advanced Linux Sound
Architecture", the default in the 2.6 kernel. Alsa allows for multiple
applications to share the soundcard in a lag free manner
(see here
or below), but curiously
this does not seem to be enabled by default on modern linux distributions.
Hopefully this will change things.
Instead of dealing directly with the underlying sound system a safe
and convenient solution is to select a sound server as output device.
Unfortunately sound servers tend to create lag...
-
Artsd: The "Advanced
Real Time Synthesizer Daemon". The default on KDE. Seems to be very
laggy.
- Esd: The
"Enlightenment Sound Daemon". The default on Gnome. Seems less laggy.
Case study
Currently what works best for me is the dmix plugin for alsa.
This is my .asoundrc file:
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
}
ctl.dmixer {
type hw
card 0
}