Merge pull request #12041 from neheb/shair
shairport-sync: update to 3.3.6
This commit is contained in:
commit
59148c7ac5
2 changed files with 89 additions and 85 deletions
|
@ -7,20 +7,21 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=shairport-sync
|
||||
PKG_VERSION:=3.3.5
|
||||
PKG_VERSION:=3.3.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/mikebrady/shairport-sync/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=9757dd7f19c0bc28cb06a6753305c3ed89da2d271d069b36d1b12173309c1459
|
||||
PKG_HASH:=a8382affd25c473fa38ead5690148c6c3902098f359f9c881eefe139e1f49f49
|
||||
|
||||
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
|
||||
Mike Brady <mikebrady@eircom.net>
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=COPYING LICENSES shairport.c
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
@ -74,7 +75,7 @@ define Package/shairport-sync-mini/description
|
|||
Minimal version uses mbed TLS and does not include libsoxr and avahi support.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
CONFIGURE_ARGS += \
|
||||
--with-alsa \
|
||||
--with-metadata
|
||||
|
||||
|
@ -102,9 +103,9 @@ Package/shairport-sync-mini/conffiles = $(Package/shairport-sync/default/conffil
|
|||
|
||||
define Package/shairport-sync/default/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/shairport-sync $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/shairport-sync $(1)/usr/bin/
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/scripts/shairport-sync.conf $(1)/etc/shairport-sync.conf
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/shairport-sync.conf $(1)/etc/shairport-sync.conf
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/shairport-sync.init $(1)/etc/init.d/shairport-sync
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
|
|
|
@ -6,25 +6,28 @@ USE_PROCD=1
|
|||
|
||||
append_num() {
|
||||
local cfg="$1"
|
||||
local file="$2"
|
||||
local var="$3"
|
||||
local opt="$4"
|
||||
local def="$5"
|
||||
local var="$2"
|
||||
local opt="$3"
|
||||
local def="$4"
|
||||
local val
|
||||
|
||||
config_get val "$cfg" "$var"
|
||||
[ -n "$val" -o -n "$def" ] && echo -e "\t$opt = ${val:-$def};" >> $file
|
||||
if [ -n "$val" ] || [ -n "$def" ]; then
|
||||
printf "\t%s = ${val:-$def};\n" "$opt"
|
||||
fi
|
||||
}
|
||||
|
||||
append_str() {
|
||||
local cfg="$1"
|
||||
local file="$2"
|
||||
local var="$3"
|
||||
local opt="$4"
|
||||
local def="$5"
|
||||
local var="$2"
|
||||
local opt="$3"
|
||||
local def="$4"
|
||||
local val
|
||||
|
||||
config_get val "$cfg" "$var"
|
||||
[ -n "$val" -o -n "$def" ] && echo -e "\t$opt = \"${val:-$def}\";" >> $file
|
||||
if [ -n "$val" ] || [ -n "$def" ]; then
|
||||
printf "\t%s = \"${val:-$def}\";\n" "$opt"
|
||||
fi
|
||||
}
|
||||
|
||||
start_instance() {
|
||||
|
@ -36,95 +39,95 @@ start_instance() {
|
|||
|
||||
config_get_bool conf_custom "$cfg" 'conf_custom' '0'
|
||||
config_get conf_file "$cfg" "conf_file"
|
||||
if [ $conf_custom -ne 1 ] && [ ! -n "$conf_file" ]; then
|
||||
[ "$conf_custom" -ne 1 ] && [ -z "$conf_file" ] && {
|
||||
mkdir -p /var/etc
|
||||
conf_file="/var/etc/shairport-sync-${cfg}.conf"
|
||||
|
||||
echo -e "// Automatically generated from UCI config\n" > $conf_file
|
||||
} && {
|
||||
printf "// Automatically generated from UCI config\n\n"
|
||||
|
||||
# General
|
||||
echo -e "general =" >> $conf_file
|
||||
echo -e "{" >> $conf_file
|
||||
append_str "$cfg" "$conf_file" name "name"
|
||||
append_str "$cfg" "$conf_file" password "password"
|
||||
append_str "$cfg" "$conf_file" interpolation "interpolation"
|
||||
append_str "$cfg" "$conf_file" output_backend "output_backend"
|
||||
append_str "$cfg" "$conf_file" mdns_backend "mdns_backend"
|
||||
append_num "$cfg" "$conf_file" port "port"
|
||||
append_num "$cfg" "$conf_file" udp_port_base "udp_port_base"
|
||||
append_num "$cfg" "$conf_file" udp_port_range "udp_port_range"
|
||||
append_str "$cfg" "$conf_file" statistics "statistics"
|
||||
append_num "$cfg" "$conf_file" drift "drift"
|
||||
append_num "$cfg" "$conf_file" resync_threshold "resync_threshold"
|
||||
append_num "$cfg" "$conf_file" log_verbosity "log_verbosity"
|
||||
append_str "$cfg" "$conf_file" ignore_volume_control "ignore_volume_control"
|
||||
append_num "$cfg" "$conf_file" volume_range_db "volume_range_db"
|
||||
append_str "$cfg" "$conf_file" regtype "regtype"
|
||||
append_str "$cfg" "$conf_file" playback_mode "playback_mode"
|
||||
echo -e "};\n" >> $conf_file
|
||||
printf "general =\n"
|
||||
printf "{\n"
|
||||
append_str "$cfg" name "name"
|
||||
append_str "$cfg" password "password"
|
||||
append_str "$cfg" interpolation "interpolation"
|
||||
append_str "$cfg" output_backend "output_backend"
|
||||
append_str "$cfg" mdns_backend "mdns_backend"
|
||||
append_num "$cfg" port "port"
|
||||
append_num "$cfg" udp_port_base "udp_port_base"
|
||||
append_num "$cfg" udp_port_range "udp_port_range"
|
||||
append_str "$cfg" statistics "statistics"
|
||||
append_num "$cfg" drift "drift"
|
||||
append_num "$cfg" resync_threshold "resync_threshold"
|
||||
append_num "$cfg" log_verbosity "log_verbosity"
|
||||
append_str "$cfg" ignore_volume_control "ignore_volume_control"
|
||||
append_num "$cfg" volume_range_db "volume_range_db"
|
||||
append_str "$cfg" regtype "regtype"
|
||||
append_str "$cfg" playback_mode "playback_mode"
|
||||
printf "};\n\n"
|
||||
|
||||
# Metadata
|
||||
echo -e "metadata =" >> $conf_file
|
||||
echo -e "{" >> $conf_file
|
||||
append_str "$cfg" "$conf_file" metadata_enabled "enabled"
|
||||
append_str "$cfg" "$conf_file" metadata_cover_art "include_cover_art"
|
||||
append_str "$cfg" "$conf_file" metadata_pipe_name "pipe_name"
|
||||
append_num "$cfg" "$conf_file" metadata_pipe_timeout "pipe_timeout"
|
||||
append_str "$cfg" "$conf_file" metadata_socket_address "socket_address"
|
||||
append_num "$cfg" "$conf_file" metadata_socket_port "socket_port"
|
||||
append_num "$cfg" "$conf_file" metadata_socket_msglength "socket_msglength"
|
||||
echo -e "};\n" >> $conf_file
|
||||
printf "metadata =\n"
|
||||
printf "{\n"
|
||||
append_str "$cfg" metadata_enabled "enabled"
|
||||
append_str "$cfg" metadata_cover_art "include_cover_art"
|
||||
append_str "$cfg" metadata_pipe_name "pipe_name"
|
||||
append_num "$cfg" metadata_pipe_timeout "pipe_timeout"
|
||||
append_str "$cfg" metadata_socket_address "socket_address"
|
||||
append_num "$cfg" metadata_socket_port "socket_port"
|
||||
append_num "$cfg" metadata_socket_msglength "socket_msglength"
|
||||
printf "};\n\n"
|
||||
|
||||
# Session control
|
||||
echo -e "sessioncontrol =" >> $conf_file
|
||||
echo -e "{" >> $conf_file
|
||||
append_str "$cfg" "$conf_file" sesctl_run_before_play_begins "run_this_before_play_begins"
|
||||
append_str "$cfg" "$conf_file" sesctl_run_after_play_ends "run_this_after_play_ends"
|
||||
append_str "$cfg" "$conf_file" sesctl_wait_for_completion "wait_for_completion"
|
||||
append_str "$cfg" "$conf_file" sesctl_session_interruption "allow_session_interruption"
|
||||
append_num "$cfg" "$conf_file" sesctl_session_timeout "session_timeout"
|
||||
echo -e "};\n" >> $conf_file
|
||||
printf "sessioncontrol =\n"
|
||||
printf "{\n"
|
||||
append_str "$cfg" sesctl_run_before_play_begins "run_this_before_play_begins"
|
||||
append_str "$cfg" sesctl_run_after_play_ends "run_this_after_play_ends"
|
||||
append_str "$cfg" sesctl_wait_for_completion "wait_for_completion"
|
||||
append_str "$cfg" sesctl_session_interruption "allow_session_interruption"
|
||||
append_num "$cfg" sesctl_session_timeout "session_timeout"
|
||||
printf "};\n\n"
|
||||
|
||||
# Alsa audio back end
|
||||
echo -e "alsa =" >> $conf_file
|
||||
echo -e "{" >> $conf_file
|
||||
append_str "$cfg" "$conf_file" alsa_output_device "output_device"
|
||||
append_str "$cfg" "$conf_file" alsa_mixer_control_name "mixer_control_name"
|
||||
append_str "$cfg" "$conf_file" alsa_mixer_device "mixer_device"
|
||||
append_num "$cfg" "$conf_file" alsa_latency_offset "audio_backend_latency_offset"
|
||||
append_num "$cfg" "$conf_file" alsa_buffer_length "audio_backend_buffer_desired_length"
|
||||
append_str "$cfg" "$conf_file" alsa_disable_synchronization "disable_synchronization"
|
||||
append_num "$cfg" "$conf_file" alsa_period_size "period_size"
|
||||
append_num "$cfg" "$conf_file" alsa_buffer_size "buffer_size"
|
||||
echo -e "};\n" >> $conf_file
|
||||
printf "alsa =\n"
|
||||
printf "{\n"
|
||||
append_str "$cfg" alsa_output_device "output_device"
|
||||
append_str "$cfg" alsa_mixer_control_name "mixer_control_name"
|
||||
append_str "$cfg" alsa_mixer_device "mixer_device"
|
||||
append_num "$cfg" alsa_latency_offset "audio_backend_latency_offset"
|
||||
append_num "$cfg" alsa_buffer_length "audio_backend_buffer_desired_length"
|
||||
append_str "$cfg" alsa_disable_synchronization "disable_synchronization"
|
||||
append_num "$cfg" alsa_period_size "period_size"
|
||||
append_num "$cfg" alsa_buffer_size "buffer_size"
|
||||
printf "};\n\n"
|
||||
|
||||
# Pipe audio back end
|
||||
echo -e "pipe =" >> $conf_file
|
||||
echo -e "{" >> $conf_file
|
||||
append_str "$cfg" "$conf_file" pipe_name "name"
|
||||
append_num "$cfg" "$conf_file" pipe_latency_offset "audio_backend_latency_offset"
|
||||
append_num "$cfg" "$conf_file" pipe_buffer_length "audio_backend_buffer_desired_length"
|
||||
echo -e "};\n" >> $conf_file
|
||||
printf "pipe =\n"
|
||||
printf "{\n"
|
||||
append_str "$cfg" pipe_name "name"
|
||||
append_num "$cfg" pipe_latency_offset "audio_backend_latency_offset"
|
||||
append_num "$cfg" pipe_buffer_length "audio_backend_buffer_desired_length"
|
||||
printf "};\n\n"
|
||||
|
||||
# Stdout audio back end
|
||||
echo -e "stdout =" >> $conf_file
|
||||
echo -e "{" >> $conf_file
|
||||
append_num "$cfg" "$conf_file" stdout_latency_offset "audio_backend_latency_offset"
|
||||
append_num "$cfg" "$conf_file" stdout_buffer_length "audio_backend_buffer_desired_length"
|
||||
echo -e "};\n" >> $conf_file
|
||||
printf "stdout =\n"
|
||||
printf "{\n"
|
||||
append_num "$cfg" stdout_latency_offset "audio_backend_latency_offset"
|
||||
append_num "$cfg" stdout_buffer_length "audio_backend_buffer_desired_length"
|
||||
printf "};\n\n"
|
||||
|
||||
# AO audio back end
|
||||
echo -e "ao =" >> $conf_file
|
||||
echo -e "{" >> $conf_file
|
||||
append_num "$cfg" "$conf_file" ao_latency_offset "audio_backend_latency_offset"
|
||||
append_num "$cfg" "$conf_file" ao_buffer_length "audio_backend_buffer_desired_length"
|
||||
echo -e "};\n" >> $conf_file
|
||||
fi
|
||||
printf "ao =\n"
|
||||
printf "{\n"
|
||||
append_num "$cfg" ao_latency_offset "audio_backend_latency_offset"
|
||||
append_num "$cfg" ao_buffer_length "audio_backend_buffer_desired_length"
|
||||
printf "};\n\n"
|
||||
} > "$conf_file"
|
||||
|
||||
procd_open_instance
|
||||
|
||||
procd_set_param command /usr/bin/shairport-sync
|
||||
procd_append_param command -c $conf_file
|
||||
procd_append_param command -c "$conf_file"
|
||||
|
||||
config_get_bool aux "$cfg" 'respawn' '0'
|
||||
[ "$aux" = 1 ] && procd_set_param respawn
|
||||
|
|
Loading…
Reference in a new issue