You are not logged in.

#1 2021-04-26 00:30:04

mbc
Member
Registered: 2021-01-26
Posts: 17

[SOLVED] Cannot get mpd and avahi working together

I'm having trouble getting mpd working with avahi/zeroconf. While I can manually connect to the server using the IP, it's not being automatically detected.

I have started and enabled the avahi-daemon service.

I have also installed nss-mdns and enabled mdns-minimal according to https://wiki.archlinux.org/index.php/Av … resolution on the off chance this might fix it, but no luck.

I have NetworkManager and systemd-resolved running together, and I can confirm systemd-resolved is not using mDNS. My output of resolvectl:

Global
           Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
    resolv.conf mode: foreign
  Current DNS Server: 192.168.0.1
         DNS Servers: 192.168.0.1
Fallback DNS Servers: 1.1.1.1 9.9.9.10 8.8.8.8 2606:4700:4700::1111 2620:fe::10 2001:4860:4860::8888

Link 2 (enp6s0)
    Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.0.1
       DNS Servers: 192.168.0.1

       
       
My output of systemctl status avahi-daemon.service:

● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
     Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: disabled)
     Active: active (running) since Sun 2021-04-25 09:52:48 PDT; 7h ago
TriggeredBy: ● avahi-daemon.socket
   Main PID: 42623 (avahi-daemon)
     Status: "avahi-daemon 0.8 starting up."
      Tasks: 2 (limit: 19073)
     Memory: 1.6M
        CPU: 232ms
     CGroup: /system.slice/avahi-daemon.service
             ├─42623 avahi-daemon: running [arch.local]
             └─42624 avahi-daemon: chroot helper

Apr 25 09:52:48 arch avahi-daemon[42623]: Joining mDNS multicast group on interface lo.IPv6 with address ::1.
Apr 25 09:52:48 arch avahi-daemon[42623]: New relevant interface lo.IPv6 for mDNS.
Apr 25 09:52:48 arch avahi-daemon[42623]: Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
Apr 25 09:52:48 arch avahi-daemon[42623]: New relevant interface lo.IPv4 for mDNS.
Apr 25 09:52:48 arch avahi-daemon[42623]: Network interface enumeration completed.
Apr 25 09:52:48 arch avahi-daemon[42623]: Registering new address record for fe80::e99c:9ad9:6ffc:b25e on enp6s0.*.
Apr 25 09:52:48 arch avahi-daemon[42623]: Registering new address record for 192.168.0.106 on enp6s0.IPv4.
Apr 25 09:52:48 arch avahi-daemon[42623]: Registering new address record for ::1 on lo.*.
Apr 25 09:52:48 arch avahi-daemon[42623]: Registering new address record for 127.0.0.1 on lo.IPv4.
Apr 25 09:52:49 arch avahi-daemon[42623]: Server startup complete. Host name is arch.local. Local service cookie is 3936752120.

relevant part of mpd.conf confirming I have avahi enabled:

 
 145   # Zeroconf / Avahi Service Discovery ##########################################
 146   #
 147   # If this setting is set to "yes", service information will be published with
 148   # Zeroconf / Avahi.
 149   #
 150   zeroconf_enabled        "yes"
 151   #
 152   # The argument to this setting will be the Zeroconf / Avahi unique name for
 153   # this MPD server on the network. %h will be replaced with the hostname.
 154   #
 155   zeroconf_name           "Music Player @ %h"
 156   #
 157   ###############################################################################
 

and when I run avahi-resolve with my hostname (arch.local) it resolves to my system's IP address. I'm at a loss as to why Icannot get any other device on my network (including other programs on my system) to see my MPD server. Any help would be appreciated.

Last edited by mbc (2021-07-07 19:09:16)

Offline

#2 2021-07-07 19:08:27

mbc
Member
Registered: 2021-01-26
Posts: 17

Re: [SOLVED] Cannot get mpd and avahi working together

Apologies for bumping, but I figured I'd post the solution that I found on the off chance someone else encounters this problem. It turns out that by enabling mpd's socket-based activation, it was causing a conflict with avahi. By disabling the socket with:

systemctl --user disable mpd.socket

avahi works as intended.

Offline

Board footer

Powered by FluxBB