Help us shape the future of Go! Take the 2026 Go Developer Survey

xrusb

command
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Command xrusb answers ONE question: will Android let an ordinary application submit an isochronous USB transfer?

Why everything depends on it

A head is followed from the headset's camera — the VITURE Beast publishes no orientation, and go-xrkit/xrkit/headflow recovers the yaw from its pictures. cmd/xrcam established that on this phone both of Android's own routes to that camera are shut: camera2 enumerates no external device, and every UVC streaming endpoint is isochronous, which UsbDeviceConnection cannot submit at all.

usbfs is what is left — the kernel's own interface, reached by ioctl on the descriptor UsbDeviceConnection hands out. It is plain syscalls, so a CGO-free Go process can do it on paper. Whether SELinux permits it is undocumented.

⛔ AND A UVC IMPLEMENTATION IS WORTHLESS IF THE ANSWER IS NO. Descriptor parsing, probe/commit negotiation, frame assembly, MJPEG decoding — days of it, all resting on one ioctl nobody has tried. So this tries the ioctl, in four steps, and says which one the kernel stopped at.

APP=./cmd/xrusb host/build.sh && adb install -r host/out/xrhost.apk
adb shell am start -n org.goxrkit.androidhost/org.goxrkit.android.XrDemoActivity \
    --ez capture false --es args '-wait 5m'
adb shell run-as org.goxrkit.androidhost cat files/usb.txt

⚠ IT PUTS A DIALOG IN FRONT OF SOMEBODY. Opening a USB device asks the user, naming the device and this application. The transcript says so, and a refusal is reported as a decision rather than as a failure.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL