FDH2 / UxPlay

AirPlay Unix mirroring server
GNU General Public License v3.0
1.61k stars 81 forks source link

NixOS issue: NixOS needs "services.avahi.openFirewall" set to "true" (was: Getting "No DNS-SD Server found (DNSServiceRegister call returned kDNSServiceErr_Unknown)" on startup) #343

Closed b3xie closed 1 month ago

b3xie commented 1 month ago

I'm trying to run uxplay however I get this error

UxPlay 1.68: An Open-Source AirPlay mirroring and audio-streaming server. Audio format 1: AAC-ELD 44100/2 GStreamer audio pipeline 1: "appsrc name=audio_source ! queue ! avdec_aac ! audioconvert ! audioresample ! volume name=volume ! level ! autoaudiosink sync=true" Audio format 2: ALAC 44100/16/2 GStreamer audio pipeline 2: "appsrc name=audio_source ! queue ! avdec_alac ! audioconvert ! audioresample ! volume name=volume ! level ! autoaudiosink sync=false" GStreamer video pipeline will be: "appsrc name=video_source ! queue ! h264parse ! decodebin ! videoconvert ! autovideosink name=video_sink sync=true" Initialized GStreamer video renderer using system MAC address 18:31:bf:b6:02:7b Initialized server socket(s) *** ERROR: No DNS-SD Server found (DNSServiceRegister call returned kDNSServiceErr_Unknown) Exiting HTTP thread

avahi-daemon is running properly and is able to scan the network for apple devices. So I'm not sure the reason for this.

fduncanh commented 1 month ago

The error message tells you that no DNS server was found, so avahi-daemon is probably NOT running properly.

See the UxPlay README : https://github.com/FDH2/UxPlay#1-avahidns_sd-bonjourzeroconf-issues

b3xie commented 1 month ago

@fduncanh it is running properly, and avahi-browse works too...

fduncanh commented 1 month ago

just to be sure: is avahi_daemon running on the SAME host that uxplay is running on?

b3xie commented 1 month ago

yes

b3xie commented 1 month ago

here's a copy of my avahi-daemon.conf

[server]
use-ipv4=yes
use-ipv6=yes
allow-interfaces=enp7s0
[publish]
publish-aaaa-on-ipv4=yes
publish-a-on-ipv6=yes
fduncanh commented 1 month ago

