Jackd

template jackd

Most often a computer has multiple soundcards with independent clocks sources.

resolution is to run a jackd instance per indepently clocked sound entity.

define a environment based pcm in ~/.asoundrc

This can call hw: pcms set in the environment or others defined in asoundrc if useful to shuffle audio channels to put them in order.

Call it from ~/.jackdrc so that it uses the environment

Define a sub-pcm for the p9d ws onboard...

... and an m-audio m2496 pci card

startup some jackd

suppose alsaplayer connects to the p9d jackd, since subsequenct jackd attached to a running pulseaudio misbehaved, next best things is to loopback the sound between the clocking islands:

It is possible to swap p9d with sp2dif in the examples if the latter sounds better.

Jackd for OpenAL (Such as ut2004)

Two files in the home directory allow openal applications like unreal tournament 2004 to be used with jack, and so with ALSA cards that do not really have their own mixer.

cat >> ~/.openalrc << EOF
(define devices '(alsa native))
(define alsa-device "plug:SLAVE=jack")
EOF

cat >> ~/.asoundrc << EOF
pcm.jack {
        type jack
        playback_ports {
                0 alsa_pcm:playback_1
                1 alsa_pcm:playback_2
        }
        capture_ports {
                0 alsa_pcm:capture_1
                1 alsa_pcm:capture_2
        }
}
EOF

Use Jack / ALSA for festival output

(Parameter.set 'Audio_Method 'Audio_Command)
(Parameter.set 'Audio_Required_Format 'riff)
(Parameter.set 'Audio_Command "aplay -q -D plug:SLAVE=jack $FILE")

Goes in /etc/festival.scm

#!/bin/sh
mkfifo ~/.ut2004/System/speech
while true
do
        cat ~/.ut2004/System/speech | while read
        do
                echo -ne "(SayText \""
                echo -n $REPLY | sed 's/\\/\\\\/g
                s/\"/\\"/g'
                echo -e ".\")"
        done
done | festival

This can now be used to provide a speech device instead of the other method involving a speechd for ut2004