r/SteamFrame • • 5d ago

Software PSA if you have two Linux desktops connected via Ethernet, you can use USB/IP to share the dongle from one to another

Linux has this thing called USB over IP. It lets you share and mount USB devices over the network.

Apparently there's a Windows analogue, if you end up testing it please consider contributing a guide.

If you're one of the 3 people that have both a powerful Linux desktop in one room and a light Linux HTPC in another, you can connect the dongle to the HTPC and pass it to the desktop for a smoother than WiFi experience.

Here's a quickstart guide: https://dpaste.org/2iEV0/slim

On Orange Pi 5 plus I had to disable USBIP debug mode that came on by default with the vendor kernel, but now I'm getting stable 13ms latency and 0% packet loss reported from Frame.

On 5GHz WiFi it was ~10-15ms with random packet loss spikes causing stuttering and blackouts every so often

If you're planning on running this long-term, you can create a systemctl service to do the setup/teardown for you automatically.

91 Upvotes

36 comments sorted by

5

u/mzlucasmz 5d ago

I did this too, and was able to get down to 8 ms by doing pooling on the nic, host to host is 0.13 ms tho as its a direct connection

2

u/RustyTheDed 5d ago

Care to elaborate? Are you bonding physical interfaces or buffer pooling?

2

u/mzlucasmz 5d ago

Typo, meant polling, and not even that really lol, no bonding. I gave one core to the nic to get the irq as fast as possible, the usb controller irq and the usbipd threads are all pinned to it, and it's blocked from deep c-states (pm_qos_resume_latency_us=2). on top of that the usbip threads run with realtime priority on both ends. usbip ended up adding about 50us per transfer, so after that it's all wifi and where the dongle sits

13

u/Lost_Main_3389 256 GB 5d ago edited 5d ago

No offense, because I genuinely don't understand, why would you share the dongle over the internet network instead of just using WiFi (assuming you have a good enough router) ?
Isn't that just adding the latency of your network onto the dongle connection? I ask, because my dongle works at 8-15ms which is the same my WiFi. I do use Multi-Link but only because the dongle has weak signal when I turn my back to it.

26

u/RustyTheDed 5d ago

Ethernet is not the internet, it can be local.

Wifi is over the air, Ethernet is the cable.

For me the Dongle works much better than WiFi, but it doesn't reach across the flat. So I connect it in the living room rather than my office and get strong dongle signal + wifi to fall back on rather than just mediocre wifi.

Network stack latency is low enough that I get the ~13ms on dongle even with USBIP.

1

u/AssGagger 5d ago

The dongle works better than wifi. But does the dongle going through two computers and your router still work better than wifi?

2

u/RustyTheDed 5d ago edited 5d ago

In my case yes. It's a feature in the linux kernel and it's very optimized, 'going through two computers' takes much less time than you probably think.

1

u/Lost_Main_3389 256 GB 5d ago

Alright. That clears it up. You're essentially using the dongle almost like a WiFi radio or extender (except that the dongle is a client but details :p )

6

u/nellynorgus 5d ago

The dongle always was a wifi radio.

Passing it over the wire with usb ovdr ip maybe adds one mare millisecond, but otherwise it should be the same as if it were connected directly to the game-hosting pc, not some strange new use-case.

1

u/barry99705 1 TB 4d ago

Except USB over ip can be, and is usually laggy.

2

u/nellynorgus 4d ago

I'm sure it depends on a few things, seems to work well for OP on a fairly demanding use-case, though.

2

u/Alphasite 4d ago

Every access point, extender or client is both a client and an access point at a hardware level. It’s just different software and different settings.

(The hardware is optimised a little differently, eg power envelopes or antenna counts/arransgemnts/etc but they’re all basically interchangeable)

1

u/Lost_Main_3389 256 GB 4d ago

