HomePod Connect: Spotify on HomePods with Spotify Connect

Hi, I use the docker on another device, outside of HA. The addon doesn’t work for me in version 10, it reports an mDns error.

Hey @VietNgoc, thank you for your response.
I think we might have a misunderstanding so let me clarify as much as I can.

We might be mixing docker image and docker engine terms when we write “we use the same docker” so just for clarity:

  • docker image is a package that is prepared in order to run on docker engine
  • docker engine is the environment that the image runs on

Let me quickly wrap up our thoughs. Based on what you wrote, I have assumed:

  • you are using docker on two devices: HA addon and another machine
  • HomePod Connect stopped working as an HA addon but works fine on another machine
  • even though they run the same docker image provided by @alexbabel

What I believe is the case → your 2 machines use different docker engines:
:white_check_mark: your other machine uses docker engine v20, the same docker engine that Home Assistant used to have in 9.5 (and it works)
:warning: your Home Assistant OS 10 uses an updated docker engine v23 (and it fails)
:question: I wonder how it would behave on Home Assistant OS 9.5

Here is my case:
:white_check_mark: I have been using HA OS 9.5 (docker engine v20) with the addon (and it worked)
:warning: few days ago I have upgraded to HA OS 10 (docker engine v23) and I am having issues with mDNS (and it fails)
:white_check_mark: I downgraded to HA OS 9.5 (docker engine v20) with the same docker image (and it works again)

Based on your case and my case → I conclude that the problem is not related to the docker image provided by Alex but is somehow connected with the environment we are running it on.

I have been searching and I believe other people have similar issues with other addons using mDNS for service discover in HA OS 10 and get resolved by downgrading to HA OS 9.5.

Earlier in my post I have suggested to do exactly that.

Maybe you could try downgrading OS on your HA machine with this command (you can upgrade it back afterwards)

ha os update --version 9.5

maybe that would solve your issues with Home Assistant Addon as it did for me.

:information_source: It is still worth mentioning that my guess about docker engine might be incorrect and the culprit is a totally different piece of software that got updated during HA OS upgrade from 9.5 into 10.0.

I am hoping this will be solved on the OS level.

2 Likes

I have the same problem indeed. Under HA OS 10.0 and 10.1 the addon fails to start with a mDns error.
Every second the same message in a bootloop:
[2023-05-01 09:28:59] [FATAL] main: mDNS init failed
[2023-05-01 09:28:59] [ LOG] main: Exiting.

/edit: downgrading to HA OS 9.5 solves the problem for me.
I have mentioned it here as well: No communication to devices using mDNS after update to 10.0 · Issue #2481 · home-assistant/operating-system · GitHub

1 Like

@wojked thank you for your detailed description regarding the mDNS issue. I guess if anyone is encountering the issue again, we can forward them to your post.

There is a new bug due to Spotify API changes.

If anyone experiences this in the Zeroconf

ZeroconfServer:375 - Couldn't establish a new session.
xyz.gianlu.librespot.core.Session$SpotifyAuthenticationException: PremiumAccountRequired

it is described more in here:

@alexbabel could you please bump version of the librespot to the newest 1.6.3 and release an update?

I have managed to prepare PRs from my mobile :wink:

Thanks again for your effort in keeping this addon up to date.

No problem! I am using your add on every single day- so I need to debug it when something stops functioning!

It makes my life with HomePod easier (especially after being used to Echo).

Thank you for bundling all the pieces together!

I installed the latest build of Homepod Connect on HA 10.1 on a Raspberry Pi 4, but I still have the issue mentionned by Tim: mDNS init failed.

Do you have any tips to troubleshoot this and having this addon starting ?

Hey! I have installed HA 10.1 today (I used to have mDNS issues so I sticked to the older HA 9.5)

  1. I did the following DNS related commands in the HA terminal:
ha dns reset
ha dns restart
  1. I have restarted the addon and still had some issues, but…
  2. After restarting Home Assistant fully, I have everything working on the newest 10.1 !
    (maybe it is also why some people claimed it worked after multiple restarts)

This means it is not related to new docker…

@bunub @GoSpursGoNL @VietNgoc
Could you please try the same 3-steps as I described while being on 10.1?

I restarted everything one more time and unfortunately, mDNS issue is back, I am unsure what causes the problem.

Hi @wojked ,

I tried the proposed 3 steps, I also made a complete reboot of my Raspberry, same issue with mDNS. The container didn’t start.
Just a question, I came through the settings in the owntone.conf and librespot-java.toml and finally didn’t change anything. Do we need to set the uid to something else than abc ?

Hey @bunub,

Yes, I have updated my post…
Startup of the addon on HASS 10.1 is unpredictable due to the mDNS init failed issue.
That is why I am keeping 9.5 for now but will keep on testing if anything new comes to my mind.

It is worth mentioning that downgrading to 9.5 is quite easy so if you are open to experiments, please feel free to try it:

ha os update --version 9.5

I was editing just the “librespot-java.toml” to select the desired auth strategy:

strategy = "ZEROCONF"

Hi,
Thanks @wojked, my container started once correctly, but after a restart it fail again with the mDNS issue. I will also continue to investigate and see if I find a solution.

I checked whether HA OS 10.2 would make any difference, but it didn’t.

Same for me, but after multiple restart of the addon, it suddenly works.

It’s a weird race condition with HA OS 10.x
I have the docker container used in this add-on running on a separate machine (Alpine 3.18, kernel 6.1.31) and it works fine. So either you need to downgrade HA OS (not recommended) or just us a separate (virtual) machine to host this.
My docker-compose example:

  owntone:
    container_name: owntone
    image: alexbabel/owntone:latest
    network_mode: host
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ:?timezone missing}
    volumes:
      - ./owntone/config:/config
      - ./owntone/music:/music
    restart: unless-stopped

hey @wojked

Is there a way to sync the hardware homepod volume with spotify connect? As of right now, if I am 100% volume on spotify connect, it translates to about 50% of the hardware volume on the homepod. Is there any fix for this?

Thanks

Hey @owl

Yes! All the magic happens in the owntone.

There is a volume slider that might be interesting to you- and it might be exactly the one limiting your max volume that is controlled from Spotify.

There is an arrow that will expose the sliders.

Address of the owntone server is sth like
http://owntone.local:3689/

hey @wojked

Yes I tried that but that wasn’t the issue, the owntone and homepod values are in sync but they don’t match the homepod hardware volume if that makes sense. I’m out of ideas so ill probably go back to using airplay.

same mDNS init failed problem :frowning: