#!/bin/bash # # by: gonX # # jackd helper # for use with mpd/mpc # # pauses mpd to close sound output # then starts jackd with pre-set command line # then unpauses mpd to reopen sound output # # that is unless jackd is already running, in which case it will: # kill jackd # unpause mpd # # this will obviously only work with a working mpd config that has both alsa/oss and jack set up to receive output # # this is really useful when I want to use software sound modeling, since I need jackd for that # # in the future I might make it so that it checks current status of mpd so it doesn't play no matter what (like it does now) # JACKBACKEND=alsa JACKOPTS='-r 48000 -p 160' if [ ! -e `pidof jackd` ]; then mpc pause > /dev/null && sleep 0.4s killall jackd #apparently mpd doesn't like it if you don't restart it first - I can't figure out why /etc/rc.d/mpd restart > /dev/null mpc toggle > /dev/null echo 'JACKD disabled' else mpc pause > /dev/null jackd -R -d $JACKBACKEND $JACKOPTS > /dev/null & sleep 0.5s && mpc play > /dev/null echo 'Enabled JACKD' fi