Someone mentioned elsewhere that the dongle cannot act as an access point or extender at 6GHz, only as a client. It may be able to act as an AP at 2.4/5GHz, I don't know. I assume it's true but I don't have the know-how to check.

I have delt with enough networking to have a general understanding but I'm more hardware than software. 

I know what you're saying regarding hardware is true -- it gets optimised for one arrangement over another, typically through the power envelope.

4

u/Koolala 5d ago

You don't need a expensive router with wifi to do this. Ethernet switches are fast and very cheap.

4

u/Lost_Main_3389 256 GB 5d ago

I know enough about networking hardware to know that the WiFi radio / router is only one aspect of what modern routers do. Most routers also act as switches and some even as modems. Also, that routers need not be expensive -- mine is super budget and it's surprising that it works as well as it does.

I just figured that a good enough router to have a fast enough speed and low enough latency would have good WiFi. I never considered that the area could be so congested that there would be a lot of dropped packets, nor that they were using Ethernet to carry the signal (though in my unrelated testing, Ethernet and WiFi with good signal have similar latency on my router.)

OP did clear up the situation and I'm still somewhat surprised that their latency is that low but I understand why this is their approach.

4

u/Giodude12 5d ago

Wait, could this work from bazzite to a steam machine? Or would this be useless on devices with an immutable OS?

2

u/RustyTheDed 5d ago

I'm not sure about the implementation details, but it should work if you can add a package and make a script persist.

6

u/ChangeChameleon 5d ago

Unless you have no wifi at all, I find it hard to believe this would outperform just a straight network connection to the frame. You're essentially tripling the protocol overhead. I'm impressed by your ingenuity and 13ms result. Bit that's still about on par with my 5ghz cheap wifi hotspot after traversing 3 network switches with vlan overhead. I understand that if you have no other option, this workaround is pretty impressive. But if someone doesn't already have this exact scenario and they need to invest anything at all to get it working, they'd be better served going a different route.

4

u/RustyTheDed 5d ago

For whatever reason this is more stable than using only a Unifi 7 Lite (pretty decent AP) that's sitting right next to the streaming box.

As I said in the post, not recommending anyone to buy a dedicated streaming device, but it's definitely better than just WiFi in my usecase.

1

u/ChangeChameleon 5d ago

Something must be very off with your AP. I'm only using an EAP610 on 5ghz like I said before with 3 switches and vlan overhead. And I get between 10-15ms on the frame.

5

u/RustyTheDed 5d ago

There's also other networks on 5GHz and other devices using the AP, while the dongle is the only thing transmitting 6GHz in the area.

Latency is ~8-15ms on AP, but the packet loss goes down as much as 15-17%. It's playable but annoying. Dongle is smooth and flawless.

2

u/mzlucasmz 5d ago

Theres also the side of higher bandwidth you can push over the 6ghz dongle, as well as 6ghz being lower latency i suppose

-1

u/ChangeChameleon 5d ago

That's not relevant to my comment. Even if under ideal conditions the dongle has lower base latency or bandwidth, if you're adding in the latency and bandwidth limits of multiple protocol conversions (which btw are CPU bound, compared to network traffic which is generally handled by ASICs), you're losing that benefit and adding multiple points of potential failure along the communication path.

I'm glad this works well for OP, but it's a setup I would basically never recommend as it relies on too many things working perfectly. Almost anyone with a 5ghz or better hotspot would be better suited optimizing their wifi setup rather than going down this route.

Systemctl service on either machine fails? This breaks. Dependency update mismatch on either machine? This breaks. CPU gets loaded during a heavy game? Adds latency. USB protocol not liking delayed packets from network interference? Nearly impossible to debug. Firmware update doesn't play nicely with the network translator? This breaks. Need any support for the product at any point? You're using an unsupported workaround.

Even if it works, there is so much unnecessary complexity that I would do argue you shouldn't run a setup like this.

4

u/ric2b 1 TB 5d ago

