1. Using independent sound cards

Note

In case you do not use devfs, you may need to create additional device files. Take a look at The Linux Sound HOWTO, for information on how to setup additional sound cards.

1.1. Using aRts daemon

We have to specify different sound devices for the different Xsessions/Displays. This is done by using the following options of aRts daemon (http://www.arts-project.org/):

  • By OSS-free sound driver:

    -D /dev/dsp[n]

    where n is the number of the sound card.

  • By Alsa sound driver:

    -a alsa -D hw:[n],0

    where n is sound card id.

Add these lines to your Window Manager start-up script (of course, with the proper arguments for your setup):

real_display=`echo $DISPLAY | sed "s/://" | sed "s/\..*//"`
case "$real_display" in
        0)
        artsd -F 10 -S 4096 -D /dev/dsp -s 5 -m artsmessage -l 3 -f &
        ;;
        1)
        artsd -F 10 -S 4096 -D /dev/dsp1 -s 5 -m artsmessage -l 3 -f &
        ;;
        2)
        artsd -F 10 -S 4096 -a alsa -D hw:4,0 -s 5 -m artsmessage -l 3 -f &
        ;;
esac
        

And at the end of the file:

artsshell -q terminate

Here is an example for /usr/X11R6/bin/startenlightenment:

#!/bin/sh
#   License: GPL

real_display=`echo $DISPLAY | sed "s/://" | sed "s/\..*//"`
case "$real_display" in
        0)
        artsd -F 10 -S 4096 -D /dev/dsp -s 5 -m artsmessage -l 3 -f &
        ;;
        1)
        artsd -F 10 -S 4096 -D /dev/dsp1 -s 5 -m artsmessage -l 3 -f &
        ;;
        2)
        artsd -F 10 -S 4096 -a alsa -D hw:2,0 -s 5 -m artsmessage -l 3 -f &
        ;;
esac

/usr/X11R6/bin/enlightenment
artsshell -q terminate
        

This will start 3 aRts daemons for 3 X servers.

  1. Daemon will use the first OSS sound device for the 1st X server.

  2. Daemon will use the second OSS sound device for the 2nd X server.

  3. Daemon will use the Alsa sound device for the 3rd X server (requires feedback).