Airplay Whole House Audio with Shairport-Sync and Forked-Daapd

Yeah, I was wondering the same thing! I don’t know the subtleties that distinguish hassio addons from traditional docker containers???

Thanks for the write up. I might give this a go.

Do you guys reckon it would work with Modipy? I’d like to connect to soundcloud and stream to airplay devices.

There are very few differences between a hass.io addon and a docker container. It’s basically a docker container with a proprietary public config file which does essentially what a docker compose config does, and another private config by the developer to set the options they don’t want to expose. The container technology itself is just docker, nothing more.

@currest2620 have never tried mopidy, but it sounds like something that would be integratable. The addon already has airplay streaming, Spotify and last.fm scrobling so maybe they already rolled it in.

Thanks. I don’t think forked-daapd has support for Soundcloud as far as I can see.

I’m not too sure how it all fits together TBO. I gather that forked-daapd is needed to stream audio to airplay devices such as a HomePod. I’m not sure what shairport-sync does or how to integrate mopidy as a source.

I think it can be done though.
http://recycledspace.com/2018/04/my-music-setup-at-home-with-mopidy-forked-daapd-and-shairport-sync.html

As I understand it, shairport-sync was designed primarily to act as an airplay receiver/speaker so you can send airplay audio to a linux computer hooked-up to a speaker. I don’t use it for this primary purpose, but I could attach a speaker to my rpi4 and it should work as any airplay speaker.

shairport-sync also has the interesting ability to “pipe” audio to compatible programs that are able to receive the pipe, such as forked-daapd. Select the shairport-sync “airplay speaker” from your iOS/iPadOS/tvOS/iTunes audio app and forked-daapd treats the pipe like a song and it can be sent to multiple airplay devices, similar to how itunes works on windows or mac.

Mopidy may be able to create a similar audio “pipe” as shair-port sync. If this is the case, forked-daapd would connect to the mopidy pipe and send the audio to your airplay speakers.

2 Likes

OK, the way I read that is shairport-sync is needed to stream audio to existing airplay devices on the local network, while forked-daapd emulates itunes.

So if I want to use mopidy instead, I don’t need to install forked-daapd.

-or-

forked-daapd can stream to existing airplay devices so it IS needed to stream content and I DON’T need to install shairport-sync.

-or-

I need both forked-daapd AND shairport-sync to stream to multi-room devices simultaneously (IF audio devices DO NOT support airplay 2).

Forked-daapd acts like itunes, so it can send audio (songs, playlists, internet radio web links…) to multiple airplay speakers on its own. I mention the use of shairport-sync only as a way to output audio from iOS apps to multiple airplay 1 speakers.

1 Like

Right, that makes sense. I think I’m misunderstanding the roles of music servers, streamers and DACs.

I think I’ll give this a go this afternoon. Just as an aside, I have a media folder that is used with the Media Browser in Home Assistant. Could that folder be used instead of the “music” folder in the docker config?

If so, can I assume that it’s path would be /mnt/data/supervisor/share/media:/media?

Thanks for the write up.

Use these as the volumes

- /mnt/data/supervisor/share/daapd:/config
- /mnt/data/supervisor/media:/music
1 Like

Thanks very much. Wasn’t very sure about the syntax.

Hey, just wanted to say thanks. I following your instructions and it appears to be working. Looking forward to seeing what I can do with it. Would never have been able to do that without your instructions. Thanks a bunch.

Quick question though. When I access the daapd server on port 3689, I keep getting a remote paring request from pyatv when ever I load the server page. Not really sure where this is coming from, but its the same IP address as the HA server and seems to be associated withe daapd server. If I load the apple TV integration, the dialogue shows “Aborted, Unexpected error”.

From the daapd server:

Apple TV integration:

Any ideas about what to do about this? Where do I obtain the pairing code?

*** Fixed after I restarted Home Assistant ***

2 Likes

Hey, does anyone else find the forked-daapd gets ‘stuck’ on the shair port stream / input? I’ve tried clearing the queue and removing it but when is select another track it just goes back to shair.

I find I have to go to portainer and restart the forkeddaapd and shairportsync containers to reset it.

Anyone else encountered this and/or has a way to clear the queue so it’ll play selected tracks? Not a biggie, but maybe I am missing something.

The only time mine ever got stuck was when I gave it bad playlist names. Other than that, it’s rock solid. But I use standard airplay devices, not shairport.

I started to have problems (requiring a restart of the forked-daapd and shairport-sync containers from time to time) after one of the Home Assistant OS updates.
I have switched to using a Debian 10 install of Home Assistant Supervised on my RPI4 and all is working well. This is a bit of work to switch from Home Assistant OS to Debian, so you will have to decide if it is worth it.

I now also switched to this method via Portainer, now that the addon no longer works. Thanks for the instructions! One question I still have: how to update forked-daapd to a newer version (in case it’s available)?

Here’s what I do to update, but I am not sure if it is the best way, using portainer:

  1. In “Containers” remove the forked-daapd container
  2. In “Images” remove the forked-daapd image
  3. In “Stacks” select forked-daapd, go to the “Editor” tab and click the “Update the stack” button

This will pull the latest version of the image from the repository, in this case it is the version at linuxserver/daapd, you can check the latest version at:

1 Like

OK, but its specifically related to the shairport input. Same happens when attempting to select another playlist or track directly within the forked-daapd web interface. It’s not a biggie, something I’m just wondering about.

I have HA running in a proxmox virtual machine on an intel nuc, pretty keen to stay with that.

Thanks for the tutorial.

I’m trying to build a setup around Airplay, Spotify, local music files and a mobile front-end.

The elements would be:
1 - Media server that can combine local files with Spotify (and possibly other streams / services)
2 - forked-dappd (now owntone-server to stream to AirPlay speakers
3 - A Mobile front end to control media and playing (an MPD client or apple’s remote iTunes app)

One options is to use mopidy + Mopidy-Spotify as an spority + local integrated music server AND slimmed down version of owntone-server - without the iTunes library or mpd server. In this setup we need to stream from mopidy to forked-dappd but I’m not sure the MPD clients or the remote iTunes app could mange changing streams / speakers.

Another option is to build around the full forked-dappd installation as the music server and integrated Spotify somehow (any ideas how to??) and use the remote iTunes app as a client using this script (un-tested)

Thoughts ???
Happy to work on something like this with you if you like.

Nadav