2 # Script to stop current pulseaudio and restart it in Jack mode
6 PROCESS
=`ps -e | grep pulseaudio`
7 if [ "$PROCESS" == "" ]; then
14 if [ ! -d ~
/.pulse
]; then
18 if [ ! -f ~
/.pulse
/client.conf
]; then
19 echo "autospawn = no" > ~
/.pulse
/client.conf
21 if (! cat ~
/.pulse
/client.conf |
grep "autospawn = no" > /dev
/null
); then
22 sed -i '/autospawn =/d' ~
/.pulse
/client.conf
23 echo "autospawn = no" >> ~
/.pulse
/client.conf
27 if [ ! -f ~
/.pulse
/daemon.conf
]; then
28 echo "rlimit-rttime = -1" > ~
/.pulse
/daemon.conf
30 if (! cat ~
/.pulse
/daemon.conf |
grep "rlimit-rttime = -1" > /dev
/null
); then
31 sed -i '/rlimit-rttime =/d' ~
/.pulse
/daemon.conf
32 echo "rlimit-rttime = -1" >> ~
/.pulse
/daemon.conf
38 echo "usage: $0 [command]
40 -p, --play Playback mode only
42 -h, --help Show this help menu
46 When runned with no arguments, pulse2jack will
47 activate PulseAudio with both playback and record modes.
53 FILE
=/usr
/share
/cadence
/pulse2jack
/play.pa
57 FILE
=/usr
/share
/cadence
/pulse2jack
/play
+rec.pa
61 if (IsPulseAudioRunning
); then
63 echo "PulseAudio is running, stopping it..."
67 if (IsPulseAudioRunning
); then
69 echo "Failed, force kill..."
70 pkill
-KILL pulseaudio
79 if (`pulseaudio --daemonize --high-priority --realtime --disallow-module-loading --exit-idle-time=-1 --file=$FILE -n`); then
80 echo "Initiated PulseAudio successfully!"
82 echo "Failed to initialize PulseAudio!"