mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.27k stars 573 forks source link

starting pipe? #323

Closed jmp909 closed 8 years ago

jmp909 commented 8 years ago

Hi @mikebrady

I managed to get shairport-sync outputting a Pipe (at /srv/music/airpi) over to forked-daapd which pick it up as a playable stream , meaning I can use iOS remote app to beam to multiple speakers at once.

This works really well, but I had trouble creating the pipe. I had to put this in my /etc/init.d/shairport-sync script with the pipe explicitly named

start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -d -o pipe -- /srv/music/airpi || return 2

should the pipe not automatically get created when i specify it in the config file? unless I'm doing something wrong?

pipe =
{
  audio_backend_latency_offset = 0; 
  audio_backend_buffer_desired_length = 44100; 
  name="/srv/music/airpi";
};

it's looking correct now though but i'm not sure how I got there: prw-r--r-- 1 root root 0 Jun 7 20:26 /srv/music/airpi

thanks j

jmp909 commented 8 years ago

sorry. maybe an older version didn't work maybe. this actually seems to work on reboot now

/etc/init.d/shairport-sync start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -d -o pipe || return 2

I'll close the issue but leave the info here for anyone looking.

as long as the pipe file permissions have that "p" in front (ie it's properly created as a linux pipe), then it should show up in forked-daapd as an untitled album / untitled artist with the song name "airpi" in this case

thanks J.

mikebrady commented 8 years ago

Thanks for this. If Shairport Sync can't create the pipe, it will die and leave a message in the log file Could not create output pipe "pipename". A thing that often causes problems is not having the necessary permissions. If Shairport Sync is running as a daemon on a System V system – like you seem to be using – then it will run as root, so no problems. But if it's running in a systemd system, it runs as user shairport sync and may not have permission to create a pipe.