No Audio from USB DAC

Hi! I’m trying to connect a Qudelix 5k USB DAC to my Pi4 running DietPi 6.34.3, LMS and SqueezeLite, but i get no sound from it.

I have tried to change the sound-card to usb-dac from audio settings but can’t get it working

Any help please?

Does the following show the DAC? aplay -l
And do you head something when running: speaker-test
Sometimes sound cards come muted by default, please have a look into alsamixer and raise sound levels or toggle mute switches.

  1. Yes, it shows up
  2. I got this messagges:

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Sample format not available for playback: Invalid argument
Setting of hwparams failed: Invalid argument

  1. Volume is fine

I saw that after choosing the card in dietpi-config and rebooting, LMS won’t even start play the song

Please try to enable the conversion plugin in dietpi-config > Audio Options.

Thanks, now works fine!

Great to hear, so it was quite worth it to add this feature with last DietPi version :sunglasses:.

I’m having a similar problem. No sound output from USB DAC when using Squeezelite.
With other software (not SL) I do get playback from my DAC.
I see two soundcards in my Pi setup: soundcard 0 is default pi, bcm 2835
soundcard 1 is the DAC name

alsa is set to 100%

both outputs work and produce sound when not using Squeezelite, with other network software (playback software such as Roon Bridge, HQP NAA, etc.
When I try to playback with SL, I get no sound output. Acc’d to LMS setup, everything looks okay.

Any ideas?

Did you try to enable the auto-conversion plugin, which solved the OP issue?

Hi-
Yes, I tried that. Didn’t help.
It’s definitely some issue just with SL and LMS, as all other playback software I’ve tried, including network based ones, works.

Does Squeezelite report any error?

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.

In services-squeezelite I deleted the two entries:

[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.

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

systemctl cat squeezelite

This command shows the main unit at the top and overrides below, so gives a nice overview.

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

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.