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

Awesome write-up!
Here is an alternative to the hassio addon, using portainer, that is working with the latest homeassistant, hassos and supervisor on raspberry pi 4.


Thanks for the info guys. Have it up and running, it’s great so far.

Just wondering if you guys got local audio up and running. I have a pair of USB speakers plugged in but no luck getting it work. The documentation talks about running aplay -l to obtain device details, but that doesn’t seem available in Home Assistant.

Home Assistant does see my speakers though:

    name: USB-Audio - USB  AUDIO
    type: AUDIO
      - chan_id: '0'
        chan_type: digital audio playback

I am not sure how this translates into the ‘audio’ section of forked-daapd.conf.

1 Like

Haven’t had any use for local audio personally, sorry.

It appears that the owner of the addon made the adjustments necessary to fix the issues on HassOS 5.8 so if any HassOS users are brave enough to try the new fix, it would be great to report back to the issue linked here with your experiences so the dev knows whether or not it works (he can’t test it himself).

1 Like

No problem, it is just one of those ‘nice to have’ things.

OK, I can test it. I assume I can just stop the containers I’ve added under portainer and install the add-on. Reading the documentation, I don’t see a reference to shairport-sync. Do I need to install that separately or is it included in the add-on? Or maybe I don’t need it.

OK, I have the add-on installed, but I cannot access the web-ui. Either through the sidebar (“502: Bad Gateway”) or via http://[ip address]:3688 or via http://[ip address]:3689 (ERR_CONNECTION_REFUSED).

I think it’s port 3688:

	# Websocket port for the web interface.
	websocket_port = 3688

I see this in the add-on log:

forked-daapd: client.c:791: avahi_client_errno: Assertion `client' failed.

I tried to re-install and received this error message (it was there the first time I installed as well, but it seemed to install anyway):

When I return to the add-on, it is there and can be run, but unable to access the web-ui.

I’ll just stop the add-on for now.

Hi, I also couldn’t access the UI via ingress, but going to the local URL for it worked. For me that’s:

It looks like you may not have the new version because he said he took out the avahi error message in the latest. Would be great if you stopped by the GitHub issue and shared your results.

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:

  service: media_player.select_source
    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:

  service: media_player.media_play
    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.