It actually made sense to start librespot with --backend alsa, since my USB DAC is on an alsa output (!)
From this thread (I think) I found:
cd /storage/.config/system.d
cp /storage/.kodi/addons/service.librespot/miscellaneous/service.librespot-alsa.service .
systemctl enable service.librespot-alsa.service
The above makes sure that librespot auto-starts librespot at boot, like so:
/storage/.kodi/addons/service.librespot/bin/librespot --backend alsa --bitrate 320 --cache /storage/.config/lsa_cache --device-type computer --disable-audio-cache --name Librespot ALSA Restart=always
edit: I also had to create the file /storage/.config/asound.conf, to tell alsa where the USB DAC sits:
pcm.device {
type hw
card 1
device 0
}
pcm.!default {
type plug
slave.pcm "device"
}
(not sure yet what the 2nd section does here)
So now everything works, except when I switch back to Kodi, to watch something, or play music from there for example: it seems that librespot has taken the audio output, and Kodi outputs no sound (the USB DAC is also no longer listed in the available audio outputs in the system settings).
If I reboot, then Kodi plays audio ok.
There should be an easy way to switch between the two, or maybe (?) get them to both use pulseaudio.