You need to try forked-daapd if you are an iTunes user, Airplay user, or interested in playing local music

Thanks, I’ve posted that on this tread.

Also, have you been able to get the media_player.play_media to play a specified playlist or track? I’ve set up the custom:mini-media-player card in lovelace and I can play content from there, but not with the media_player integration. Can this be scripted to play a specific track?

The forked-daapd integration talks about named pipes. I’ve set autostart pipes, but the intergration says it should be named “librespot-java”. Do you know how this should be renamed? Don’t see an option for its name in the forked-daapd.conf file.

Yes, I can play playlists. I haven’t tried individual tracks. I don’t think it supports it. To play a playlist you need to select it as a source as below:

action:
  service: media_player.select_source
  data:
    entity_id: media_player.forked_daapd_server
    source: "radio2 (playlist)"

Then you have to tell the media player to play (this is a bit weird, my other media players don’t need 2 steps like this, but this is how it’s done with forked-daapd). That’s done like this:

action:
  service: media_player.media_play
  data:
    entity_id: media_player.forked_daapd_server

I haven’t tried doing anything with named pipes. It wasn’t needed for anything I wanted to do. If you use the addon and built in integration you can do airplay, itunes playlists, chromecast, spotify, etc… all without touching them. But if you get them working, let me know what they are useful for :slight_smile:

Awesome, it works! :clap::clap::clap:. Happy to use playlists.

Not sure about named pipes either TBO. I’m still learning about how all this stuff works. I’d like to explore the possibility of piping audio from mopidy at some stage as it has a soundcloud plug in.

Sorry for asking so many questions. You mentioned the shuffle capability works out of the box. Can you tell me how that works?

@scstraus thank you for your comprehensive guide!

The forked-daapd integrations does not set up for me, saying i gave the wrong password for the API. The API password actually is the password for the library that you also would need to give in the Apple Music App. I have NOT setup a password for this, so I leave the password field on integration setup empty. The forked-daapd log file gives [ LOG] httpd: Web interface request to '/api/config' denied: Incorrect password so the integration seems to send something weird to forked-daapd, as the other clients (macOS Music App, iOS Remote App) have no problems connecting to my forked-daapd.

Anyone else having this problem? Any ideas?

IIRC I had this problem too and just solved it by setting a password for the library.

I posted question about individual tracks question on another thread. There is a ‘forked’ forked-daapd integration that sacrifices TTS for the ability to play individual tracks.

Also, I’ve found the shairport-sync thing pretty handy in the end. I can play my soundcloud tracks and output the music to the shairport-sync and in turn out via the forked-daapd speakers without losing the functionality I am getting by being able to control them via home assistant.

1 Like

Password on library is not an option for me as it breaks other use cases

I will try to double check next time I get a chance.

For testing I set a password and deleted the DB and cache and did a fresh restart. Lo and behold, the apps do not ask for a password and do work and the HASS integration still fails with “incorrect password”. Seems like my forked-daapd does not properly set a password for the API. The config extract looks like this:

library {
	name = "mydaapd"
	port = 3689
	password = "test"
	directories = { "/music" }
#	follow_symlinks = true
	podcasts = { "/music/Podcasts" }
	audiobooks = { "/music/Audiobooks" }
	compilations = { "/music/Various Artists" }
#	compilation_artist = ""
#	hide_singles = false
#	radio_playlists = true
#	name_library    = "Library"
#	name_music      = "Music"
#	name_movies     = "Movies"
#	name_tvshows    = "TV Shows"
#	name_podcasts   = "Podcasts"
#	name_audiobooks = "Audiobooks"
#	name_radio      = "Radio"
	artwork_basenames = { "artwork", "cover", "Folder" }
	artwork_individual = false
	filetypes_ignore = { ".db", ".ini", ".db-journal", ".pdf", ".metadata" }
#	filepath_ignore = { "myregex" }
	filescan_disable = false
	itunes_overrides = false
	itunes_smartpl = yes
#	no_decode = { "format", "format" }
#	force_decode = { "format", "format" }
#	pipe_autostart = true
#	rating_updates = false
}

This is so frustrating.

OK, this is embarassing: the password to be used is the Web UI admin password, NOT the library password!

Ah actually I didn’t add a password, I commented out the password line in the config file. It should look like this:

        # Password for the library. Optional.
#       password = ""

But it seems that you got it figured out anyway.

well, as mentioned, the library is not used by HASS, it seems to be using the admin API / admin password to operate.

