Disable USB ports when nothing is playing?

I am using Ropieee on a Pi 3B+ to drive a Topping D70 via USB. I notice that the Topping never shuts off, even though I have the “auto-off” feature enabled. I assume this is because RoPieee never disables the USB ports on the Pi, as it does with the HDMI port. Would it be possible to add an option to enable/disable the USB ports automatically when something is being played via the Pi? I believe that would allow the D70 to properly auto-on/off.

I poked around the Linux man pages for a while to see if I could figure out how to do this, but I think a more hands-on Linux person could figure this out better. It probably depends on how Roon Bridge and RoPieee communicate, as well.

1 Like

In connection to this I would like the CPU on Ropieee to throttle down a bit when not in use to run a bit cooler.

Hmmm. I suppose this would cause the D70 to disappear from Roon’s list of devices, if the USB port was disabled. So you couldn’t start to play to it. So, probably not a good idea.

As a fellow Topping owner (DX3 Pro) I’d love this too. But also recognise there could be an issue with it disappearing as an endpoint in the process!

Take a look here
It is working for my E30.
You must change VID and PID with those for D70, DX3 Pro.

1 Like

Maybe not. My system, with the D70 turned on, and with me ssh’ed into it as ‘root’, shows this:

# lsusb
[...]
Bus 001 Device 005: ID 152a:8750 Thesycon Systemsoftware & Consulting GmbH
[...]
#

The same vendorid and deviceid.

Thanks for this!

Appears to be working with my D70 and the latest RoPieee (2.535). There is an issue; it takes a bit from turn-on of the DAC to the sound coming out, 3-4 seconds of the first track will be cut off. Setting a re-sync delay of 4000 ms seems to fix this, though it may be a little off-putting in shuffle mode.

Just to document, this is what was posted by “samsa”, on the ASR site, on June 3, 2020:

  1. Create a file /etc/udev/rules.d/usb-power.rules with a single line in it, which reads

Code:

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="152a", ATTR{idProduct}=="8750", TEST=="power/control", ATTR{power/control}="auto"

The default behavior (which we are trying to change) is for the last attribute value to be "on" instead of "auto"

  1. Reboot.

You are right !
I forgot they have a single driver for all XMOS devices.

The next question is, will the next RoPieee release overwrite it?

I don’t know. But I have the file on my computer and I can put it again after update.

I just made the change, then did a Ropieee update and reboot - the file is still there.
If it was consistently disappearing then running a cron on another machine could be a solution.

Also my DX3 Pro is now waking and sleeping from USB. Excellent! (now if only it would auto-switch between coax, optical, and USB my life would be so much easier)

I haven’t experienced that. I have experienced the “disappearing Zone” effect. Seems to be temporary, though. 'Course I’m not using RoPieee, so that may account for the difference.

What kernel version are you running on?

4.19.127, I believe.

Hmm. In my case, 5.4.49-v8+ #1323. Would be good to collect more data on what works/doesn’t work in different kernel version.

Probably shouldn’t matter, but there’s also the udev version:

$ /lib/systemd/systemd-udevd --version
241

On my topping e30, I need to use udev rules to enable Power control of the USB device to auto which I found on another forum.
Creat a file /etc/udev/rules.d/usb-power.rules

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="XXXX", ATTR{idProduct}=="XXXX", TEST=="power/control", ATTR{power/control}="auto"

Replace XXXX with vendor is and product Id of your own USB device. You can use lsusb to find you USB card vendor Id and product Id.
Then reboot.

I think on manajaro Linux this is the default setting, I didn’t need to change anything it just worked.

1 Like

The switch between input source is a firmware capability, I suppose.
So, you can ask for this feature to Topping.

1 Like

Actually, the kernel version is 4.19.126-1-SPCKFSH-v7. RoPieee version is 2.535, as I noted above.

udev version is 242.84-2-arch

Another way to go with this is to use Roon’s new-in-April “Auto Sleep” feature. RoPieee could presumably hook into this and shut down any non-system Pi USB ports when it is triggered.

After the latest Ropieee update, it sems not working for me anymore.
The file is in place but E30 does not go to sleep.

Yeah, my D70 was on again when I got up this morning.

RoPieee is now 2.566, kernel is 4.19.127-4-SPCKFSH-v7.