From 95dedb70f67c83b952ef4f70f9de1ef68a53fab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20H=C3=B6gberg?= Date: Mon, 4 Mar 2019 23:53:35 +0100 Subject: [PATCH] squeezelite: Remove codec auto configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .. because it's confusing and doesn't seem to add any value. The "auto configuration" looks for installed codec libraries and tells squeezelite (through command line arguments) to exclude codec support if a required library is missing. If you have installed squeezelite-full, then all required codec libraries are automatically installed as dependencies and the squeezelite binary won't even run if there are missing libraries - ie the "auto configuration" will always find all codecs and never disable any codecs. Toggling "auto configuration" makes no difference and the setting is just confusing. If you install squeezelite-mini the "auto configuration" can work, but library checks are already done by dlopen() calls in squeezelite and codecs are disabled if the necessary libraries are not found - ie the "auto configuration" duplicates the library checks of squeezelite itself. Signed-off-by: Robert Högberg --- sound/squeezelite/Makefile | 2 +- sound/squeezelite/files/squeezelite.conf | 2 - sound/squeezelite/files/squeezelite.init | 60 +++++++----------------- 3 files changed, 17 insertions(+), 47 deletions(-) diff --git a/sound/squeezelite/Makefile b/sound/squeezelite/Makefile index d64ff5941..13834ba51 100644 --- a/sound/squeezelite/Makefile +++ b/sound/squeezelite/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=squeezelite PKG_VERSION:=1.9.1-1130 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILES:=LICENSE.txt diff --git a/sound/squeezelite/files/squeezelite.conf b/sound/squeezelite/files/squeezelite.conf index 6bfcaab3a..a6895e21e 100644 --- a/sound/squeezelite/files/squeezelite.conf +++ b/sound/squeezelite/files/squeezelite.conf @@ -1,4 +1,3 @@ - config options 'options' option name 'SqueezeWrt' option model_name 'SqueezeLite' @@ -6,7 +5,6 @@ config options 'options' option priority '0' option max_sr '0' option device 'hw:0,0' - option decoder_auto_conf '1' option dsd_over_pcm '0' option ircontrol '0' option interface '' diff --git a/sound/squeezelite/files/squeezelite.init b/sound/squeezelite/files/squeezelite.init index de320daf3..330cc407b 100644 --- a/sound/squeezelite/files/squeezelite.init +++ b/sound/squeezelite/files/squeezelite.init @@ -7,38 +7,18 @@ STOP=1 USE_PROCD=1 PROG=/usr/bin/squeezelite -# -# Auto config checks for existing codec installations if not specified in config -# Explicit disable (override) by setting appropriate "decode_xxx" in config -# +# Check if a codec is disabled in the configuration (ie "decode_ 0") checkcodec() { - config_get_bool auto_conf options "decoder_auto_conf" 1 - config_get_bool codec options "$1" $auto_conf - - if [ $codec -ne 0 ] ; then - if [ $auto_conf -eq 0 ] ; then - #force use requested - echo "$4" + config_get_bool codec options "$1" 1 + + if [ $codec -eq 0 ] ; then + if [ -z "$3" ] ; then + echo "-e $2" else - if [ -e "/usr/lib/${2}" ] ; then - # Use codec (it exists) - echo "$4" - else - #exclude non-existant - if [ -z "$4" ] ; then - echo "-e $3" - else - echo "$4,$3" - fi - fi - fi - else - # explicitly excluded - if [ -z "$4" ] ; then - echo "-e $3" - else - echo "$4,$3" + echo "$3,$2" fi + else + echo "$3" fi } @@ -59,10 +39,10 @@ make_cmdline() { config_get alsa_buffer options alsa_buffer 200 [ $alsa_buffer -eq 0 ] && alsa_buffer="200" - + config_get alsa_period options alsa_period 4 [ $alsa_period -eq 0 ] && alsa_period="4" - + config_get alsa_format options alsa_format 16 [ $alsa_format = "0" ] && alsa_format="16" @@ -95,20 +75,12 @@ make_cmdline() { config_get priority options priority 0 [ $priority -ne 0 ] && cmdline="$cmdline -p $priority" - # - # ***NOTE: codec lib names are in squeezelite.h (set decode_auto_conf to 0 to ignore) - # local excl_codecs="" - local vorbis_lib="libvorbisidec.so.1" - - excl_codecs=`checkcodec decode_flac "libFLAC.so.8" flac "$excl_codecs"` - excl_codecs=`checkcodec decode_mp3 "libmpg123.so.0" mp3 "$excl_codecs"` - excl_codecs=`checkcodec decode_aac "libfaad.so.2" aac "$excl_codecs"` - - [ -e "/usr/lib/$vorbis_lib" ] || vorbis_lib="libvorbisfile.so.3" - - excl_codecs=`checkcodec decode_ogg "$vorbis_lib" ogg "$excl_codecs"` - excl_codecs=`checkcodec decode_wma_alac "libavcodec.so.56" wma,alac "$excl_codecs"` + excl_codecs=$(checkcodec decode_flac flac "$excl_codecs") + excl_codecs=$(checkcodec decode_mp3 mp3 "$excl_codecs") + excl_codecs=$(checkcodec decode_aac aac "$excl_codecs") + excl_codecs=$(checkcodec decode_ogg ogg "$excl_codecs") + excl_codecs=$(checkcodec decode_wma_alac wma,alac "$excl_codecs") cmdline="$cmdline $excl_codecs" config_get dop options dsd_over_pcm 0