squeezelite: Remove codec auto configuration
authorRobert Högberg <redacted>
Mon, 4 Mar 2019 22:53:35 +0000 (23:53 +0100)
committerRobert Högberg <redacted>
Tue, 2 Jul 2019 08:01:35 +0000 (10:01 +0200)
.. 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 <redacted>
sound/squeezelite/Makefile
sound/squeezelite/files/squeezelite.conf
sound/squeezelite/files/squeezelite.init

index d64ff5941b68985db259d517b1de727ca85b3c7e..13834ba5169bb15ebc2f39b9f7c3b968f390f521 100644 (file)
@@ -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
index 6bfcaab3aa77e51e9edc86d6f0ef4e45c0106662..a6895e21ec538807ef779aba51e982b4c34b9cfb 100644 (file)
@@ -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 ''
index de320daf35e16e1406d18911ed92d2436c96d46a..330cc407b7f5cd848cf75853f3d2ae2117fcf558 100644 (file)
@@ -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_<codec> 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
git clone https://git.99rst.org/PROJECT