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

Shairport-sync now has basic airplay 2 support in beta if that helps you

Anyone dealt with sync issues with the Airplay 2 build of Shairport-Sync?

I’m piping shairport sync (Airplay 2 dev build) to owntone as a way to add airplay 2 functionality to two Airplay 1 speakers, which works great, except that they’re both out of sync by about 3 seconds (behind) all the real Airplay 2 speakers.

I’m guessing the issue is that shairport-sync syncs the time correctly but the pipe and daapd add a few seconds of delay, and I’m not sure how to fix it.

Maybe if daapd has a way to offset the sync by a given value I could fine tune it by a few seconds, as it seems to be a very consistent delay, but I’m not sure if that’s even possible.

Figured it out. For anyone who runs into the same problem, use shairport’s config.

This was mine:
audio_backend_latency_offset_in_seconds = -3.3;

Now audio is in perfect sync.

3 Likes

I did set forked-daapd (new name: OwnTone) up on Promox as a CT with ubuntu-18.04 as a template-base.
Using the guide from Github (https://github.com/owntone/owntone-server) was quite straight forward.

I did mount a CIFS/SMB Share to the CT/Ubuntu (my music resides on a network share / NAS).

The configuration was super easy, however I couldn’t start Owntone as described - Avahi Daemon was missing on the above Ubuntu Distribution.
Installing Avahi Daemon was required:

sudo apt install avahi-daemon

What I could not find are system requirements in terms of CPU/RAM/SSD

It is super lightweight as it turnes out:
CPU: 1
RAM: I have assigned 1GB but it could do with far less (256MB/512MB). Current usage: 62MB :smiley:
SSD: I have assigned 4GB but ATM it sits just below 2GB, lets see how big the DB gets once I do a rescan (I just added a couple of songs initially for testing)

I use it with airplay speakers, and it worked out of the box. Next thing now is to integrate the control into HA.

Thanks for the inspiration!!

So I’m just looking at the HA integration of this. Its cool to have basic functionality (play/stop, next/previous), however what I’m looking for is to browse through the media files and just play them (like I would with the App “Remote” from Apple to control iTunes.

Is there any way to do this?

Hey, I just set up owntone (still playing with it) and the forked_daapd integration in HA. One thing I noticed when I create a lovelace card to control owntone is that the “Source List” starts with “Default (no pipe)” and then has the list of my playlists. Where is that “Default” coming from, and how do I get rid of it? I’m currently not planning to set up shairport-sync in front of owntone, so the only inputs would be the music library.

the SourceList actually refers to a list of playlists owntone has discovered upon library scan. Like, m3u playlists. And default means no playlist.

@ddppddpp

the SourceList actually refers to a list of playlists owntone has discovered upon library scan. Like, m3u playlists. And default means no playlist.

That’s what has me so confused. There are playlists that it finds/found, and they are in the drop-down list, below the “Default (no pipe)” entry in the list.

Actually I haven’t found a way to play a specific media track/song/file that is part of the owntone library but not part of a playlist via the HA forked-daapd integration. The way I’m using my multiroom audio setup is a) chose one of the playlists or b) airplay to shairport-sync running on the same host and piping to owntone. When using b) obviously the ‘source’ is set to Default without me doing anything.
I’d love to hear about other options/use cases.

Is there nowadays already/again a working Owntone HA-OS addon? Or are all HA-OS users here still running it via Portainer? For me the supervisor is complaining due to this setup
image

1 Like

@GoSpursGoNL I don’t know – I set up owntone on its own VM on my ovirt installation; it’s not running on my HassOS system (which happens to also be a VM).

@Hackashaq666 , @ddppddpp (and all) – My current issue is that if I go from Mac -[AirPlay]- shairport-sync -[pipe]- owntone -[AirPlay]- speaker(s) then the volume is WAY LOW vs just going from Mac to the speaker directly via airplay (i.e. without going through the shairport+owntone server). Even if I put the Mac volume all to way to full, the volume through owntone + airplay is much lower than just using the direct airplay.

Has anyone else noticed this? Any ideas where to look?

That may be a classic ‘chain’ issue.

It’s not just going from Mac -[AirPlay]- shairport-sync -[pipe]- owntone -[AirPlay]- speaker(s), but might be going from from Mac -[AirPlay]- shairport-sync -[pipe]- owntone - Pulse/Jack/Alsa -[AirPlay]- speaker(s) or there may be even more software in there.

Point being: if anything in the chain is set to reduce the volume then the volume will stay reduced for the whole chain.

Back in the day when Alsa was the only real audio solution on Linux, you’d have to install alsamixer just to adjust volume levels before you were half way happy with the result.


Note since we’re here: You ideally don’t want anything in-chain to reduce or amplify the audio (extra amplification can cause distortion), and that can be very tricky. Sometimes 0 volume means “don’t amplify at all” and sometimes it means “reduce it entirely so it’s muted”. Sometimes 50% or 70% volume means “don’t amplify at all”, or sometimes that number is arbitrary. Usually the documentation will tell you but not always. What you’re looking for is 0dB throughout the chain. Amplify at the amp if you need to (that’s what it’s for after all)

Yeah. I’ve addressed this earlier. Second half of the comment.

A question: is anyone running forked-daapd / owntone as a docker container?
Everything works, I can access the webui (through my local synology ip address). However I am having problems when authenticating the spotify plugin. The authentication redirects to an owntone.local address which off course doesn’t work. Anyone knows how to bypass that? Or how you guys got that working? Thx

edit: got it working using a workaround

Tried following the steps in the first post to get Shairport to forward audio to OwnTune (originally called Forked-Daapd) but nothing happens on the OwnTune side when I play music to the Shairport airplay device. Anyone run into anything similar? No errors logs nothing to report

It would be very hard to answer with no isights on your particular setup (i.e. what exactly are you running, how and where.
I’d start with troubleshooting the link b/w ShairportSync->named pipe->OwnTone and the answers to the questions above will tell you how to do it.
There’s good documentation on OwnTone.github.io

Yeaup I realized I gave no info on my setup to get any good help. I did end up figuring it out, the piped audio needs to be placed in the /srv/music directory. I originally had in the /srv and it wasn’t working. Caught a line in the Owntone log mentioning no music found in the /srv/music directory and that is what guided me there. Didn’t find any documentation on that though.

my guess is that you’re referring to a setup of OwntTone + Shairport Sync on HomeAssistant. IIRC the location of the named pipe was specific to one of the few owntone integrations. There is no such requirement if you run OwnTone on a different host (like I do).

I am running OwnTone and Shairport on a RPi 3b+, not the same host as HA. Maybe I was running into file permissions issue, even though I Chmod 777 the /srv directory

Finally a proper HA addon for Owntone!