Posts: 28
Threads: 5
Joined: Oct 2018
Reputation:
0
(08-18-2021, 11:23 AM)Tim Curtis Wrote: With the Pi on do you ever switch your DAC off or change the input?
Doing this would prolly cause an ALSA error since the USB device has gone away. When you turn the device back on though it should automatically be re-recognized by Linux after a few seconds.
I always turn the DAC off between sessions, always have done. The DAC boots slow-ish siting there thinking about things for a few seconds before it decides it's got a good input, then there's a tik noise from an internal relay and music flows.
It appears that, once it's in this error state, there's no automatic recovery.
At some point today I'll power everything down, and be a bit more methodical on what I do and when going from startup to playback. Perhaps a pattern will emerge. I'll let you know.
Posts: 28
Threads: 5
Joined: Oct 2018
Reputation:
0
1. Turned off DAC, PI continues working, I can play tracks (into nothing)
2. Shutdown PI, turned off power, waited 30 secs, turned on PI, started a track playing on PI, turned on DAC and music played once DAC booted.
So nothing obviously wrong. I'll continue to play, but I suspect this is going to be a waiting game for the problem to reoccur.
Posts: 28
Threads: 5
Joined: Oct 2018
Reputation:
0
Today I've restarted Moode 10 times with no change. MPD config continued to show DAC as unavailable/switched off. I left the DAC switched on and with the USB input selected. I repeatedly changed MPD output device, saved MPD settings over a period of about 20 minutes.
- Switched MPD output device to HDMI, restarted MPD, DAC stayed on device list as off/unavailable, then restarted Moode, DAC was gone from the list.
- Switched MPD output device to headphones, restarted MPD, DAC not on device list
- Switched MPD output device to HDMI, restarted MPD, DAC not on device list
- Switched MPD output device to headphones, restarted MPD, DAC on device list
Then, I selected the DAC as the output device saved config and got output to DAC. Restarted Moode, still had output.
I have no idea why Moode could suddenly see the DAC.
Is there anything I can add in logging that'll explain what's happening over MPD/USB?
Posts: 13,406
Threads: 304
Joined: Mar 2018
Reputation:
543
Not really.
Normally after a USB audio device is plugged in and configured in MPD Config it can be unplugged or turned off then plugged back in or turned on and Linux/ALSA will simply re-recognize the device after a brief period of time. The MPD configuration for USB audio devices is persistent and thus no need to redo MPD Config.
In your case it appears that for this particular audio device after turning it back on Linux/ALSA does not "see it". This would suggest some sort of hardware or USB cable issue or some type of incompatibility between the particular audio device and Linux/ALSA.
Posts: 6,019
Threads: 176
Joined: Apr 2018
Reputation:
235
Schiit makes quite a fuss about its proprietary Unison USB interface. I wonder if other Schiit DAC users have seen similar issues with Linux ALSA.
Regards,
Kent
Posts: 28
Threads: 5
Joined: Oct 2018
Reputation:
0
I've tried several different cables and there's no difference in behaviour.
Just had another try today and it's definitely a thing. Started Moode and it thinks the DAC is offline. Switched to HDMI + restart, DAC disappears from list, and two further restarts of Moode and on the second the DAC is detected. Seems to me that something is only periodically receptive to making a USB connection, as if there's a timeout that has to complete. I suspect the DAC as that's the thing that stay on during Moode restarts.
I've been in the habit of switching off the DAC before I shut Moode down. I'll leave the DAC on, shut Moode down, then turn the DAC off.
Unison? My Gungnir is a few years old, and is running Schiit Gen 5 I think. Thing is though, I've been running Moode OK for some time and all of these connection problems started when I upgraded from the last 6.* to 7.0. Not saying it's Moode's fault, but that clearly there's been a shift in USB handling somewhere in the OS that's provoking something in the DAC. Or perhaps the DAC has developed a fault...
I'll run a couple more tests and then contact Schiit to see if they've got any sage advice.
Posts: 6,019
Threads: 176
Joined: Apr 2018
Reputation:
235
10-07-2021, 08:59 PM
(This post was last modified: 10-07-2021, 09:45 PM by TheOldPresbyope.
Edit Reason: fix typo
)
@ Steven Crook
Remember that all the audio device detection, connection, and communication occurs in the Linux kernel, its drivers, and the Advanced Linux Sound Architecture (ALSA) layer.
Quote:all of these connection problems started when I upgraded from the last 6.* to 7.0.
Aha, and if you read the moOde release notes ( /var/www/relnotes.txt) you'll see this snippet:
Code: ################################################################################
#
# 2020-12-15 TC moOde 7.0.0
#
################################################################################
New features
...
Updates
- UPD: Bump to RaspiOS 10.6
- UPD: Bump to Linux kernel 5.4.77 build #1371
...
My experience with manufacturers is that when you merely name a specific Linux-based player they immediately say "talk to the player developer". You need to confirm with Schiit that its Gen5 USB interface works with these versions of RaspiOS and kernel. For reference, RaspiOS 10.6 is based on Debian 10.6 and both are codenamed Buster.
Regards,
Kent
PS - there's plenty of legwork you could do from the command line, for example reading the output of the dmesg command (or reading the /var/log/kern.log file) for the case when the DAC is detected during boot and also for the case when the DAC is not detected.
Here's examples with my Khadas Tone1 USB DAC (firmware updated from original release)
Code: pi@rpi4b2:~ $ dmesg
...lots of lines of output
[14187.746985] usb 1-1.3: new high-speed USB device number 21 using xhci_hcd
[14187.877881] usb 1-1.3: New USB device found, idVendor=3353, idProduct=a001, bcdDevice= 2.00
[14187.877901] usb 1-1.3: New USB device strings: Mfr=1, Product=3, SerialNumber=0
[14187.877917] usb 1-1.3: Product: Tone1
[14187.877934] usb 1-1.3: Manufacturer: Khadas
[14187.885092] usb 1-1.3: 1:3 : unsupported format bits 0x100000000
[14258.352071] usb 1-1.3: USB disconnect, device number 21
[14258.658195] usb 1-1.3: new high-speed USB device number 22 using xhci_hcd
[14258.789090] usb 1-1.3: New USB device found, idVendor=3353, idProduct=a001, bcdDevice= 2.00
[14258.789109] usb 1-1.3: New USB device strings: Mfr=1, Product=3, SerialNumber=0
[14258.789126] usb 1-1.3: Product: Tone1
[14258.789142] usb 1-1.3: Manufacturer: Khadas
[14258.793385] usb 1-1.3: 1:3 : unsupported format bits 0x100000000
Note the "USB disconnect" line. There seems to be a repeating cycle of discovery and disconnection before things settle down. I don't know why (perhaps it's a little starved for power?). The same pattern is repeated in the kern.log file but with full date/time stamp.
Once this discovery and connection is done, the USB DAC should show up in the summary output from the lsusb command. As well, various audio related endpoints should show up in its verbose mode.
Again, the Khadas Tone1 (note the firmware dev didn't bother to have the interface announce itself by name in the summary line; eg, assigned no string value to the idVendor and idProduct parameters)
Code: # Show the detected USB devices
pi@rpi4b2:~ $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 022: ID 3353:a001 <<<=== this is the Khadas interface
Bus 001 Device 003: ID 05dc:a81d Lexar Media, Inc. LJDTT16G [JumpDrive 16GB]
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
# Dump just the first stanza to see the manufacturer and product names
pi@rpi4b2:~ $ sudo lsusb -v -d 3353:a001|head -17
Bus 001 Device 023: ID 3353:a001
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x3353
idProduct 0xa001
bcdDevice 2.00
iManufacturer 1 Khadas
iProduct 3 Tone1
iSerial 0
bNumConfigurations 2
# See if there are audio-related features
pi@rpi4b2:~ $ sudo lsusb -v -d 3353:a001|grep -i audio
bFunctionClass 1 Audio
bInterfaceClass 1 Audio
AudioControl Interface Descriptor:
AudioControl Interface Descriptor:
AudioControl Interface Descriptor:
AudioControl Interface Descriptor:
AudioControl Interface Descriptor:
AudioControl Interface Descriptor:
...blah blah blah...
And then we're off to aplay and other familiar commands.
Posts: 28
Threads: 5
Joined: Oct 2018
Reputation:
0
That's a lot to think about. I'll try looking tomorrow when it's going to boot and have the device error and I can see what dmesg and lsusb have to say...
One thing. I have Moode and the DAC talking happily. I power off the DAC. Change the output device to Headphones. Shut down Moode and unplug power. Start Moode. On start DAC is still in the list of devices though the DAC is powered off. I start the DAC and when it's stable I hear the relay click indicating it's chatting to Moode, though Headphones is still the output device. Change the output device to DAC, restart MPD and it plays.
Which makes me wonder why this is different to shutdown/power off at night and restart in the morning. Is the OS operating a cache of devices and timing them out? So, it's tripped on boot in the morning because it's several hours since it last saw the device.
Posts: 13,406
Threads: 304
Joined: Mar 2018
Reputation:
543
10-09-2021, 08:49 PM
(This post was last modified: 10-10-2021, 01:09 AM by Tim Curtis.
Edit Reason: Fix typos and missing grammar
)
Discovered USB devices are kept in the MPD list to allow switching between HDMI, Headphones and USB, and also if the USB device happens to be unplugged or powered off it can be plugged back in or powered on and its config will be intact.
This works perfectly fine with most USB Audio devices but with your particular device there appears to be a hardware or cable issue that is causing the device to intermittently be unrecognized by Linux/ALSA after power up.
Posts: 28
Threads: 5
Joined: Oct 2018
Reputation:
0
(10-09-2021, 08:49 PM)Tim Curtis Wrote: Discovered USB devices are kept in the MPD list to allow switching between HDMI, Headphones and USB, and also if the USB device happens to be unplugged or powered off it can be plugged back in or powered on and its config will be intact.
This works perfectly fine with most USB Audio devices but with your particular device there appears to be a hardware or cable issue that is causing the device to intermittently be unrecognized by Linux/ALSA after power up.
The MPD cache is what I'd assumed to be the case. I think a cable fault is really unlikely, I've tried three different cables, it makes no difference. Hardware faults tend to be either there or not, and I'm not moving anything so I doubt it's a loose connection. I'd wondered if there was more up-to-date firmware that would fix issues in the USB subsystem, but AFAIKT the firmware comes with the distribution. That so?
The fact that the DAC and Pi can talk happily makes me think it's a software issue either in Alsa/MPD or DAC. Protocol issues in USB comms. But beyond that I really don't know. I still don't have enough to take to Schiit and have them spend time on it, particularly when they've got a shiny new USB interface they can say is flawless.
I spent a few hours going round in circles with Alsa trying to see if there were diagnostics I could get out of it for its chatting over USB. Eventually I decided I'd put in enough time and effort, and there were other, more enjoyable things I could be doing. Like listening to music. So I dug up the HiFi Berry Digi+ I've had hidden in a box. It works of course. But not being able to use USB still irks me
Anyway. I'll try USB as each new release and will post back here if things change. I have plans to order a couple more Pi and I'll try those too. If I discover anything useful I'll post back here.
|