USB DAC Dacmagic 200M not detected as output device on rpi 4

DAC is listed as supported. I am using RPI 4 Model B, fresh Volumio OS install.

Cambridge Audio Dacmagic 200M is not recognised as an output device.

I tried all 4 USB ports and reboot, nothing.

lsusb only shows 3 hubs:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

ALSA only detects headphone/hdmi:

**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3

As a sanity check for USB ports, I plugged in a regular USB drive (kingston) and it shows in lsusb aswell as live dmesg so I guess the rpi USB is functional. If I follow dmesg and plug/unplug the DAC there is nothing.

I am using a regular USB 2.0 cable, if plugged into my Mac or Thinkpad which runs Fedora Linux the DAC works fine. On that laptop, alsa shows card 1: C20 [CA DacMagic 200M 2.0] so the cable should be fine. I’ll try to get another one just in case.

This is what I could figure out in 2 hours of testing, so far it seems to be rpi specific or perhaps kernel specific. Lack of any dmesg is perplexing. I guess one way forward is to flash another OS and verify lsusb or alsa can detect it, that would pinpoint it to Volumio OS. Before reflashing, I’d like to hear more ideas on what to check.

Logs:
http://logs.volumio.org/volumio/c1xfhh1.html

  1. USB audio in – For connecting to PC/Mac computers for USB Class 2.0 Audio playback.
    Please note that for Windows devices the CambridgeAudio USB Audio driver must be installed.

with other words your dac supports mac or pc

https://manuals.cambridgeaudio.com/dacmagic-200m

what you could try is to put your dac in standby, after that turn on the rpi and see if it comes up.
and / or try a different usb cable.

The DAC works fine on a linux machine (I have one myself), a kernel patch on the Rivo, Primo, Integro, Odroid and x86 kernels even enables full DSD support.

It should work on PI, as suggested in the previous post, testing another cable would be your first option

I tried to trace USB traffic with usbmon but there is nothing on any of the ports so yeah, I am really starting to think it is something to do with the connection.

I could not quite determine what USB cable I need for dacmagic but I believe it is USB 2.0? @gkkpch what cable are you using? I don’t want to waste money on a bunch of cables and not going anywhere.

they will both work, but 2.0 will do. Mine is one once used for a printer, it is a normal certified usb-hispeed 2.0 A-B cable.

Use one of the usb2.0 ports (the block furthest away from the eth connector), though it should work on usb3.0 as well.

There are other members using it on a PI 4: Cambridge DacMagic 200M not playing DSD.
So apart from the DSD issue, which nobody can solve for the PI except CamBridge (but they refuse to with “not needed”), it is supposed to work well.

I’ll go hunting for some more cables and report back with any further info. Thank you for now. Really hope there is no defect in rpi or… god forbid in the dac which is expensive AF.

It was the cable… I found an old USB cable that came with a CRT screen 15 years ago and now it works… the one I used was from a Brother printer I bought last year.

Now I am really curious why the first cable worked with my 2 laptops but not with RPi… I need to do a deep dive into USB cable specs… the mystery must not remain unsolved.

I also found a USB 3 Type A-B but that is not compatible, it is taller and does not fit. So you need USB 2.0 spec.

it could be one bad connection, but nice that you found the problem :slight_smile:

A follow up on the situation: I am still having a problem when Dacmagic goes to sleep, I wake it up with the power button, it spins around for the input and stops at USB. If I try to play anything on Volumio at this point I get an error: "Failed to open “alsa” (alsa); Failed to open ALSA device “volumio”: No such device. Dacmagic is no longer available from the Output device dropdown but remains “selected”.

If I reboot volumio then it reconnects fine.

So the issue seems to be that Dacmagic does not reconnect to volumio after wake from sleep. Anyone else seeing this?

I’ll play around with kernel logs and udev events, perhaps there is a USB event coming in and I can reset something with a udev rule…

You need to create a log for it to see why the usb re-connection fails.

