alvr-visionos icon indicating copy to clipboard operation
alvr-visionos copied to clipboard

Vision Pro Dev strap streaming

Open dougshean opened this issue 1 year ago • 16 comments

Hi does alvr support streaming through usb-c connection? Has anybody tried it? Thanks

dougshean avatar May 14 '24 11:05 dougshean

You need to connect the dev-strap with USB-C to a Mac, connect the Mac with Ethernet to a PC, and then run some ifconfig commands on the Mac to forward the traffic to the PC, after which the PC will recognize it and you can manually enter the wired IP of the Vision Pro into the ALVR server. The last time I used ALVR on the Vision Pro was about 2 months ago, so there might be a different way now.

AlexTech01 avatar May 29 '24 23:05 AlexTech01

You need to connect the dev-strap with USB-C to a Mac, connect the Mac with Ethernet to a PC, and then run some ifconfig commands on the Mac to forward the traffic to the PC, after which the PC will recognize it and you can manually enter the wired IP of the Vision Pro into the ALVR server. The last time I used ALVR on the Vision Pro was about 2 months ago, so there might be a different way now.

Have you actually done this and it worked? I am likely to purchase the strap if it actually works.

UndisclosedBox83 avatar Jul 30 '24 22:07 UndisclosedBox83

Have you actually done this and it worked? I am likely to purchase the strap if it actually works.

Yup, there are some ifconfig commands you need on the Mac though. I also found another method which involves setting up a Linux VM on the Windows PC, configuring USB sharing so the dev-strap's USB signal gets sent to the VM, and then configuring networking on the VM so the USB signal from the dev-strap gets sent back to Windows. For whatever reason this will make Windows identify it correctly and it'll be able to actually establish a link

AlexTech01 avatar Jul 31 '24 01:07 AlexTech01

@AlexTech01 ok that's both genius and also extremely cursed, wonder if someone has a Linux microVM I could package up specifically for that purpose lmao

shinyquagsire23 avatar Aug 01 '24 19:08 shinyquagsire23

@AlexTech01 ok that's both genius and also extremely cursed, wonder if someone has a Linux microVM I could package up specifically for that purpose lmao

@shinyquagsire23 I don't know much about microVMs, but here's a VMware Workstation 17 Pro VM with some changes made so it'll bridge the AVP to the host: https://drive.google.com/file/d/1xdj_3pkgthv6utfg24WIXx821UsiHfZy/view?usp=sharing

To import in VMware Workstation 17 Pro:

  1. Extract the downloaded zip file
  2. Open VMware Workstation 17 Pro
  3. Click File -> Open (or Ctrl+O)
  4. Select the OVF file
  5. Give your VM a name and location
  6. VMware should automatically locate the VMDK disk file when you try to import the OVF, so you don't have to import it manually
  7. The VM will be created and you can start it

Make sure your settings in VMware are set to either ask when a USB is connected or to automatically connect the USB to the VM (asking when a USB is connected is preferred.) You can change this setting by opening Edit -> Preferences (Ctrl+P), going to the USB tab, and changing the setting.

Here's a list of the changes I've made to this Ubuntu 24.04 Server minimized instance:

  1. open-vm-tools and nano are installed via apt
  2. systemd-networkd-wait-online.service is masked in order to allow the system to boot with no internet connection
  3. There is an "/etc/udev/rules.d/99-usb-net-bridge.rules" file to handle plugging in/removing the AVP from the VM
  4. There is an "/etc/netplan/99-bridge-config.yaml" file to make the network bridge (note: you might have to change the 2 mentions of "ens37" in here to the host-only interface your VM sees, you can find this with "ip addr")
  5. There are 2 scripts in "/var/ncm/scripts" to handle plugging in and removing USB devices, this is what the udev rules execute
  6. There is a folder "/var/ncm/config" that can be used to change some basic config things, the existence of a service_enabled file makes the script work and the existence of logging_enabled makes it log USB connections/disconnections to /var/log/ncm.log. By default, the service_enabled file exists, but not the logging_enabled file.
  7. There is an "ncmctl" bash script in /usr/local/bin that can be used to disable/enable the service and logging if you don't want to manually create files. Use ncmctl enable, ncmctl disable, ncmctl status, etc. to manage the service, and ncmctl logging enable, ncmctl logging disable, ncmctl logging status, to manage logging. Anything other than the status command will require sudo.

The default username/password is ncmbridge/ncmbridge and that can be used to login to the VM to look at these scripts and make changes. The ncmbridge user also has sudo access.

(Alternatively, if you want to use the method involving connecting the Vision Pro to the Mac with USB-C and the Mac to the PC with Ethernet, see my repo here for an easy(-ish) to use script: https://github.com/AlexTech01/usbncmbridge)

AlexTech01 avatar Aug 06 '24 02:08 AlexTech01

@AlexTech01

would you be so kind as to measure the max bandwith the AVP dev strap is capable of supplying? You can easily do this using iperf3 running as server on the PC ( iperf3 -s ) and installing the iperf3 client on AVP ( it's available from the app store ).

and obviously, massive thanks for the tutorial and for suppling the VM.

PedroM4 avatar Sep 02 '24 10:09 PedroM4

@PedroM4 It's 240Mbps, basically identical to WiFi 5GHz

shinyquagsire23 avatar Sep 02 '24 19:09 shinyquagsire23

@PedroM4 It's 240Mbps, basically identical to WiFi 5GHz

If I am not mistaken, AVP is capable of 1,200Mbps over Wi-Fi, or up to five times faster than through the dev strap.

UndisclosedBox83 avatar Sep 02 '24 19:09 UndisclosedBox83

yeah in practice it seems to bump up against latency issues around there, not sure why (maybe it's a decoder bandwidth limitation idk)

shinyquagsire23 avatar Sep 02 '24 19:09 shinyquagsire23

ok, so not that bad. I'm getting 960mbps average on the wifi and can push the decoder to about 550mbps at least that is what ALVR bandwidth plot says, but there is a catch, I move my head and the bandwidth may drop to 300mps or so, and that's really not nice. I think stable 240mbps may be better than an wifi connection that is so unstable but I would have to try it. I'll wait for the dev strap to be available in my region.

Anyway, I was reading a bit about it today and it seems that the speed limit is a software imposed thing, so maybe in the future apple changes that or a third party vendor appears with a wired solution.

PedroM4 avatar Sep 02 '24 20:09 PedroM4