Ajout script de démarrage jack et compagnie ainsi que script de connection clavier...
authorgobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Thu, 11 Nov 2010 19:57:22 +0000 (19:57 +0000)
committergobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Thu, 11 Nov 2010 19:57:22 +0000 (19:57 +0000)
ubuntu/jackd.sh [new file with mode: 0755]
ubuntu/lpk25.sh [new file with mode: 0755]

diff --git a/ubuntu/jackd.sh b/ubuntu/jackd.sh
new file mode 100755 (executable)
index 0000000..f4be56b
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+LOGFILE=${HOME}/Music/utils/jackd.log
+
+echo "Begin JACK startup script" > ${LOGFILE}
+
+PAPID=$(pidof pulseaudio)
+
+if [ -n "${PAPID}" ]; then
+    echo "pulseaudio running with pid ${PAPID}" >> ${LOGFILE}
+fi
+
+# arg 1: process name
+kill_process()
+{
+    local PID=$(pidof ${1})
+
+    if [ -n "${PID}" ]; then
+        echo "Stopping ${1}" >> ${LOGFILE}
+        kill ${PID}
+        sleep 1s
+    fi
+}
+
+# Kill all servers
+kill_process pulseaudio 1>> ${LOGFILE} 2>&1
+kill_process jackd 1>> ${LOGFILE} 2>&1
+kill_process timidity 1>> ${LOGFILE} 2>&1
+
+# The -preempt and -rt kernels are no longer being developed due to lack of
+# support. Focus has instead turned to the -lowlatency and -realtime kernels,
+# particularly for the the release of Ubuntu 11.04 Natty Narwhal. The long-term
+# goal is to have -lowlatency in the official Ubuntu repositories, while
+# maintaining -realtime in a dedicated PPA.
+#
+# jackd options:
+# -s, --softmode
+#     Ignore xruns reported by the ALSA driver.
+#     This makes JACK less likely to disconnect unresponsive ports when
+#     running without --realtime
+# -H, --hwmon
+#     Enable hardware monitoring of capture ports.
+# -z, --dither [rectangular,triangular,shaped,none]
+#     Set dithering mode.
+jackd --no-realtime -dalsa -p512 -dhw:0 -r44100 --hwmon --dither s 32e213 1>> ${LOGFILE} 2>&1 & 
+sleep 2s
+
+timidity -iA -Oj -B2,8 -EFreverb=0 1>> ${LOGFILE} 2>&1 &
+
+pulseaudio -DnF ${HOME}/.pulse/pulsejack.pa
+
+exit $?
diff --git a/ubuntu/lpk25.sh b/ubuntu/lpk25.sh
new file mode 100755 (executable)
index 0000000..8e77f94
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+LPK25=$(aplaymidi -l | grep LPK25 | awk '{ print $1 }')
+TIMIDITY=$(aplaymidi -l | grep TiMidity | awk '{ print $1 }')
+
+# It would be best to detect existing connection using "aconnect -i -l"...
+
+if [ -n "${LPK25}" ]; then
+    for t in ${TIMIDITY}; do
+        echo "Trying port $t"
+        aconnect ${LPK25} ${t}
+        if [ $? -ne 0 ]; then
+            # Check if port is already connected. If it is, exit with success.
+            if aconnect ${LPK25} ${t} 2>&1 | grep "Connection is already subscribed" 1> /dev/null; then
+                echo "Already connected"
+                exit 0
+            fi
+        else
+            # Success
+            exit 0
+        fi
+    done
+fi