I am afraid I haven't tried that and have no way of testing it. You could try this
aplay --list-devices
**** List of PLAYBACK Hardware Devices ****
card 0: IXP [ATI IXP], device 0: ATI IXP AC97 [ATI IXP AC97]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: IXP [ATI IXP], device 1: ATI IXP IEC958 [ATI IXP IEC958 (AC97)]
Subdevices: 1/1
Subdevice #0: subdevice #0
The s/pdif one is the IEC958 one I understand. Then follow instructions similar to these for each app you want to use (which I stole and modified from
http://www.flaterco.com/kb/audio.html )
"
Add the following function to your ~/.bashrc or ~/.bash_profile, substituting card and device numbers as appropriate, and you will be able to play a sound file from the command line by typing play soundfile.xyz. (The extra logic in this function is needed because the first sox command fails if the sample rate is already 48 kHz.)
function play {
{ sox $1 -r 48000 -t wav -c 2 - polyphase || sox $1 -t wav -c 2 -; } | aplay -Dhw:0,1
}
The above examples work as of aplay version 1.0.8, sox version 12.17.6 and bash version 3.00.15(2)-release.
#
To get xine to use S/PDIF, do the following settings under right click → Settings → Setup.
* Gui tab: set Configuration experience level to Advanced or higher.
* Audio tab:
o Set device used for mono output (device.alsa_default_device) to iec958.
o Set device used for stereo output (device.alsa_front_device) to iec958.
o Set device used for 5.1-channel output (device.alsa_passthrough_device) to iec958.
o Ignore the other "device used for 5.1-channel output" (device.alsa_surround51_device).
o Set speaker arrangement to Pass Through.
That works as of xine version 0.99.3.
"
You could presumably change the alsa config so that every app plays through digital out by default.
Let me/us know how you get on.
Raphael