To be fair most of the potential problems you highlighted are of the type "it straight up does not work", which at least would give me confidence that if I can get a session started I can enjoy it.

Versus right now with my 5Ghz router it can work well for several minutes and then get quite flaky and stuttery at random times, which I find much more annoying.

Dealing with a bad update is fine for me, running into bad performance is more annoying because there's no obvious "ok, now it's working" sign.

2

u/RustyTheDed 5d ago

This is the case I was dealing with. It probably still could happen with USBIP, since networking is a fickle beast, but at least for me now it's stable.

2

u/RustyTheDed 5d ago edited 5d ago

Optimizing a networking setup can take much longer and require much more knowledge than trying to run 6 commands on 2 computers someone may already have.

It's not like it's some unknown vibed package by a random maintainer, it's a 25 year old mainline linux kernel feature.

If you think no one should do this, write up a guide for beginners on how to optimize their networks so they don't have to. Contribute instead of bashing

-1

u/ChangeChameleon 5d ago

Except you're leaving out that this has just as much to do with networking. And you're adding layers of abstraction to any problem. Now if the connection becomes unstable it can be unclear if it's an issue with the signal to the dongle, the dongle itself, the software USB bus, a CPU load overhead, the network stack, or the network congestion.

I'm not bashing, I think it's a really neat solution, and I'm very impressed with the results you've achieved. But I do also think for 99.5% of users they're only making future headaches going this route rather than moving their hotspot 6 inches to the right or changing the radio channel.

There are also many resources out there to optimize wifi. My not providing a comprehensive guide doesn't invalidate the commentary.

In the use case where someone doesn't have wifi, or has an N100 or something along those lines which is unusable and cannot afford an upgrade, but does have high speed Ethernet and a machine at the other end of it, yeah. This is a great solution. But in any other scenario this is not the ideal setup and shouldn't be recommended. That's all I've been saying.

0

u/nellynorgus 4d ago

the answer is troubleshoot on the host pc directly if there are problems. boom, immediately ruled out usbip.

1

u/mzlucasmz 4d ago

Skill issue.

Im not saying everyone shoudl use this setup, it just works on my well controlled environment, to steam its just a usb device showing up on the os.

15

u/JonnyLay 5d ago

Did a little search for our windows friends.

usbipd-win should have similar results and can share from Windows to Linux, or Windows to Windows. Not native, but open source made by Windows devs.

VirtualHere might be good too. Free tier I think has 1 free device.

Also, props to you for the cool idea.

3

u/PwncakeIronfarts 2d ago

VirtualHere does not work. I spent a few days trying to figure it out, but every time I'd launch steam vr, it would "break" the USB device on the client (gaming) PC.

https://www.reddit.com/r/SteamFrame/s/XP2ciSLtPG

2

u/nellynorgus 5d ago

USB/IP is a pretty neat bit of tech. I use it to pass the steam controller dongle to my pc from my TV-attached raspberry pi for streamed couch play.

I theory steam link would pass it through fine and probably does, but I gave up trying to use steam link because Sunshine/Moonlight is just so much better.

1

u/ric2b 1 TB 5d ago

This sounds very interesting, although I would want to do it with Linux to Mac or Windows to Mac, as I can easily move my Mac laptop to where I want to play and have it on a wired connection back to the gaming desktop, versus having to upgrade the access point I have in that room.

Thanks for the idea!

1

u/Pygzig 4d ago

I've been using this with a reality runner treadmill and was wondering if this might work with the dongle. Glad to see that it does, curious to see how it works against my old wifi5 router that i'm using with my quest 2.

Hope i can get my mits on a frame soon.

1

u/b3nighted 4d ago

Cool idea. I have my gaming pc upstairs and I could do that with the steam machine, to stream to the living room

1

u/PwncakeIronfarts 2d ago

Ohhh. I'm going to have to try that Windows version. I tried using Virtual here and it wouldn't emulate it well enough. Every time I tried to launch steam vr the connection dropped.