From 4281eb80b9dcf56ac2cc042daa312a38a9d453f1 Mon Sep 17 00:00:00 2001 From: gobo72 Date: Thu, 11 Nov 2010 19:57:22 +0000 Subject: [PATCH] =?utf8?q?Ajout=20script=20de=20d=C3=A9marrage=20jack=20et?= =?utf8?q?=20compagnie=20ainsi=20que=20script=20de=20connection=20clavier?= =?utf8?q?=20LPK25?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ubuntu/jackd.sh | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ ubuntu/lpk25.sh | 23 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100755 ubuntu/jackd.sh create mode 100755 ubuntu/lpk25.sh diff --git a/ubuntu/jackd.sh b/ubuntu/jackd.sh new file mode 100755 index 0000000..f4be56b --- /dev/null +++ b/ubuntu/jackd.sh @@ -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 index 0000000..8e77f94 --- /dev/null +++ b/ubuntu/lpk25.sh @@ -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 -- 2.20.1