There are probably about two major types of ALSA implementations, 1) People having a sound card and outputting analog signals directly to speakers and 2) those outputing through S/PDIF (or HDMI) of their sound cards to a home stereo system.
In both the previously mentioned layouts, sound can only be played from one source at a time! The only method an operating system (or ALSA or Pulse audio or Windows' KMix layer) can successfully play sound from more than one source (or application) at a time, is by mixing and sometimes resampling the sounds trying to play all at once! (ie. See Windows configuration GUI for "Speakers Properties > Advanced > Select the sample rate ... when running in shared mode." or a more indepth description is reading Microsoft Windows' KMix "Policy for Mixing Audio Streams..." .) For audiophiles whom enjoy listening to music or those people only wanting to hear sound or music coming from one application at a time, this "mixing" is basically considered a sin. ALSA users simply avoid this (additional software mixing action) by simply adding something similar to the following clipping within their asoundrc file:
- Code: Select all
pcm.!spdif {
type hw
card 0
device 1
}
pcm.!default
{
type plug
slave
{
pcm "spdif"
}
}
From memory, the above prevents ALSA from remixing any sound coming from any other applications producing sound. (ie. You are listening to some wonderful classical music, and while browsing some annoying advertisement pops-up some sound producing advertisement, and this will prevent additional noise from interrupting your music. Or you're an audiophile and don't want any remixing of your music.)
If I'm not mistaken, the above simple disables DMix, whereas the default is to use DMix by default. (ie.
http://alsa.opensrc.org/Dmix)
Aside from what is considered basic, from an ordinary user never fussing with S/PDIF then this would be considered extravagant as the asoundrc file format is similar to C programming/shell syntax. Those using S/PDIF (or HDMI) or accustomed to messing with the asoundrc, this would be considered the very basics.
Typically, applications (ie. aplay or mplayer) will allow using or specifying additional plugins or devices specified within the .asoundrc file. (Devices shown by "aplay -L".) However, I have yet to see if FlightGear allows this, as the FlightGear graphical front-end only shows "aplay -l" devices. You'll likely encounter this issue once you've decided to start using S/PDIF and enjoying classical music as I have. HDMI audio is also a form of S/PDIF.
I think
http://wiki.flightgear.org/Linux_softwa ... 3F_ALSA.3F touches on some issues with using these additional plugins within the asoundrc file. (ie. aplay -D plug:duplex test.wav, and aplay allows specifying an additional audio device from the list provided by aplay -L.)
Another relevant thread is here:
http://www.mail-archive.com/flightgear- ... 24713.htmlSeems FlightGear uses OpenAL (or SDL) on Linux for outputting sound. PulseAudio maybe able to itemize SDL output, but most audiophiles do not enjoy working with Pulse Audio due to Pulse Audio being more complicated than ALSA.
More research,
http://ehc.ac/p/alsa/mailman/message/15529893/Maybe doing something like this?
$ export SDL_AUDIODRIVER=alsa AUDIODEV=plug:dmix /usr/games/bin/fgfs
Anyways, I've run-out of time for testing and have written plenty for those researching & finding this similar issue. I'll follow-up with my results a little later if possible.
2014.04.21: NOTE -> It would appear FlightGear is not using SDL for audio output and is instead using OpenAL for audio/sound interfacing. And as such, "$ ALSOFT_LOGLEVEL=3 fgfs"!