Happy Fun YMMV Settings to make RPi3b+ work with USB DAC *&* Ethernet

I recently bought a NavoLabs Raspberry Pi 3+ Micro PoE HAT so I could make use of my PoE switch for driving power and connectivity to my Pi and DAC. Boy was I in for a fight. PoE works wondefully, RoPieee worked perfectly on wifi (once I dealt with country code), but holy wow was the audio quality just garbage while using the ethernet.

Just straight up pops, clicks, and hiss when pushing anything over 96kHz PCM to my Topping DX7s. Didn’t matter if I had a Schiit Wyrd between the DAC and the Pi or not. I knew the DAC was fine and the Pi when on wifi worked perfectly. I was NOT about to use the cat6 just for power while using wifi for data. Looks like I was in for a fight with the horrible dwc_otg (because sharing ethernet and external usb on a single USB2.0 channel is a good idea, right?).

So, after a few days of flailing (flail, fail, rage, etc), I was finally able to get my RPi3b+ with RoPieee to handle my Topping DX7s DAC and built in Ethernet connectivity. I still get the horrible noise when trying DSD512 or 768kHz PCM, but I’m TOTALLY fine with DSD256 and 384kHz PCM.

The config change?

/boot/cmdline.txt just needs the following options added:

dwc_otg.microframe_schedule=1 dwc_otg.dma_enable=1 dwc_otg.dma_burst_size=256

This a total YMMV setup.

Forgot to mention, the problem was happening on all of my Pi3b+, and on all of my power sources. If ethernet was in the mix, everything was gaaaaarbage.

hmm… interesting.

Question: have you tested this on different Pi’s? So are you suggesting this is a Pi3b+ only issue?

I’ve only tested this on a pair of Pi3b+. There is a known issue when trying to use USB and Ethernet (is all over the googles when searching). Generally if you try and push a USB DAC above 96kHz while using the builtin Ethernet, it’ll sound like canned dog-poop. Pops, crackles, hiss, and all the other fun stuff that sounds like someone took a cheese grater to vinyl.

Power source doesn’t matter, happens on all of the power bricks I’ve got, happens when taking power from stable usb hubs, even happens when taking PoE from a Cisco Catalyst 3850U-E. I’m willing to believe it is NOT a power problem.

DAC doesn’t matter. Happens on my Topping DX7s and TEAC UD-501. The higher the rate of DSD or PCM, the more noise it generates. I assume it’d happen on any other high end DAC.

Putting the DAC behind something like a Schiit Wyrd doesn’t really make that big of a difference either. It still is very much pophisssscrackle.

Swapping USB cables out didn’t make much of a difference either. 6", 1.5’, 6’, they all sounded horrible.

dwc_otg.dma_enable=1 may not be needed. Is possibly the default value. But hey, better safe than noisy. This just tells it to use DMA mode for accessing FIFO.

dwc_otg.dma_burst_size=256 bumps the size of the DMA burst from the default of 32. Lets it do more at once.

dwc_otg.microframe_schedule=1 Makes the scheduler act nicer when there are multiple USB endpoints. Like… when you have USB ethernet AND USB DAC.

These don’t seem to cause any problems for my WiFi only Pi3b+ with RoPieeee, and the combination of them makes my PoE HAT enabled RoPieeee usable. But, Your Mileage May Vary.

The RPi3B+ (and only 3B+) is a mess in terms of Ethernet networking. Even their engineer admitted it in their forums. The 3B+ can’t handle more than 100Mbps reliably (it is supposed to be able to handle 300Mbps on a gigabit port) and LAN is shared with USB, so when people try to use both at the same time they are not happy. Their engineers recommend connecting it to a switch with flow control enabled.

But… It can handle 100Mbps reliably just like the Pi3B. So, a simple solution is to restrict the LAN to 100Mbps. No need to fiddle with any obscure parameters. See my post in another thread on how to do it (last two paragraphs): Raspberry Pi 3b+ Clicking on USB Audio Devices Disabling the EEE reportedly helps but I am not sure it is necessary.

I’m more than familiair with the USB/ethernet/wifi restrictions on the Pi. I was just curious if this was a 3+ issue only. Personally I’ve never had a problem up to DSD256.

I actually did try to disable gigE during my initial testing (‘speed auto 10 100’ on the Cisco). Didn’t make any difference for me. It is interesting watching a ping against the Pi3b+ when trying to use it with stock settings, USB DAC, and builtin ethernet. Every time it starts generating the trash noise, there is a latency spike local to the Pi itself. Pings’ll go from that nice 0.2ms to 40+, sometimes hundreds. Like there is a spinlock/deadlock going on. Clearly a scheduler malfunction.

I’ll have to try disabling EEE and see if I can’t get myself able to do DSD512.

That’s the thing. If you disable gigE on the switch the Pi3B+ negotiates 100M half duplex. It did it for me and I saw a couple of similar reports on their forums. Try doing it on the Pi.

My Pi negotiated 100Full just fine. I used ‘speed auto 10 100’ on the switch, this allows auto-negotiation to happen while discarding the gig.

[root@ropieee01 ~]# mii-tool eth0
eth0: negotiated 100baseTx-FD, link ok

Switch also sees it at 100Full.

switch-01.home#sh int gigabitEthernet 1/0/23 status

Port Name Status Vlan Duplex Speed Type
Gi1/0/23 General Purpose connected 2 a-full a-100 10/100/1000BaseTX

No joy on the EEE.

Also, no joy on Flow Control. The Cisco Catalyst 3850 doesn’t support output flow-control (at this time? on my version). I don’t think I’m going to get much higher than DSD256.

I’m not sure if this specific to this model. I don’t have any Pi gear older than the 3b+. Most of my forays into the land of ARM have been centered on nVidia Tegra and TI OMAP series, both of which have vastly better implementations of ethernet and USB.

I only bought the Pi3b+ because I figured it’d be cheaper and more power efficient than throwing an Atom at the task. Also because so much easier to use work someone else (you) did, instead of rolling my own ARM setup.

I’ve zero complaints with how things work when using WiFi and USB. Absolutely no problems there once I got my WiFi using the proper country code settings.

I found an older discussion (before the 3B+ was released) mentioning DSD512 problems on the 3B with Ethernet. https://community.roonlabs.com/t/hqp-naa-raspberry-pi/6140/192 I didn’t read it completely but it seemed nobody could really test DSD512 but anticipated problems. Maybe this problem is not unique to 3B+ but general for Pi’s that share USB and Ethernet.

1 Like

It seems it’s the other way around. Here it says: “The switch ports can receive, but not send, pause frames.”
I think that’s what you need. If the Pi experiences congestion it can send a pause frame to your switch and it will receive it, and stop sending until the condition clears.

Probably, and I’m not overly worried if DSD512 and 768kHz don’t work. DSD256 & 384kHz are more than sufficient for my purposes, and if they didn’t work DSD128 & 192kHz sound fine. I mean, how much can I expect to squeeze out of a $35 box?

My main goal was to make use of the rather stable -48v DC that I can toss around to power this Pi. I wasn’t expecting that I’d run into an ethernet controller related limitation. Probably should have done my research before hitting the go button. :slight_smile:

Overall, it’ll do what I wanted; run my DAC independently from any of my workstations or servers at nearly the same performance as running it on one of the aforementioned systems.