1

Building a media server on the Pi using MPD it would be nice id shairport could be used to override the currently running mpd stream just like it does not AppleTV. To do that, I'm trying to use the shairport play_prog/ stop_prog commands to issue mpc play/ stop commands. however, mpd keeps playing.

I've modified /etc/init.d/shairport like this:

DAEMON_ARGS="-w $PIDFILE -a AirPi --play_prog=\"mpc stop\" --stop_prog=\"mpc play\""

Is this the correct way to achieve shaiport/mpd coexistance?

1

Regarding my question, my mistake was that I had tried to add the start_prog/ stop_prog parameters to the DAEMON_ARGS which is not the right place. They should go into the start section of the service control script like this:

start() {
    echo -n "Starting shairport: "
    start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
    --exec "$DAEMON" -b --oknodo -- $DAEMON_ARGS \
    --apname="AirPi" --play_prog="/etc/init.d/squeezeslave stop" \
    --stop_prog="/etc/init.d/squeezeslave start"
    log_end_msg $?
}
0

Take a look at this project: PiFi Mini - tutorial

1
  • Instead of just providing only a link, it would be nice to get at least a summary and a hint on what to do. Link answers are discouraged, afaik.
    – Arne
    Jun 11 '13 at 12:58
0

Take a look at this thread on actual examples on how to stop MPD via mpc client, from shairport using the start/stop command. http://volumio.org/forum/shairport-and-mpd-won-get-along-t332.html

Now, I wonder how to do the reverse.. i.e. stop/pause shairport when MPD plays... I found this script but I am not aware of any command I can use on shairport to stop or pause its playback. https://bbs.archlinux.org/viewtopic.php?id=148421

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.