Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile on raspbian with --with-libdaemon #1137

Closed
aleszczynskig opened this issue Jan 28, 2021 · 15 comments
Closed

Compile on raspbian with --with-libdaemon #1137

aleszczynskig opened this issue Jan 28, 2021 · 15 comments

Comments

@aleszczynskig
Copy link

aleszczynskig commented Jan 28, 2021

Hi,
I'm trying to compile Shairport-sync with libdaemon enabled on raspbian. This is because I want dbus support and the standard package does not have it included.

I am specifying the following

./configure --with-libdaemon --with-pipe --with-dbus-interface --with-avahi --with-ssl=openssl --with-metadata

this configures and compiles just fine but when I run with the -d option, I get the following error message.

shairport-sync was built without libdaemon, so does not support daemonisation using the -d, --daemon, -j or --justDaemoniseNoPIDFile options

I cannot work out why this is not working. I have tried the --with-systemv and --with-systemd. Neither make any difference.

As a little background ...

I am not running make install because I already have a working configuration. I just want to replace the existing binary with the new binary with dbus included. The distributed binary does have the -d flag and seems to use it in the system script.

I have already set up the dbus configuration based upon the dbus configuration file in the docker release. I only need pipe output which is why I am not including support for other outputs.

Unfortunately the docker version doesn't work for me despite including dbus because I am already running Avahi on the host and this created a lot of problems.

Any help will be greatly appreciated.

Many thanks

@mikebrady
Copy link
Owner

mikebrady commented Jan 29, 2021

Thanks for the post. If you have stopped after the make step, then the new Shairport Sync binary will not be placed in a directory where it will be automatically found for execution. Thus, if you enter:

$ shairport-sync

it will still execute the (older) installed Shairport Sync. To run the new Shairport Sync, while still in the build directory, enter:

$ ./shairport-sync

Perhaps you could post the output from both of these commands?

@mikebrady
Copy link
Owner

But, separately, you don't actually need libdaemon to get the dbus interface (at least, not on any reasonably up-to-date version of Raspberry Pi OS). Instead, all you need is to add the --with-dbus-interface flag.

@aleszczynskig
Copy link
Author

aleszczynskig commented Jan 29, 2021

@mikebrady thank you for the response.

Yes I was running the local version using ./shairport-sync. Here are the outputs you requested.

./shairport-sync -V
3.3.8rc3-OpenSSL-Avahi-pipe-metadata-dbus-sysconfdir:/usr/local/etc
./shairport-sync --help
Usage: ./shairport-sync [options...]
  or:  ./shairport-sync [options...] -- [audio output-specific options]

Options:
    -h, --help              show this help.
    -V, --version           show version information.
    -c, --configfile=FILE   read configuration settings from FILE. Default is /etc/shairport-sync.conf.

with comparison to the distro binary

shairport-sync -V
3.2.2-OpenSSL-Avahi-ALSA-pa-dummy-stdout-pipe-soxr-convolution-metadata-sysconfdir:/etc
shairport-sync --help
Usage: shairport-sync [options...]
  or:  shairport-sync [options...] -- [audio output-specific options]

Options:
    -h, --help              show this help.
    -d, --daemon            daemonise.
    -j, --justDaemoniseNoPIDFile            daemonise without a PID file.
    -V, --version           show version information.
    -k, --kill              kill the existing shairport daemon.
    -D, --disconnectFromOutput  disconnect immediately from the output device.
    -R, --reconnectToOutput  reconnect to the output device.
    -c, --configfile=FILE   read configuration settings from FILE. Default is /etc/shairport-sync.conf.

This is the existing systemd conf file in /lib/systemd/system/ which seems to use the --daemon flag

more shairport-sync.service
[Unit]
Description=ShairportSync AirTunes receiver
Documentation=man:shairport-sync(7)
Documentation=file:///usr/share/doc/shairport-sync/README.md.gz
Documentation=https://github.com/mikebrady/shairport-sync
After=sound.target
Requires=avahi-daemon.service
After=avahi-daemon.service

[Service]
Type=forking
Restart=on-failure
EnvironmentFile=-/etc/default/shairport-sync
ExecStart=/usr/bin/shairport-sync --daemon $DAEMON_ARGS
User=shairport-sync
Group=shairport-sync
PIDFile=/run/shairport-sync/shairport-sync.pid

[Install]
WantedBy=multi-user.target

and this is /etc/os-release

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Thanks

@aleszczynskig
Copy link
Author

aleszczynskig commented Jan 29, 2021

A little more information about the package installed

