Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vision Pro Dev strap streaming #106

Open
dougshean opened this issue May 14, 2024 · 10 comments
Open

Vision Pro Dev strap streaming #106

dougshean opened this issue May 14, 2024 · 10 comments
Labels
question Further information is requested

Comments

@dougshean
Copy link

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

@AlexTech01
Copy link

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.

@shinyquagsire23 shinyquagsire23 added the question Further information is requested label Jun 14, 2024
@UndisclosedBox83
Copy link

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.

@AlexTech01
Copy link

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

@shinyquagsire23
Copy link
Collaborator

@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

@AlexTech01
Copy link

AlexTech01 commented Aug 6, 2024

@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)

@PedroM4
Copy link

PedroM4 commented Sep 2, 2024

@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.

@shinyquagsire23
Copy link
Collaborator

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

@UndisclosedBox83
Copy link

@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.

@shinyquagsire23
Copy link
Collaborator

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

@PedroM4
Copy link

PedroM4 commented Sep 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants