2

I'm trying to setup newtek NDI for video streaming on local network. NDI uses mDNS for service discovery as described here. I already have NDI services running on windows machine and iOS device and I'm trying to run another service on linux machine (Slackware 15.0), where all devices are on the same LAN. The router (RT-AX88U) has the Domain Name configured to 'local'. There are no firewall rules configured on linux machine:

root@thinkpad-x1:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

From windows machine (where mDNS is handled via bonjour) I can see NDI services running on all three devices and I can connect to all of them without issues (for example via OBS with obs-ndi plugin, via NDI studio monitor etc.). From linux machine only NDI services running on windows and iOS device are discoverable:

root@thinkpad-x1:~# avahi-browse _ndi._tcp
+  wlan0 IPv6 OLAF (Olaf)                                   _ndi._tcp            local
+  wlan0 IPv4 OLAF (Olaf)                                   _ndi._tcp            local
+  wlan0 IPv4 MD1UMUTC (OBS)                                _ndi._tcp            local

So here is the problem - I need to discover (and connect to) the NDI service running on linux machine from the machine itself. Here are avahi configuration files

/etc/avahi/avahi-daemon.conf:

root@thinkpad-x1:~# cat /etc/avahi/avahi-daemon.conf

[server]
host-name=thinkpad-x1
domain-name=local
#browse-domains=0pointer.de, zeroconf.org
use-ipv4=yes
use-ipv6=yes
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=yes
#publish-domain=yes

/etc/nsswitch.conf:

root@thinkpad-x1:~# cat /etc/nsswitch.conf

passwd:         compat
group:          compat

#hosts:         files dns
hosts:          files mdns4_minimal [NOTFOUND=return] dns myhostname
networks:       files

services:       files
protocols:      files
rpc:            files
ethers:         files
netmasks:       files
netgroup:       files
bootparams:     files

automount:      files
aliases:        files

/etc/mdns.allow:

root@thinkpad-x1:~# cat /etc/mdns.allow

.local.
.local

So the question is how do I configure avahi-daemon to also discover services running on localhost?

1 Answer 1

2

Turns out that avahi-0.8 in slackware is outdated and just built without any patches. I ended up building avahi ubuntu version with following script:

git clone https://git.launchpad.net/ubuntu/+source/avahi
cd avahi

PRGNAM=avahi
VERSION=${VERSION:-0.8}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "${ARCH}" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

# chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

# !! files copied from original slackbuild at https://slackbuilds.org/slackbuilds/15.0/network/avahi.tar.gz 
#cat ../../avahi/build-db > service-type-database/build-db
cat ../../avahi/bssh.1 > man/bssh.1
cat ../../avahi/avahi-discover.1 > man/avahi-discover.1

#chmod 0755 service-type-database/build-db

for i in `cat ./debian/patches/series`; do git apply ./debian/patches/$i; done;

./bootstrap.sh

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --mandir=/usr/man \
  --docdir=/usr/doc/$PRGNAM-$VERSION \
  --with-systemdsystemunitdir=no \
  --enable-tests \
  --disable-static \
  --enable-compat-libdns_sd \
  --enable-python-dbus \
  --enable-glib \
  --enable-dbus \
  --enable-python \
  --enable-gtk \
  --enable-gtk3 \
  --enable-qt5 \
  --disable-qt4 \
  --disable-qt3 \
  --enable-core-docs \
  --with-dbus-sys=/usr/share/dbus-1/system.d \
  --with-avahi-user=avahi \
  --with-avahi-group=avahi \
  --with-avahi-priv-access-group=netdev \
  --with-distro=slackware \
  --program-prefix= \
  --program-suffix= \
  --build=$ARCH-slackware-linux --disable-mono

make
make install DESTDIR=$PKG

find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $(find $PKG/usr/man -type l); do ln -s $(readlink $i).gz $i.gz; rm $i; done

mv $PKG/etc/rc.d/rc.avahidaemon $PKG/etc/rc.d/rc.avahidaemon.new
mv $PKG/etc/rc.d/rc.avahidnsconfd $PKG/etc/rc.d/rc.avahidnsconfd.new
mv $PKG/etc/avahi/avahi-daemon.conf $PKG/etc/avahi/avahi-daemon.conf.new

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a LICENSE docs/* $PKG/usr/doc/$PRGNAM-$VERSION
# cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

#mkdir -p $PKG/install
#cat $CWD/slack-desc > $PKG/install/slack-desc
#cat $CWD/doinst.sh  > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

With the patched version hostname of local machine and local services are resolved without any issues.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .