File tree Expand file tree Collapse file tree 7 files changed +36
-4
lines changed
Expand file tree Collapse file tree 7 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,8 @@ ENV ALSA_OUTPUT_OUTPUT_FORMAT ""
112112ENV ALSA_OUTPUT_AUTO_RESAMPLE ""
113113ENV ALSA_OUTPUT_THESYCON_DSD_WORKAROUND ""
114114ENV ALSA_OUTPUT_INTEGER_UPSAMPLING ""
115+ ENV ALSA_OUTPUT_INTEGER_UPSAMPLING_ALLOWED ""
116+ ENV ALSA_OUTPUT_INTEGER_UPSAMPLING_ALLOWED_PRESET ""
115117ENV ALSA_OUTPUT_DOP ""
116118
117119ENV PULSE_AUDIO_OUTPUT_CREATE ""
@@ -222,6 +224,7 @@ COPY app/bin/get-value.sh /app/bin/
222224COPY app/bin/read-file.sh /app/bin/
223225COPY app/bin/build-soxr-presets.sh /app/bin/
224226COPY app/bin/build-allowed-formats-presets.sh /app/bin/
227+ COPY app/bin/build-integer-upsampling-allowed-presets.sh /app/bin/
225228COPY app/bin/load-alsa-presets.sh /app/bin/
226229COPY app/bin/build-additional.sh /app/bin/
227230COPY app/bin/user-management.sh /app/bin/
Original file line number Diff line number Diff line change @@ -27,14 +27,14 @@ Images: [DockerHub](https://hub.docker.com/r/giof71/mpd-alsa)
2727## MPD Source code
2828
2929The source code is in this GitHub [ repo] ( https://github.com/GioF71/MPD ) .
30- The ` v0 .23.x ` branch is kept in-line with the GitHub [ upstream repo] ( https://github.com/MusicPlayerDaemon/MPD ) .
31- The ` v0 .23.x -ups` branch contains a patch which is used when ` INTEGER_UPSAMPLING ` is set to ` yes ` . Use at your own risk.
30+ The ` version-0 .23.12 ` tag is in-line with the GitHub [ upstream repo] ( https://github.com/MusicPlayerDaemon/MPD ) at version 0.23.12 .
31+ The ` version-0 .23.12 -ups` tag contains a patch which is used when ` INTEGER_UPSAMPLING ` is set to ` yes ` . Use at your own risk.
3232Two binaries are available in the container image:
3333
3434- /app/bin/compiled/mpd (stable version)
3535- /app/bin/compiled/mpd-ups (patched version)
3636
37- The current mpd version is ` v0.23.11 ` .
37+ The current mpd version is ` v0.23.12 ` .
3838
3939## Why
4040
@@ -249,6 +249,8 @@ ALSA_OUTPUT_OUTPUT_FORMAT|yes|Sets output format
249249ALSA_OUTPUT_AUTO_RESAMPLE|yes|Sets auto resample
250250ALSA_OUTPUT_THESYCON_DSD_WORKAROUND|yes|Enables workaround
251251ALSA_OUTPUT_INTEGER_UPSAMPLING|yes|Enables integer upsampling
252+ ALSA_OUTPUT_INTEGER_UPSAMPLING_ALLOWED|yes|Allows selection of sample rates to be upsampled. If set, only specified values are allowed. The values should respect the same format user for ` ALSA_OUTPUT_ALLOWED_FORMATS `
253+ ALSA_OUTPUT_INTEGER_UPSAMPLING_ALLOWED_PRESET|yes|Preset for ` ALSA_OUTPUT_INTEGER_UPSAMPLING_ALLOWED ` . Allowed values are ` base ` (for 44.1kHz and 48.0kHz) and ` 44 ` for 44.1kHz only
252254ALSA_OUTPUT_DOP|yes|Enables Dsd-Over-Pcm. Possible values: ` yes ` or ` no ` . Empty by default: this it lets mpd handle dop setting.
253255
254256For the meaning, refer to the corresponding values in the first list of environment variables.
Original file line number Diff line number Diff line change @@ -202,6 +202,19 @@ build_alsa() {
202202 alsa_out_set_values[$alsa_set_key ]=" ${c_allowed_formats} "
203203 fi
204204 fi
205+
206+ # integer upsampling allowed presets
207+ c_integer_upsampling_allowed_preset=$( get_named_env ALSA_OUTPUT_INTEGER_UPSAMPLING_ALLOWED_PRESET $idx )
208+ if [ -n " ${c_integer_upsampling_allowed_preset} " ]; then
209+ echo " Integer Upsampling Allowed set for alsa output [$idx ] -> [${c_integer_upsampling_allowed_preset} ]"
210+ c_integer_upsampling_allowed=" ${integer_upsampling_allowed_presets[${c_integer_upsampling_allowed_preset}]} "
211+ echo " translates to [${c_integer_upsampling_allowed} ]"
212+ if [[ -n " ${c_integer_upsampling_allowed} " ]]; then
213+ alsa_set_key=" integer_upsampling_allowed.${idx} "
214+ alsa_out_set_values[$alsa_set_key ]=" ${c_integer_upsampling_allowed} "
215+ fi
216+ fi
217+
205218 # debug dump values
206219 # # sz=`echo "${#alsa_out_set_values[@]}"`
207220 # # echo "There are [$sz] available alsa_presets"
@@ -220,6 +233,7 @@ build_alsa() {
220233 add_output_parameter $out_file $idx ALSA_OUTPUT_AUTO_RESAMPLE auto_resample " " none
221234 add_output_parameter $out_file $idx ALSA_OUTPUT_THESYCON_DSD_WORKAROUND thesycon_dsd_workaround " " none
222235 add_output_parameter $out_file $idx ALSA_OUTPUT_INTEGER_UPSAMPLING integer_upsampling " " none
236+ add_alsa_output_parameter $out_file $idx ALSA_OUTPUT_INTEGER_UPSAMPLING_ALLOWED integer_upsampling_allowed " " none " integer_upsampling_allowed"
223237 add_output_parameter $out_file $idx ALSA_OUTPUT_DOP dop " " none
224238 close_output $out_file
225239 # see if the ups version must be enforced
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ declare -A integer_upsampling_allowed_presets
4+
5+ integer_upsampling_allowed_44=44
6+ integer_upsampling_allowed_base=base
7+
8+ integer_upsampling_allowed_presets[$integer_upsampling_allowed_44 ]=" 44100:*:*"
9+ integer_upsampling_allowed_presets[$integer_upsampling_allowed_base ]=" 44100:*:* 48000:*:*"
10+
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ declare -A file_dict
3737
3838source build-soxr-presets.sh
3939source build-allowed-formats-presets.sh
40+ source build-integer-upsampling-allowed-presets.sh
4041source read-file.sh
4142source get-value.sh
4243source load-alsa-presets.sh
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ echo "Base Image Tag: ["$selected_image_tag"]"
6464echo " Build Tag: [" $tag " ]"
6565echo " Proxy: [" $proxy " ]"
6666
67- docker build . --no-cache \
67+ docker build . \
6868 --build-arg BASE_IMAGE_TAG=${selected_image_tag} \
6969 --build-arg USE_APT_PROXY=${proxy} \
7070 -t giof71/mpd-alsa:$tag
Original file line number Diff line number Diff line change 22
33Date|Major Changes
44:---|:---
5+ 2023-02-03|Add support for ` ALSA_OUTPUT_INTEGER_UPSAMPLING_ALLOWED `
6+ 2023-02-03|Bump to mpd version ` v0.23.12 `
572023-01-30|Add support for ` AUDIO_BUFFER_SIZE `
682023-01-20|Player state enforced by default
792023-01-17|` HTTPD_OUTPUT_TAGS ` had typo in name
You can’t perform that action at this time.
0 commit comments