So I have been playing around with a USB DAC that I just bought HiFime Sabre 9018 USB DAC
It works fine with Kodi and Spotify after first setting it up and booting. I chose sysdefault:CARD=Audio from the Spotify Connect Web app and then PCM etc. Shows up instantly and doesn't even have to be connected during before you boot up LibreElec.
Here's the annoying part: if I reboot the LibreElec from the menu, it stops working. When I try to select a different audio device to use from the Spotify app i just get an error. I tried selecting the HDMI/Analog for Kodi in case they were having issues sharing the same output device, but this doesn't resolve the issue.
It works if I unplug the USB DAC and then do the following:
1. Reselect the integrated HDMI/ANALOG output device while the DAC is disconnected. Select OK
2. Insert the USB DAC again and go back to output device selection, then it will let me pick the DAC again and LibreElec almost instantly shows up on my Spotify app and works again.
I've taken a snippet of the log, the first is the device which seems to register as the default audio device for Spotify, hw:0. The next is the error after rebooting the Pi and it tries to use the USB DAC again and can't find it.
06:53:16.646 T:1961923696 NOTICE: Enumerated ALSA devices:
06:53:16.646 T:1961923696 NOTICE: Device 1
06:53:16.646 T:1961923696 NOTICE: m_deviceName : @:CARD=Audio,DEV=0
06:53:16.646 T:1961923696 NOTICE: m_displayName : SA9023 USB Audio
06:53:16.646 T:1961923696 NOTICE: m_displayNameExtra: Analog
06:53:16.646 T:1961923696 NOTICE: m_deviceType : AE_DEVTYPE_PCM
06:53:16.646 T:1961923696 NOTICE: m_channels : FL,FR
06:53:16.646 T:1961923696 NOTICE: m_sampleRates : 48000
06:53:16.646 T:1961923696 NOTICE: m_dataFormats : AE_FMT_S16NE,AE_FMT_S16LE
06:53:16.646 T:1961923696 NOTICE: m_streamTypes : No passthrough capabilities
06:56:29.041 T:1874850720 WARNING: CPythonInvoker(15): Script invoked without an addon. Adding all addon modules installed to python path as fallback. This behaviour will be removed in future version.
06:56:31.074 T:1874850720 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'alsaaudio.ALSAAudioError'>
Error Contents: No such file or directory [hw:0]
Traceback (most recent call last):
File "/storage/.kodi/addons/service.spotify-connect-web/wizard.py", line 42, in <module>
mixers = [mixer for mixer in alsa.mixers(cardindex=cardx, device=device)
ALSAAudioError: No such file or directory [hw:0]
-->End of Python script error report<--
Display More
I'm at a loss here and I realize this is probably not a priority, though I wanted to be able to use LibreElec hooked up to a sound system to stream spotify headlessly (no HDMI), so this kinda sucks