T4 power to the USB ports

Moderators: Gully, peteru

Post Reply
Allen
On probation
Posts: 2
Joined: Fri Jun 26, 2015 11:07

T4 power to the USB ports

Post by Allen » Wed Jun 03, 2020 23:28

Some time ago I had the same problem many have with the voltage regulators for the tuners. I lost A and B. A friend of mine helped me get it up and running once more with some new ones and heat sinks I bought and some neat soldering. However I’ve still been experiencing what I think is over heating issues.
I got a 5V fan from Jaycar and connected it to a USB cable. Placing this in the case and connecting it to a USB port seems to work a treat.
Problem as you have most likely already guessed is the fan never stops. I went searching and found what I hope might work to disable the power going to the USB ports.
I wanted to see if I could run something like the following, I’ve seen a few variations. “Echo 0 >/sys/bus/usb/drivers/unbind” but I can’t get this to run without permissions errors or I/O errors. Even if I change the file permissions. :(
Any thoughts on what might work here? Thank you in advance.

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: T4 power to the USB ports

Post by peteru » Thu Jun 04, 2020 02:06

Connect the fan to the same header as the T4 case fan. After that you can use the normal fan control plugin to select the fan speed.

"Beauty lies in the hands of the beer holder."
Blog.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: T4 power to the USB ports

Post by prl » Thu Jun 04, 2020 11:08

Allen wrote:
Wed Jun 03, 2020 23:28
I wanted to see if I could run something like the following, I’ve seen a few variations. “Echo 0 >/sys/bus/usb/drivers/unbind” but I can’t get this to run without permissions errors or I/O errors. Even if I change the file permissions. :(
Any thoughts on what might work here? Thank you in advance.

First, echo, not Echo. Linux command names are case-sensitive. You're not getting an error for that, because redirection is done (and fails) before the shell tries to execute the command.

Second, my T4 (firmware 20200405) doesn't have an unbind in /sys/bus/usb/drivers:

Code: Select all

root@beyonwizt4:~# ls /sys/bus/usb/drivers
btusb        usb          usbfs        zd1201
hub          usb-storage  usbhid
That's why you're getting "Permission denied". /proc and /sys are special system-created filesystems, and not even the root user can make files in them.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

Allen
On probation
Posts: 2
Joined: Fri Jun 26, 2015 11:07

Re: T4 power to the USB ports

Post by Allen » Thu Jun 04, 2020 23:57

Thank you. My mistake. I recorded the path incorrectly. It should have been /sys/bus/usb/drivers/usb/unbind.
Based on your comment that /sys is special then I guess what I was hoping to do isn’t possible.
I’ll have a look at putting the fan on the same power chain as the case fan. Thanks again. Allen

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: T4 power to the USB ports

Post by peteru » Fri Jun 05, 2020 00:54

Just to clarify my earlier post. The T4 fan connector, JP1, is for a 12V fan. You need to make sure that whatever fan you connect can work with a 12V PWM 2-wire connector. There is enough room inside the case to fit a slim-line PC case fan or maybe even a standard 25mm depth, 120mm fan. The fan could probably be attached to the metal case cover quite easily with a few screws. On paper, the Noctua NF-A12x15 appears to be a great option, but I have not tested this fan in real life. If my calculations are right, this fan should fit over the top of the tuner cans as well as the regulator heat sinks and keep everything nice and cool.

The drivers allow the fan to be turned off or run at any duty cycle ranging from about 2% all the way to 100%. I think the T4 defaults to around 75%-80% when on and about 4% in standby. Keep in mind that the PWM duty cycle does not correspond to fan speed.

"Beauty lies in the hands of the beer holder."
Blog.

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: T4 power to the USB ports

Post by peteru » Fri Jun 05, 2020 01:32

Going back to your original idea of controlling the USB power via software, the hardware is capable of that on USB0 and USB1, which are the rear ports, as well as on USB2, which is the front USB connector, bot not on USB3, being the on-board (unpopulated) Wi-Fi USB port.

I am not aware of any software mechanisms to allow you to do this from user space conveniently. If you want to experiment with the idea, look at:

Code: Select all

/sys/devices/platform/ehci-brcm.0/usb1/power
/sys/devices/platform/ehci-brcm.0/power
/sys/devices/platform/ehci-brcm.1/usb2/power
/sys/devices/platform/ehci-brcm.1/power
/sys/devices/platform/ehci-brcm.2/usb3/power
/sys/devices/platform/ehci-brcm.2/power
/sys/devices/platform/ehci-brcm.3/usb4/power
/sys/devices/platform/ehci-brcm.3/power
/sys/devices/platform/ohci-brcm.0/usb5/power
/sys/devices/platform/ohci-brcm.0/power
/sys/devices/platform/ohci-brcm.1/usb6/power
/sys/devices/platform/ohci-brcm.1/power
/sys/devices/platform/ohci-brcm.2/usb7/power
/sys/devices/platform/ohci-brcm.2/power
/sys/devices/platform/ohci-brcm.3/usb8/power
/sys/devices/platform/ohci-brcm.3/power
These appear to correspond to USB1.1 and USB2.0 devices for each USB port. Good luck with that - if you figure it out and get it to work, please post your findings. I'd probably choose to go the hardware way and wire up a 12V fan to the fan connector, but if you like to hack on stuff, this sounds like a good project to keep yourself busy for a while. :lol:

"Beauty lies in the hands of the beer holder."
Blog.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: T4 power to the USB ports

Post by prl » Fri Jun 05, 2020 11:30

Allen wrote:
Thu Jun 04, 2020 23:57
Thank you. My mistake. I recorded the path incorrectly. It should have been /sys/bus/usb/drivers/usb/unbind.

No problem. Though when I try to write write a 0 to it I don't get Permission denied, I get:

Code: Select all

root@beyonwizt4:~# echo 0 > /sys/bus/usb/drivers/usb/unbind
-bash: echo: write error: No such device
root@beyonwizt4:~#

Since I don't know what that /sys file is supposed to control or what values it expects to get, I don't think I can help much. I'm not sure what you're trying to achieve by doing it, either.
Allen wrote:
Thu Jun 04, 2020 23:57
Based on your comment that /sys is special then I guess what I was hoping to do isn’t possible.

/sys and /proc are special in the sense that they provide access to internal kernel and device data and control. That means that the file systems can have unusual behaviour, like files being read or write only (/sys/bus/usb/drivers/usb/unbind) even for the root user, that you can't create or delete entries there, and what you read back from a file in /proc or /sys may not be what you wrote there.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: T4 power to the USB ports

Post by prl » Fri Jun 05, 2020 11:39

There's some discussion here about what should be written to /sys/bus/usb/drivers/usb/unbind for it to have an effect.

The first reply to the initial query is probably the most useful bit.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

Post Reply

Return to “Hardware Discussion”