I own a DacMagic 200M and use it with a Rivo.
As with the Cambridge amps, you can stop the DAC from going asleep, see the online manual.

Me again with some fresh info

The repro is such:

  1. Play some music
  2. Stop
  3. Dacmagic goes to sleep after some time
  4. Volumio app error: The selected output device is not available
  5. Udev event for USB device removal is observed:

UDEV [91395.496712] remove /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3 (usb)
ACTION=remove
DEVPATH=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3
SUBSYSTEM=usb
DEVNAME=/dev/bus/usb/001/006
DEVTYPE=usb_device
PRODUCT=22e8/dac2/1100
TYPE=239/2/1
BUSNUM=001
DEVNUM=006
SEQNUM=2296
USEC_INITIALIZED=91395398816
MAJOR=189
MINOR=5

  1. Turn Dacmagic back on
  2. There is no udev event to bind the USB device again. I am not sure who is at fault here, Dacmagic or Linux.

I tried two workarounds and one seems to work:

  1. udevadm trigger - does not seem to work
    1.1. udevadm trigger /dev/path does not seem to be a workable solution because device is no longer present. In fact, ls /dev/bus/usb/001 shows device 001 and 002 while Dacmagic is not working. When Dacmagic is present a 005, 006, 007 etc is present. Because the device is not present I can’t reset it directly so we need to reset the actual USB hub. Maybe event replay would work but I didn’t get that far…

  2. usbreset command seems to work.

So a dirty hack which would solve this issue might be:

  1. If (dacmagic && “The selected output device is not available”) { usbreset rpi_usb_hub:id }

This is as far as I got with my debugging.

Is there some way I could catch the “The selected output device is not available” error on volumio server side to implement a temporary workaround with some kind of a bash script? I can see

Jan 05 15:57 : exception: nested: Failed to open ALSA device “volumio”: No such device

in /var/log/mpd.log so watching for this log line would be one way I guess.

If devs are interested in implementing a fix like this I am available for further testing.

Why don’t you just stop the DacMagic 200M from going to sleep?
Simple setting.

Having the dac powered on 24/7 seems wasteful. I am just trying to find better solutions that’s all.

I didn’t say to keep it on 24/7, but you certainly have a point.

Hacky workaround script which appears to work for anyone interested: Hotfix for volumio/rpi dacmagic 200m USB reattach from sleep issue · GitHub

Log example:

Waiting for log file..
Log file appeared, start watching
Sun Jan 14 22:30:54 CET 2024 detected log line
Error found in /var/log/mpd.log. Resetting USB device...
Resetting ID "2109:3431"
Resetting USB2.0 Hub ... ok
USB device reset complete.

This saves you a restart or a USB cable unplug/plug.

I discovered it is not just a sleep issue, reattach also fails to happen if I “power off”/put to sleep the DAC manually by pressing the button, then turning it on again.

I think ultimately it must be a driver issue, I’ll try to dive into that when I have the time and the courage.

Hi @cen,

I was using my CA 751-v2 Multi Media Amp as the DAC for a while, but stopped using it for the exact same reason as your DACMAGIC, so likely the driver or CA firmware.

When I next get a chance, I’ll reattach and try your script.

My only other beef with the CA751-v2 is that it won’t accept DSD as an input format, so even if the script works it’ll only be for interest sake and not a longer term solution.

Cheers

This is all on Cambridge who refuses to register the DAC in the quirks list of the linux usb audio driver. They are not interested and focus on the windows market only.
In case you would be using the pc version, there the DacMagic 200M will support DSD because this version uses a Volumio-compiled kernel and I added the patch.
RPi version uses the standard PI kernel, which does not have the quirks patch and there is nothing Volumio can do about it.

BTW, all Volumio products (Rivo, Primo, Integro) support the CamBridge 200M

@gkkpch I don’t use dsd (yet) but just curious, if you have it working in custom kernel, did you consider submitting the patch to LKML?

No, it is not my job to arrange things which Cambridge is not at the least interested in.