No Audio from USB DAC Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
User avatar
MichaIng
Site Admin
Posts: 3214
Joined: Sat Nov 18, 2017 6:21 pm

Re: No Audio from USB DAC

Post by MichaIng »

Does Squeezelite report any error?

Code: Select all

journalctl -u squeezelite
Also did you try it with different source formats, or what is the format of the LMS stream?

E.g. there is the known issue that 24/384K & 24/352.8K FLAC files do not play without setting the -W flag in Squeezelite. It seems like in this case LMS is sending wrong parameters so that instead they need to be read from the files headers. I guess it would be also possible to configure LMS to send correct parameters, but not sure: https://github.com/MichaIng/DietPi/issues/4428

Generally an idea would be to remove the command line options we set: https://dietpi.com/docs/software/media/#squeezelite
Starting without any (remove the -a ...), test the -W flag and then going through whats possible and may have an effect depending on audio source file and how LMS is configured: https://manpages.debian.org/squeezelite

I'm also no expert with LMS/SL and don't use it, but probably we can find some better default setup/options or at least collect some cases for our documentation, in which circumstances which flag/option needs to be set or omitted.
firedog
Posts: 10
Joined: Sat Mar 07, 2020 5:17 pm

Re: No Audio from USB DAC

Post by firedog »

In services-squeezelite I deleted the two entries:

Code: Select all

[Unit]
#Description=Squeezelite (DietPi)
#Documentation=man:squeezelite(1) https://ralph-irving.github.io/squeezelite.ht$
#After=sound.target

[Service]
#User=squeezelite
#ExecStart=/usr/bin/squeezelite -a 4096:1024:16:0:0 -C 5 -n '*********'
closed the file and saved it.

I then immediately reopened it and pasted the same two entries back in.
Saved the file and closed it again.

After that everything started working and I got sound.
No idea why that worked, as I essentially changed nothing.

Thanks for your help.
User avatar
MichaIng
Site Admin
Posts: 3214
Joined: Sat Nov 18, 2017 6:21 pm

Re: No Audio from USB DAC

Post by MichaIng »

Hmm very strange :?. Could you show the final systemd unit settings?

Code: Select all

systemctl cat squeezelite
This command shows the main unit at the top and overrides below, so gives a nice overview.
firedog
Posts: 10
Joined: Sat Mar 07, 2020 5:17 pm

Re: No Audio from USB DAC

Post by firedog »

capture.jpg
User avatar
MichaIng
Site Admin
Posts: 3214
Joined: Sat Nov 18, 2017 6:21 pm

Re: No Audio from USB DAC

Post by MichaIng »

Mysterious, so that override does indeed nothing now. Not sure what happened, but it probably doesn't matter when it works now :).

Otherwise, playing with these parameters is worth to try if anything does not work. E.g. I'm not sure why we set the audio format -a 4096... explicitly. I didn't touch these to not break something, but actually I think skipping them, to let Squeezelite fall back to the default and simply pass what it gets from LMS, should be more compatible.

The -C 5 btw means that the audio device connection will be closed after being 5 seconds idle, so e.g. other players can use those. Removing this timeout will lead to Squeezelite keeping the connection active for as long as it is not given an explicit info that should turn off. Not sure how this works, but I think when playback is stopped explicitly in LMS, then this is the case, so the timeout is for cases where e.g. the network connection is lost so that LMS does not send an explicit stop signal, or so. Removing the timeout may lead to a more fluent playback on flaky connections, and prevents any other player/audio source from blocking the sound card.
Post Reply