shairport-sync: fixed diagnostics settings
authorDavid Andreoletti <david@andreoletti.net>
Tue, 2 Apr 2024 15:53:17 +0000 (23:53 +0800)
committerRosen Penev <rosenp@gmail.com>
Sun, 23 Jun 2024 18:17:49 +0000 (11:17 -0700)
shairport-sync expects statistics/log_verbosity/log_output_to settings
to be in the diagnostics section of shairport-sync's native config.

Prior to this commit, these settings were either missing (log_output_to)
or generated in the incorrect (general) native config section bloc.

Signed-off-by: David Andreoletti <david@andreoletti.net>
sound/shairport-sync/files/shairport-sync.config
sound/shairport-sync/files/shairport-sync.init

index 42a4acf1d7d4938afcff25a06490b07dfffcf551..d0bd4fad7223f225d06a9ca3cde92ee27713d2cc 100644 (file)
@@ -18,10 +18,10 @@ config shairport-sync 'shairport_sync'
        option port '' # 5000
        option udp_port_base '' # 6001
        option udp_port_range '' # 100
-       option statistics '' # no/yes
+       option statistics '' # no/yes - DEPRECATED: This option will be removed in a future release. Use 'diagnostics_statistics' instead
        option drift '' # 88
        option resync_threshold '' # 2205
-       option log_verbosity '' # 0/1/2/3
+       option log_verbosity '' # 0/1/2/3 - DEPRECATED: This option will be removed in a future release. Use 'diagnostics_log_verbosity' instead
        option ignore_volume_control '' # no/yes
        option volume_range_db '' # 30 to 150
        option regtype '' # _raop._tcp
@@ -74,3 +74,7 @@ config shairport-sync 'shairport_sync'
        # AO
        option ao_latency_offset '' # 0
        option ao_buffer_length '' # 44100
+       # Diagnostics
+       option diagnostics_statistics '' # no/yes
+       option diagnostics_log_output_to '' # syslog/stderr/stdout
+       option diagnostics_log_verbosity '' # 0/1/2/3
index 15339704055554ff77a3d33033b886598ec9bf8d..6eafcd02d94c1bd9c704d2b091b0e64e7620bf4d 100644 (file)
@@ -56,10 +56,8 @@ start_instance() {
                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"
@@ -141,6 +139,17 @@ start_instance() {
                append_num "$cfg" ao_latency_offset "audio_backend_latency_offset"
                append_num "$cfg" ao_buffer_length "audio_backend_buffer_desired_length"
                printf "};\n\n"
+
+               # Diagnostics
+               config_get log_verbosity "$cfg" log_verbosity
+               config_get statistics "$cfg" statistics
+
+               printf "diagnostics =\n"
+               printf "{\n"
+               append_str "$cfg" diagnostics_statistics "statistics" "${statistics}"
+               append_str "$cfg" diagnostics_log_output_to "log_output_to"
+               append_num "$cfg" diagnostics_log_verbosity "log_verbosity" "${log_verbosity}"
+               printf "};\n\n"
        } > "$conf_file"
 
        procd_open_instance