Open ettom opened 1 year ago
It is due Librespot implementing it's own mDNS stack instead of just registering with Avahi. So they fight each other.
It is due Librespot implementing it's own mDNS stack instead of just registering with Avahi. So they fight each other.
I have compiled librespot with the dns-sd backend. Isn't that supposed to use Avahi for discovery?
Ok, then it should use avahi. But it probably doesn't retry if avahi is unavailable. One has to correctly order service dependencies in systemd or other supervisor used. Systemd can propagate restarts if configured to do so, but that's only workaround for proper dbus discovery
May 18, 2023 11:42:20 ettom @.***>:
It is due Librespot implementing it's own mDNS stack instead of just registering with Avahi. So they fight each other.
I have compiled librespot with the dns-sd backend. Isn't that supposed to use Avahi for discovery?
— Reply to this email directly, view it on GitHub[https://github.com/librespot-org/librespot/issues/1133#issuecomment-1552802661], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ADD33ZLX55QUFCVXIHDXV4LXGXVHZANCNFSM6AAAAAAWAKUYMM]. You are receiving this because you commented.[Tracking image][https://github.com/notifications/beacon/ADD33ZNGUMX2S7JWPE6JDC3XGXVHZA5CNFSM6AAAAAAWAKUYMOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS4RXRWK.gif]
I have set Requires=avahi-daemon.service
on the librespot service and it doesn't really work (see my original post). I could try to create a workaround like adding a small delay in ExecStartPre
for librespot.service, but I think this should not be required and librespot should handle it internally.
The problem is though that librespot doesn't listen to events from avahi, so in case of avahi is restarted librespot never applies again for registration. This is caused by librespot using only simple (and deprecated) compatibility bindings to Avahi.
Other issue is that Requires
pull dependency in whenever librespot start, but it doesn't order them anyhow. To have librespot started after avahi add After=avahi-daemon.service
(or socket might be cleaner). You can also work around the registration issue by using BindsTo=avahi-daemon.service
instead Requires
, which will start and stop (and restart) librespot in concert with Avahi. The ordering is still done through After
.
For anyone coming across this in the future, I have found that a similar issue (librespot fully undiscoverable) was resolved for me by enabling publishing / user service publishing in avahi
's config.
For some reason this is disabled by default! Took me way too long to figure out :P
In NixOS:
services.avahi = {
enable = true;
publish = {
enable = true;
userServices = true;
};
};
Sorry for interrupting / necroposting as this doesn't resolve the issue but this is the (only) top google result for DNS-SD Error: Unknown.
and I didn't want to create a new issue for a problem I already fixed myself.
Feel free to hide/delete this post if you want!
Describe the bug Librespot (with dns-sd backend) stays in an undiscoverable state if launched closely together with avahi-daemon.
To reproduce Steps to reproduce the behavior:
systemctl stop avahi-daemon
Librespot fails to start until avahi is started:
systemctl start avahi-daemon
Librespot now starts, but the instance is not discoverable until librespot is launched again. Some kind of a race condition? Additionally, restarting avahi-daemon while librespot is running (in a discoverable state) will make it undiscoverable until restarted.
Log:
Host (what you are running
librespot
on):