dpkg -s shairport-sync
Package: shairport-sync
Status: install ok installed
Priority: optional
Section: sound
Installed-Size: 306
Maintainer: Chris Boot <[email protected]>
Architecture: armhf
Source: shairport-sync (3.2.2-1)
Version: 3.2.2-1+b2
Depends: adduser, avahi-daemon, libasound2 (>= 1.0.17), libavahi-client3 (>= 0.6.16), libavahi-common3 (>= 0.6.16), libc6 (>= 2.15), libconfig9, libdaemon0 (>= 0.14), libgcc1 (>= 1:3.5), libpopt0 (>= 1.14), libpulse0 (>= 0.99.1), libsndfile1 (>= 1.0.20), libsoxr0 (>= 0.1.0), libssl1.1 (>= 1.1.0), libstdc++6 (>= 4.9)
Conffiles:
 /etc/default/shairport-sync 4c7fa8006ca0717aa1dda3d1480cd5e2
 /etc/init.d/shairport-sync ede9f660d8459acc404236e2a3aba2b5
 /etc/shairport-sync.conf bf5a082d4bffbfa6964c07cd7c764595
Description: AirPlay audio player
 Plays audio streamed from iTunes, iOS devices and third-party AirPlay
 sources such as ForkedDaapd and others. Audio played by a Shairport
 Sync-powered device stays synchronised with the source and hence with
 similar devices playing the same source. In this way, synchronised
 multi-room audio is possible without difficulty.
 .
 Shairport Sync does not support AirPlay video or photo streaming.
Homepage: https://github.com/mikebrady/shairport-sync

It seems that it has a dependency on libdaemon. Maybe I should remove the Debian version and do a full install as per your build instructions instead of swapping out the binaries to get a quick fix.

@mikebrady
Copy link
Owner

Thanks for the updates. Yes indeed, a full installation is a good idea, and a full removal of old scripts is important. There is some guidance on the INSTALL.md page.

@xska2
Copy link

xska2 commented Feb 2, 2021

Just chiming in here, compiling latest master with the following options does not seem to include libdaemon:
./configure --with-alsa --with-avahi --with-libdaemon --with-soxr --with-apple-alac --with-convolution --with-ssl=openssl --sysconfdir=/etc

At the linking step -ldaemon is missing:

g++ -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"/etc\" -std=c++11 -g -O2   -o shairport-sync shairport.o rtsp.o mdns.o common.o rtp.o player.o alac.o audio.o loudness.o activity_monitor.o apple_alac.o mdns_avahi.o   audio_alsa.o         FFTConvolver/AudioFFT.o FFTConvolver/FFTConvolver.o FFTConvolver/Utilities.o FFTConvolver/convolver.o         -lsndfile -lasound -lavahi-common -lavahi-client -lsoxr -lssl -lcrypto -L/usr/local/lib -lalac -lconfig -lpopt -lm -lpthread -lrt

If I checkout to 4856fefa830962be6b2d5a8fee30782d1bfdba50 and run the same ./configure options, it works fine.

@mikebrady
Copy link
Owner

Thanks. I'll check.

@mikebrady
Copy link
Owner

Apologies for the delay., I can confirm the missing -ldaemon. I'll fix it shortly.

@mikebrady
Copy link
Owner

mikebrady commented Feb 8, 2021

Hello again @aleszczynskig and @xska2. I believe it is fixed now on the development branch. If you'd be kind enough to check it, that would be great.

@xska2
Copy link

xska2 commented Feb 8, 2021

Confirmed development branch looks good on my end.

@aleszczynskig
Copy link
Author

Confirmed it's working for me too. Many thanks.

@mikebrady
Copy link
Owner

Thanks guys.

@1951FDG
Copy link

1951FDG commented Apr 7, 2021

Thanks guys.

I finally got shairport-sync working on my Asus RT-AC86U running Asuswrt-merlin using Entware! I will be writing a guide (a very long one) on how to achieve this soon.

The last version available on Entware to support daemonisation using the -d, --daemon, -j or --justDaemoniseNoPIDFile options is 3.2.2-3

Newer releases below are "broken":
3.3.5-1
3.3.6-2
3.3.7-1

So for users running Entware, if daemonisation is required, manually install version 3.2.2-3

wget https://bin.entware.net/armv7sf-k3.2/archive/shairport-sync-openssl_3.2.2-3_armv7-3.2.ipk
opkg install shairport-sync-openssl_3.2.2-3_armv7-3.2.ipk

Since Entware syncs with OpenWrt, these notes may somewhat also apply to OpenWrt!

@mikebrady When do you think the next release is due for?

@1951FDG
Copy link

1951FDG commented Apr 8, 2021

Update:

I compiled the latest development version, 3.3.8d7 for Entware

shairport-sync -V
# 3.3.8d7-OpenSSL-Avahi-ALSA-soxr-metadata-sysconfdir:/opt/etc
shairport-sync -d -- -d hw:0,0 -m hw:0 -c PCM
# shairport-sync was built without libdaemon, so does not support daemonisation using the -d, --daemon, -j or --justDaemoniseNoPIDFile options

I guess it wasn't solved yet on latest development branch???

@github-actions
Copy link

github-actions bot commented Aug 2, 2021

This issue has been inactive for 60 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants