MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.78k stars 494 forks source link

DietPi-Software | Allo Web Gui - SqueezeLite DSD - DoP KO #2386

Open volpone opened 5 years ago

volpone commented 5 years ago

Required Information:

Steps to reproduce:

Expected behaviour:

Allow SqueezeLite DSD DoP output via -D option: ExecStart=/usr/bin/squeezelite -a 4096:8096:32:0 -C 5 -n 'DietPi-Squeezelite' -f /var/log/squeezelite.log -D (or -D :dop)

OK confirmation SqueeLite launched manually from: /usr/bin/squeezelite -D -a 4096:8096:32:0 -C 5 -n 'DietPi-Squeezelite' -$ or /usr/bin/squeezelite -a 4096:8096:32:0 -C 5 -n 'DietPi-Squeezelite' -$ -D :dop Bingo, my DACs play DSD (DoP) !

Extra details:

DSD Native output seems OK via current Allo Web Gui (-D :u32le|u32be), see #1237; not tested because my DACs doesn't support DSD native.

FYI Usage: squeezelite v1.8.7-1020 [options] ...

-D [delay][:format] Output device supports DSD, delay = optional delay switching between PCM and DSD in ms format = dop (default if not specified), u8, u16le, u16be, u32le or u32be.

volpone commented 5 years ago

Perhaps the best way is to modify Allo Web Gui "DSD Native Output" UI dropdown selector and add a new DoP option:

- Disabled:: unchanged (PCM output) -> No -D option - DoP : add this new option to allow DoP Output -> -D :dop - u8 | u16le | u16be | u32le | u32be : unchanged (native DSD output) -> -D :u8|u16le|u16be|u32le|u32be

Change UI and help tool tip wording: "DSD Output:" vs "DSD Native Output:"

Fourdee commented 5 years ago

@volpone

Hi many thanks for the report/request 👍

We'll open for investigations.

volpone commented 5 years ago

Thank's Dan, IMHO it is an important limitation to overcome and not an additional "feature request". DoP output is currently unavailable, and for a lot of users DoP is the only way to feed DSD DACs. Native DSD output = "Disabled" option output PCM and not DoP DSD

sparkysbc commented 5 years ago

vim /var/www/allo/resources/views/frontend/squeezelite_settings.blade.php line 229 added below line for dop <option value = "dop" <?php if($DSD_NATIVE == 'dop') { echo "selected"; } ?>>dop

image

volpone commented 5 years ago

Thank's @sparkysbc ! Good addition.

Seems OK with current Squeezelite version used with DietPi (v1.8.7-1020) However, last SqueezeLite version (currently not used with DietPi) seems to handle differently -D options. See: https://ralph-irving.github.io/squeezelite.html

-D [delay] Output device supports DSD over PCM (DoP). DSD streams will be converted to DoP before output. If this option is not supplied, DSD streams will be converted to PCM and resampled, so they can be played on a PCM DAC. Delay is an optional time to wait when switching between PCM and DoP between tracks, in milliseconds.

If Squeezelite is upgraded to the last version (2018-05-23) not sure -D :dop still a supported option ?

MichaIng commented 5 years ago

@volpone I just checked pre-compiled binaries from: https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/

First I accidentally downloaded the pulse version, which indeed shows (after installing pulseaudio):

root@VM-Stretch:/tmp# ./squeezelite -?
...
Squeezelite v1.9.1-1137, Copyright 2012-2015 Adrian Smith, 2015-2019 Ralph Irving. See -t for license ...
  -D [delay]            Output device supports DSD over PCM (DoP), delay = optional delay switching between PCM and DoP in ms

Then I downloaded the non-pulse version:

root@VM-Stretch:/tmp# ./squeezelite -?
Squeezelite v1.9.1-1137, Copyright 2012-2015 Adrian Smith, 2015-2019 Ralph Irving. See -t for license terms
...
  -D [delay][:format]   Output device supports DSD, delay = optional delay switching between PCM and DSD in ms
                         format = dop (default if not specified), u8, u16le, u16be, u32le or u32be.

So the man page seems to be related to the pulse version which seems to only allow switching between native DSD (no argument) and DoP (-D). However both binaries can simply be used with -D since: format = dop (default if not specified)

I already wanted to simply overwrite our binaries with the v1.9 ones but found the enormous difference in size:

-rwxrwxr-x 1  501  501 2642416 Mar 18 15:36 squeezelite # from SourceForge
-rwxr-xr-x 1 root root  144512 Nov 30  2017 squeezelite_amd64 # from dietpi.com

The argument could be added/removed by adding/removing /etc/systemd/system/squeezelite.service.d/dietpi-dop.conf drop-in config which overrides the ExecStart= or environment file, e.g. /etc/default/squeeselite which contains a DOP='' variable and if already there an OPTIONAL_ARGS='' so users can further customize.

@Fourdee Which magic did you use to create such tiny binaries? Or is it some compile time option (e.g. ffmpeg and such) which raise the size? Recompiling could be done but IMO is not critical since above request/issue can be solved with v1.8.7 as well.

I found code to remove an init.d service and purge a package when uninstalling SqueezeLite in DietPi-Software. Did we ship this via APT package? "Blame" does not work on dietpi-software since, I guess, the script is too large. Just face the angry Unicorn that page loading takes too long 😆. ... Answered it myself: https://packages.debian.org/stretch/squeezelite

volpone commented 5 years ago

Thank's @MichaIng !

volpone commented 5 years ago

@MichaIng, some hope next DiePi release will include latest SqueezeLite ?. Current version (1.8.7) is quite old. Thank you.

MichaIng commented 5 years ago

@volpone It's on the list, see milestone 🙂.

volpone commented 5 years ago

Great @MichaIng !

MichaIng commented 4 years ago

New squeezelite 1.9.7 packages are ready for testing:

systemctl disable --now squeezelite
mv /etc/systemd/system/squeezelite.service{,_bak}
cd /tmp
wget https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/squeezelite_$G_HW_ARCH_NAME.deb
apt install ./squeezelite_$G_HW_ARCH_NAME.deb
rm squeezelite_$G_HW_ARCH_NAME.deb

Allo web GUI support for switching native DSD will be at latest added with next DietPi release, but this one is in beta stage already.