Linux software audio mixing with FlightGear
FlightGear + Festival + TeamSpeak with software audio mixing on Linux
This article describes, with a soundcard that does not do hardware mixing, how you can run FlightGear with Festival for text-to-speech and running TeamSpeak, (and possible any other applications that use audio) at the same time, with ALSA software mixing (the "dmix" plugin).
The concept
It is simple. You want to get all the applications to use ALSA "dmix" plugin for PCM audio playback. According to ALSA, "dmix" plugin is enabled and used by default since ALSA 1.0.9rc2. Though it seems it does not work straight away for everyone.
There are a lot of pages on the net with different customized ALSA configuration (e.g. .asoundrc
) to use "dmix" by default. This article's approach is NOT to use any global or per-user configuration file setup, but simply per-application setup.
In general, for applications written with ALSA support, usually what you need is to get is to use the device "plug:dmix". For example, with the ALSA command line player aplay
, you run:
aplay -D "plug:dmix" test.wav
For applications which does not have ALSA support (i.e. using OSS), you have a few choices:
- aoss
- A wrapper script to run any application to use ALSA OSS.
- esd
- A software audio mixing daemon, typically shipped with GNOME.
- artsd
- Another software audio mixing daemon, typically shipped with KDE.
FlightGear to use ALSA
FlightGear uses OpenAL (via SimGear) for audio playback, and OpenAL has ALSA support.
To get OpenAL to use a particular ALSA device, put these in your ~/.openalrc
(define devices '(alsa)) (define alsa-out-device "plug:dmix")