The special status of the rear USB port

Hi,

very happy with my recently-arrived Vero 2, I came across several postings touching this point:

What is so special about the rear USB port? Is it different HW-wise or is it just a kernel tuning?

Reason I am asking: I connect to Loudspeakers via USB which works perfectly but only using the rear USB. The RF remote receiver seems to work also perfectly only on the rear USB. Of course I would like to have both working perfectly at the same time. Is there any way to achieve this?

Hello

The USB controller uses a DesignWare USB 2.0 OTG controller (dwc_otg), which is the same controller found on the Raspberry Pi.

Its Linux implementation has always been a little shakey. Our remote receiver is a USB 1.1 based device. It’s a simple HID device, as the amount of data it needs to receive is very limited.

The Linux driver for the dwc_otg controller expects that the ARM can service an interrupt immediately, but this is not always the case. This could mean that if the ARM was busy, a USB microframe could be queued, but not serviced in time, so it got dropped. The most common symptom: you press a remote key, and it repeats until you press another. That’s because the signal to stop the key got dropped.

To combat this, I have configured the rear port to behave at Full Speed (12Mbps), and the side ports to be configured at High Speed (480Mbps). USB 2.0 uses Split Transactions, so that both Full Speed and High Speed devices can co-exist on the same bus without incurring a reduction in speed. However this can cause some issues with dwc_otg. So the expectation is that people use the receiver in the rear port, and as hard drives are the most likely peripheral to be attached after this, they should use the side ports for those. There were also a couple of commits to improve USB behaviour:

USB on Raspberry Pi is still not perfect, and they had someone working on USB for an entire year, so I mainly focused on getting things to work for our use case and tweaking things as users report them instead.

Regarding your speakers: I suspect that it’s a Full Speed device, lsusb -v would confirm this – you may need to sudo apt-get install usbutils first. Do you have any other peripherals attached to the USB apart from the remote and these speakers? You could drop the port speed to Full Speed on the side ports too. This would likely resolve your issue.

1 Like

Thank you for the quick response, this helps a lot and explains the behaviour I observe.
This is the usb device tree at the moment:
osmc@osmc:~$ lsusb -t /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M |__ Port 1: Dev 2, If 0, Class=Audio, Driver=snd-usb-audio, 12M |__ Port 1: Dev 2, If 1, Class=Audio, Driver=snd-usb-audio, 12M |__ Port 1: Dev 2, If 2, Class=Audio, Driver=snd-usb-audio, 12M |__ Port 1: Dev 2, If 3, Class=Human Interface Device, Driver=usbhid, 12M /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M |__ Port 2: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 480M |__ Port 3: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M |__ Port 3: Dev 4, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M

I’d like to have these three devices connected to the Vero:

  • The speakers (12M, you were right)
  • The RF receiver
  • The storage device

Wouldn’t it work to set the rear port to high speed (for the storage device) and the side ports to full speed? If so, how do I do that?

Thanks again

Hi

Looks like I need to fix how that is reported to lsusb and make it reflect the changes I made. Thanks for bringing that to my attention.

That’s an option – however I’d have to think about how to set that up and make it possible for just one user. I’ve unfortunately made it very clear that the remote should be located in the rear port, and I think that if I switch it again we could see a lot of issues with the next update.

I’ll have a think about this. If it were two USB Full Speed devices, the solution would be a lot simpler. In theory, if the improvements in June and July count for anything, you should be able to set it up as follows without issue:

  • Audio card in rear port
  • RF receiver and HDD in side ports

I’ll think about this further. Let me know how you get on with this configuration. I will try and do some testing of this scenario firsthand on Monday morning.

Sam

This is how it is set up at the moment. Audio works well but occasionally (~ 1 in 50 chance) I observe the sticky keypress symptom with the RF remote receiver. The HDD did not exhibit a noticeable problem so far, but admittedly I did not conduct any special tests with it.
Thanks for looking into it!

Okay.

I’ll need to think about this. The fact that you are using 2x Full Speed devices is what makes this a little challenging.

Sam

No worries. Sorry for causing additional trouble. I guess it would be nice if the USB controller just worked out of the box :relaxed:

Yep, it certainly would!

Sam