The error message means that the attempt to register the DNS_SD service failed. (DNSServiceRegister call returned kDNSServiceErr_Unknown

Check your avahi_daemon .conf file to see if your system has disabled dns_sd. Its probably in /etc/avahi/ .

A working avahi_daemon.conf is

File Edit Options Buffers Tools Conf Help                                                                                                                                                                                                                                                                
# This file is part of avahi.                                                                                                                                                                                                                                                                            
#                                                                                                                                                                                                                                                                                                        
# avahi is free software; you can redistribute it and/or modify it                                                                                                                                                                                                                                       
# under the terms of the GNU Lesser General Public License as                                                                                                                                                                                                                                            
# published by the Free Software Foundation; either version 2 of the                                                                                                                                                                                                                                     
# License, or (at your option) any later version.                                                                                                                                                                                                                                                        
#                                                                                                                                                                                                                                                                                                        
# avahi is distributed in the hope that it will be useful, but WITHOUT                                                                                                                                                                                                                                   
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY                                                                                                                                                                                                                                     
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public                                                                                                                                                                                                                                        
# License for more details.                                                                                                                                                                                                                                                                              
#                                                                                                                                                                                                                                                                                                        
# You should have received a copy of the GNU Lesser General Public                                                                                                                                                                                                                                       
# License along with avahi; if not, write to the Free Software                                                                                                                                                                                                                                           
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307                                                                                                                                                                                                                                    
# USA.                                                                                                                                                                                                                                                                                                   

# See avahi-daemon.conf(5) for more information on this configuration                                                                                                                                                                                                                                    
# file!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
[server]                                                                                                                                                                                                                                                                                                 
#host-name=foo         
#domain-name=local                                                                                                                                                                                                                                                                                       
#browse-domains=0pointer.de, zeroconf.org                                                                                                                                                                                                                                                                
use-ipv4=yes                                                                                                                                                                                                                                                                                             
use-ipv6=yes                                                                                                                                                                                                                                                                                             
#allow-interfaces=eth0                                                                                                                                                                                                                                                                                   
#deny-interfaces=eth1                                                                                                                                                                                                                                                                                    
#check-response-ttl=no                                                                                                                                                                                                                                                                                   
#use-iff-running=no                                                                                                                                                                                                                                                                                      
#enable-dbus=yes                                                                                                                                                                                                                                                                                         
#disallow-other-stacks=no                                                                                                                                                                                                                                                                                
#allow-point-to-point=no                                                                                                                                                                                                                                                                                 
#cache-entries-max=4096                                                                                                                                                                                                                                                                                  
#clients-max=4096                                                                                                                                                                                                                                                                                        
#objects-per-client-max=1024                                                                                                                                                                                                                                                                             
#entries-per-entry-group-max=32                                                                                                                                                                                                                                                                          
ratelimit-interval-usec=1000000                                                                                                                                                                                                                                                                          
ratelimit-burst=1000                                                                                                                                                                                                                                                                                     

[wide-area]                                                                                                                                                                                                                                                                                              
enable-wide-area=yes                                                                                                                                                                                                                                                                                     

[publish]                                                                                                                                                                                                                                                                                                
#disable-publishing=no                                                                                                                                                                                                                                                                                   
#disable-user-service-publishing=no                                                                                                                                                                                                                                                                      
#add-service-cookie=no                                                                                                                                                                                                                                                                                   
#publish-addresses=yes                                                                                                                                                                                                                                                                                   
publish-hinfo=no                                                                                                                                                                                                                                                                                         
publish-workstation=no                                                                                                                                                                                                                                                                                   
#publish-domain=yes                                                                                                                                                                                                                                                                                      
#publish-dns-servers=192.168.50.1, 192.168.50.2                                                                                                                                                                                                                                                          
#publish-resolv-conf-dns-servers=yes                                                                                                                                                                                                                                                                     
#publish-aaaa-on-ipv4=yes                                                                                                                                                                                                                                                                                
#publish-a-on-ipv6=no                                                                                                                                                                                                                                                                                    

[reflector]                                                                                                                                                                                                                                                                                              
#enable-reflector=no                                                                                                                                                                                                                                                                                     
#reflect-ipv=no                                                                                                                                                                                                                                                                                          
#reflect-filters=_airplay._tcp.local,_raop._tcp.local                                                                                                                                                                                                                                                    

[rlimits]                                                                                                                                                                                                                                                                                                
#rlimit-as=                                                                                                                                                                                                                                                                                              
#rlimit-core=0                                                                                                                                                                                                                                                                                           
#rlimit-data=8388608                                                                                                                                                                                                                                                                                     
#rlimit-fsize=0                                                                                                                                                                                                                                                                                          
#rlimit-nofile=768                                                                                                                                                                                                                                                                                       
#rlimit-stack=8388608                                                                                                                                                                                                                                                                                    
#rlimit-nproc=3                                                                                                                                                                                                                                                                                          
fduncanh commented 1 month ago

For example, "disable-publishing=yes" will probably prevent uxplay advertising its service.

EDIT: the README says:

You might need to edit the avahi-daemon.conf file (it is typically in /etc/avahi/, find it with "sudo find /etc -name avahi-daemon.conf"): make sure that "disable-publishing" is not a selected option)

b3xie commented 1 month ago

i managed to get it running on a different OS, but the error disappeared on NixOS by setting services.avahi.openFirewall to true

fduncanh commented 1 month ago

So the issue can be closed?

Should something be added to the README?

(for my information. what are the publish-aaaa-on-ipv4 and publish-a-on ipv6 needed for.

Did you need "non-default publish-a-on-ipv6=yes" for a reason, or just guessed you should do it?

fduncanh commented 1 month ago

managed to get it running on a different OS, but the error disappeared on NixOS by setting services.avahi.openFirewall to true

fduncanh commented 1 month ago

We will add a line in the Troubleshooting section of the README:

"A NixOS user found that in NixOS, this error can also occur if avahi-daemon service IS running with publishing enabled, but reports "the error disappeared on NixOS by setting services.avahi.openFirewall to true".