-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from Ottercast/feature-shairport-pulseaudio
Shairport-Sync using PulseAudio
- Loading branch information
Showing
9 changed files
with
202 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SHAIRPORT_SYNC_ARGS= -o pa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
config BR2_PACKAGE_SHAIRPORT_SYNC_PULSEAUDIO | ||
bool "shairport_sync_pulseaudio" | ||
depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL | ||
depends on BR2_INSTALL_LIBSTDCPP | ||
select BR2_PACKAGE_ALSA_LIB | ||
select BR2_PACKAGE_ALSA_LIB_MIXER | ||
select BR2_PACKAGE_LIBCONFIG | ||
select BR2_PACKAGE_OPENSSL if !BR2_PACKAGE_MBEDTLS | ||
select BR2_PACKAGE_POPT | ||
help | ||
Shairport Sync emulates an AirPort Express for the purpose | ||
of streaming audio from iTunes, iPods, iPhones, iPads and | ||
AppleTVs. Audio played by a Shairport Sync-powered device | ||
stays in synchrony with the source and thus with other | ||
devices that are playing the same source | ||
synchronously. Thus, for example, synchronised multi-room | ||
audio is possible without difficulty. | ||
|
||
https://github.com/mikebrady/shairport-sync | ||
|
||
if BR2_PACKAGE_SHAIRPORT_SYNC_PULSEAUDIO | ||
|
||
config BR2_PACKAGE_SHAIRPORT_SYNC_PULSEAUDIO_CONVOLUTION | ||
bool "convolution support" | ||
select BR2_PACKAGE_LIBSNDFILE | ||
help | ||
Enable audio DSP convolution support. | ||
|
||
config BR2_PACKAGE_SHAIRPORT_SYNC_PULSEAUDIO_DBUS | ||
bool "dbus support" | ||
depends on BR2_USE_WCHAR # libglib2 | ||
depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2 | ||
depends on BR2_USE_MMU # libglib2 | ||
select BR2_PACKAGE_LIBGLIB2 | ||
help | ||
Enable support for support for the MPRIS and native | ||
Shairport Sync D-Bus interface. | ||
|
||
comment "shairport-sync dbus support needs a toolchain w/ wchar, threads" | ||
depends on BR2_USE_MMU | ||
depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS | ||
|
||
config BR2_PACKAGE_SHAIRPORT_SYNC_PULSEAUDIO_LIBSOXR | ||
bool "libsoxr support" | ||
select BR2_PACKAGE_LIBSOXR | ||
help | ||
Enable support for libsoxr, the SoX Resampler library. | ||
|
||
Briefly, Shairport Sync keeps in step with the audio source | ||
by deleting or inserting frames of audio into the stream as | ||
needed. This "interpolation" is normally inaudible, but it | ||
can be heard in some circumstances. Libsoxr allows this | ||
interpolation to be done much more smoothly and subtly. | ||
|
||
config BR2_PACKAGE_SHAIRPORT_SYNC_PULSEAUDIO_MQTT | ||
bool "mqtt support" | ||
depends on BR2_USE_MMU # avahi | ||
depends on BR2_TOOLCHAIN_HAS_THREADS # avahi | ||
depends on !BR2_STATIC_LIBS # avahi | ||
select BR2_PACKAGE_AVAHI | ||
select BR2_PACKAGE_AVAHI_DAEMON | ||
select BR2_PACKAGE_DBUS | ||
select BR2_PACKAGE_MOSQUITTO | ||
help | ||
Enable support for the MQTT, the Message Queuing Telemetry | ||
Transport protocol. | ||
|
||
comment "shairport-sync mqtt support needs a toolchain w/ dynamic library, threads" | ||
depends on BR2_USE_MMU | ||
depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS | ||
|
||
endif | ||
|
||
comment "shairport-sync needs a toolchain w/ C++, NPTL" | ||
depends on BR2_USE_MMU | ||
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS_NPTL |
27 changes: 27 additions & 0 deletions
27
buildroot/package/shairport_sync_pulseaudio/S99shairport-sync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#! /bin/sh | ||
|
||
# Additional options that are passed to Shairport Sync | ||
OPTIONS="-d" | ||
|
||
case "$1" in | ||
start) | ||
printf "Starting shairport-sync: " | ||
start-stop-daemon -S -q --exec /usr/bin/shairport-sync -- $OPTIONS | ||
[ $? = 0 ] && echo "OK" || echo "FAIL" | ||
;; | ||
stop) | ||
printf "Stopping shairport-sync: " | ||
start-stop-daemon -K -q --exec /usr/bin/shairport-sync \ | ||
-p /var/run/shairport-sync/shairport-sync.pid | ||
[ $? = 0 ] && echo "OK" || echo "FAIL" | ||
;; | ||
restart) | ||
$0 stop | ||
sleep 1 | ||
$0 start | ||
;; | ||
*) | ||
echo "Usage: $0 {start|stop|restart}" | ||
exit 1 | ||
;; | ||
esac |
3 changes: 3 additions & 0 deletions
3
buildroot/package/shairport_sync_pulseaudio/shairport_sync_pulseaudio.hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Locally calculated | ||
sha256 0aa08d7d295d241f1ca8cabdc52580fad2be84b32c6b55b316121933c9aac4b4 shairport_sync_pulseaudio-pulse-latency-2.tar.gz | ||
sha256 7f8d4ecec53f2f681a962467bf09205568fc936c8c31a9ee07b1bd72d3d95b12 LICENSES |
87 changes: 87 additions & 0 deletions
87
buildroot/package/shairport_sync_pulseaudio/shairport_sync_pulseaudio.mk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
################################################################################ | ||
# | ||
# shairport-sync | ||
# | ||
################################################################################ | ||
|
||
SHAIRPORT_SYNC_PULSEAUDIO_VERSION = pulse-latency-2 | ||
SHAIRPORT_SYNC_PULSEAUDIO_SITE = $(call github,manawyrm,shairport-sync,$(SHAIRPORT_SYNC_PULSEAUDIO_VERSION)) | ||
|
||
SHAIRPORT_SYNC_PULSEAUDIO_LICENSE = MIT, BSD-3-Clause | ||
SHAIRPORT_SYNC_PULSEAUDIO_LICENSE_FILES = LICENSES | ||
SHAIRPORT_SYNC_PULSEAUDIO_DEPENDENCIES = alsa-lib libconfig popt host-pkgconf | ||
|
||
# git clone, no configure | ||
SHAIRPORT_SYNC_PULSEAUDIO_AUTORECONF = YES | ||
|
||
SHAIRPORT_SYNC_PULSEAUDIO_CONF_OPTS = --with-alsa \ | ||
--with-pa \ | ||
--with-metadata \ | ||
--with-pipe \ | ||
--with-stdout | ||
|
||
SHAIRPORT_SYNC_PULSEAUDIO_CONF_ENV += LIBS="$(SHAIRPORT_SYNC_PULSEAUDIO_CONF_LIBS)" | ||
|
||
# Avahi or tinysvcmdns (shaiport-sync bundles its own version of tinysvcmdns). | ||
# Avahi support needs libavahi-client, which is built by avahi if avahi-daemon | ||
# and dbus is selected. Since there is no BR2_PACKAGE_LIBAVAHI_CLIENT config | ||
# option yet, use the avahi-daemon and dbus congig symbols to check for | ||
# libavahi-client. | ||
ifeq ($(BR2_PACKAGE_AVAHI_DAEMON)$(BR2_PACKAGE_DBUS),yy) | ||
SHAIRPORT_SYNC_PULSEAUDIO_DEPENDENCIES += avahi | ||
SHAIRPORT_SYNC_PULSEAUDIO_CONF_OPTS += --with-avahi | ||
else | ||
SHAIRPORT_SYNC_PULSEAUDIO_CONF_OPTS += --with-tinysvcmdns | ||
endif | ||
|
||
ifeq ($(BR2_PACKAGE_LIBDAEMON),y) | ||
SHAIRPORT_SYNC_PULSEAUDIO_DEPENDENCIES += libdaemon | ||
SHAIRPORT_SYNC_PULSEAUDIO_CONF_OPTS += --with-libdaemon | ||
endif | ||
|
||
# OpenSSL or mbedTLS | ||
ifeq ($(BR2_PACKAGE_OPENSSL),y) | ||
SHAIRPORT_SYNC_PULSEAUDIO_DEPENDENCIES += openssl | ||
SHAIRPORT_SYNC_PULSEAUDIO_CONF_OPTS += --with-ssl=openssl | ||
else | ||
SHAIRPORT_SYNC_PULSEAUDIO_DEPENDENCIES += mbedtls | ||
SHAIRPORT_SYNC_PULSEAUDIO_CONF_OPTS += --with-ssl=mbedtls | ||
SHAIRPORT_SYNC_PULSEAUDIO_CONF_LIBS += -lmbedx509 -lmbedcrypto | ||
ifeq ($(BR2_PACKAGE_MBEDTLS_COMPRESSION),y) | ||
SHAIRPORT_SYNC_PULSEAUDIO_CONF_LIBS += -lz | ||
endif | ||
endif | ||
|
||
ifeq ($(BR2_PACKAGE_SHAIRPORT_SYNC_PULSEAUDIO_CONVOLUTION),y) | ||
SHAIRPORT_SYNC_PULSEAUDIO_DEPENDENCIES += libsndfile | ||
SHAIRPORT_SYNC_PULSEAUDIO_CONF_OPTS += --with-convolution | ||
endif | ||
|
||
ifeq ($(BR2_PACKAGE_SHAIRPORT_SYNC_PULSEAUDIO_DBUS),y) | ||
SHAIRPORT_SYNC_PULSEAUDIO_DEPENDENCIES += libglib2 | ||
SHAIRPORT_SYNC_PULSEAUDIO_CONF_OPTS += --with-dbus-interface --with-mpris-interface | ||
endif | ||
|
||
ifeq ($(BR2_PACKAGE_SHAIRPORT_SYNC_PULSEAUDIO_LIBSOXR),y) | ||
SHAIRPORT_SYNC_PULSEAUDIO_DEPENDENCIES += libsoxr | ||
SHAIRPORT_SYNC_PULSEAUDIO_CONF_OPTS += --with-soxr | ||
endif | ||
|
||
ifeq ($(BR2_PACKAGE_SHAIRPORT_SYNC_PULSEAUDIO_MQTT),y) | ||
SHAIRPORT_SYNC_PULSEAUDIO_DEPENDENCIES += avahi dbus mosquitto | ||
SHAIRPORT_SYNC_PULSEAUDIO_CONF_OPTS += --with-mqtt-client | ||
endif | ||
|
||
define SHAIRPORT_SYNC_PULSEAUDIO_INSTALL_TARGET_CMDS | ||
$(INSTALL) -D -m 0755 $(@D)/shairport-sync \ | ||
$(TARGET_DIR)/usr/bin/shairport-sync | ||
$(INSTALL) -D -m 0644 $(@D)/scripts/shairport-sync.conf \ | ||
$(TARGET_DIR)/etc/shairport-sync.conf | ||
endef | ||
|
||
define SHAIRPORT_SYNC_PULSEAUDIO_INSTALL_INIT_SYSV | ||
$(INSTALL) -D -m 0755 package/shairport-sync/S99shairport-sync \ | ||
$(TARGET_DIR)/etc/init.d/S99shairport-sync | ||
endef | ||
|
||
$(eval $(autotools-package)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
config BR2_PACKAGE_SHAIRPORT_SYNC_SYSTEMD_SERVICE | ||
bool "Systemd unit file for shairport-sync" | ||
depends on BR2_PACKAGE_SHAIRPORT_SYNC | ||
depends on BR2_PACKAGE_SHAIRPORT_SYNC_PULSEAUDIO | ||
depends on BR2_PACKAGE_SYSTEMD | ||
help | ||
Provides a systemd unit file for shairport-sync |