I have researched how I could create a multi room sound system from available smart speakers, I do not want to build something on my own based on RPi+Hifiberry+Speakers. So snapcast is out of the picture and forked-daapd seems to be the best solution so far, as it supports Airplay and Chromecast.

One feature is important to me for a multi room sound system: the speakers should be able to
(a) simultaneously play different play lists in each room, and
(b) simulateneously play the same stream synchronously in all rooms

Does that work with forked-daapd combined, lets say with Apple/Ikea Simfonisk smart speakers or Apple HomePod speakers?

For this forked-daapd would nee to be able to stream AirPlay2 (not only AirPlay1), right? Is it able to do that?

Does the synchronized multiroom streaming work well in practice?
How would one model this in HASS/lovelace to place the same stream synchronized on all speakers?

In pretty new to this whole audio thing, so take this with a grain of salt. I have recently got forked-daapd and shairport-sync setup and I am happy with the results.

Not unsure about ‘simultaneously play different play lists in each room’, but it does ‘simulateneously play the same stream synchronously in all rooms’. For me, I am using a combination of homepod, speakers attached to an airport express and an audiocast device. All seems in sync as far as I can tell.

I think you will find that forked-daapd uses the original airplay standard (not airplay 2). I don’t think there are any open source airplay 2 systems out there as airplay 2 is a closed protocol that hasn’t been ‘reverse engineered’ yet. Still, the program manages to sync the end devices quite will as far as I can see.

In terms of integration, there is an forked-daapd integration that will pull into hacs all the media players associated with the installation for forked-daapd. From there, they can be automated / displayed in lovelace.

I find it works very well.

Hope that’s useful.

@currest2620 thank you for your feedback, that helps. I also found some bits and pieces and I have questions for you. Lets start:

As the receivers you are using are all glued-up customer devices I assume that you are using shairport-sync not as a stream receiver for a speaker, but rather as a stream receiver for forked-daapd to be able to use an AirPlay capable source such as an iPhone as input for forked-daapd to be able to stream from an iPhone via forked-daapd to the AirPlay receiver speakers (instead of streaming directly from the iPhone to the Airplay receiver speakers). Is that correct? Then what is the advantage of going via forked-daapd? In any case, could you go deeper into that setup, what is talking to what and could you link a how-to where you found how to set shairport-sync up together with forked-daapd?

The forked-daapd author says that playing different streams does not work simultaneously.

The forked-daapd author says that forked-daapd recently supports AirPlay2.

I found the builtin forked-daapd that comes with HA Core, and the mini-media-player in HACS, I don’t know mean by “all the media players” from HACS, could you please elaborate?

I can confirm this. To play multiple streams simultaneously, you’d need multiple instances of Forked-DAAPd, and you could use one for each stream. I’ve never tried this though.

I can confirm that I use both airplay 1 and airplay 2 devices and can sync the audio perfectly between them. I just tested adding a chromecast to the mix, and can confirm that it will not sync with the airplay devices, at least when run through an HDMI switch to a TV. Maybe it has to do with latency in my setup… I never really tried to make this work properly… I don’t have 2 chromecasts to try if they will sync with each other. But you can at least send audio to them if you need to.

As for how it would be done in lovelace, you just need a media player for the forked-daapd and others for each of the speakers you want to play to. You can see my config here. Here’s a link to the latest config for my music with forked daapd in lovelace, it’s a bit more recent than what’s screenshotted there which was based on the iTunes integration, but same general concept.

Yes, but as I understand it forked-daapd actually uses airplay 1, but syncs them as thought they are airplay2 (that is my understanding about supporting airplay2 instead of actually streaming it). In my case, I have devices with both airplay 2 (the HomePod & airport express) and those without (audiocast uses airplay 1). I can also output audio to the Cromecast speaker, though I don’t.

I use the shairport-sync as a way to inject audio into the forked-daapd server. In my case, it’s the only way I can play Soundcloud audio into that system.

As per installation, I used the guide here.

When the forked-daapd integration (as distinct from its server or add-on) is added it will detect the airplay devices forked-daapd knows about and bring time in as media players to homeassistant. Be they Airplay2, Airplay1 or Chromecast devices.

I don’t know what’s happening internally. But at least for my use case it doesn’t appear to matter. It recognized all my airplay 1 and airplay 2 devices and I can play audio to a mix of AirPlay 1 and airplay 2 devices and the audio will come out perfectly in sync across all devices. I really don’t care if it uses airplay 1 or 2 as I’ve never seen any useful difference between the protocols for playing music.

Yeah it works very well. I thought airplay2 bought multi room sync to apple devices which forked-daapd does pretty well.

Airplay 1 had perfectly working multiroom sync already.