Skip to content

Repository files navigation

Kinect OTG Android

Android application for streaming Microsoft Kinect v1 data on USB host capable phones (no root required), using libusb and libfreenect through JNI.

Highlights

  • Real-time RGB + depth or IR + depth preview
  • Depth and IR tuning controls (range, color style, inversion, contrast/brightness)
  • Output overlay composition
  • VR preview mode (fullscreen landscape, stereoscopic side-by-side)
  • Ultralytics YOLO object detection on output preview (normal and VR)
  • Snapshot capture to gallery
  • USB auto-reconnect flow for mobile use

Requirements

Hardware

  1. Microsoft Kinect v1 with original external power supply
  2. Powered USB hub (recommended for stable current delivery)
  3. USB-C OTG adapter
  4. Android device with USB host support

Kinect must be externally powered. Do not power it from the phone.

Software

  • Android Studio / Android SDK
  • JDK 17
  • SDK Platform 35
  • Android NDK (for native build)
  • Windows PowerShell (for helper scripts in scripts/)

Architecture

  • app/src/main/java/com/codex/kinectotg/MainActivity.kt: app UI, USB lifecycle, preview pipeline
  • app/src/main/java/com/codex/kinectotg/UltralyticsYoloDetector.kt: ONNX Runtime YOLO inference
  • app/src/main/cpp/kinect_jni.cpp: native bridge and frame conversion
  • third_party/libusb, third_party/libfreenect: native USB and Kinect stack

Build And Install

  1. Set Android SDK path:
$env:ANDROID_HOME="C:\Users\<you>\AppData\Local\Android\Sdk"
$env:ANDROID_SDK_ROOT=$env:ANDROID_HOME
  1. Verify device visibility:
.\scripts\check-phone.ps1
  1. Build and install debug APK:
.\scripts\build-and-install.ps1

Run

  1. Connect Kinect to powered hub.
  2. Power on hub.
  3. Connect hub to phone via OTG.
  4. Open Kinect OTG and press Connect.
  5. Accept USB permission prompts.

Operational Notes

  • Target ABI is arm64-v8a.
  • Target profile validated on Redmi Note 13 Pro 5G / Android 15.
  • Device kernels that restrict required USB transfer behavior may block direct Kinect streaming even with granted permissions.

Troubleshooting

No Kinect Detected

  • Reconnect OTG adapter and USB hub
  • Verify Kinect power supply and LEDs
  • Check adb devices output

Stream Fails After Permission

Run:

.\scripts\run-logcat.ps1

Inspect runtime logs for USB transfer and native initialization errors.

Unstable Frames Or Disconnects

  • Use a different OTG adapter/cable
  • Keep Kinect as the only device on the hub
  • Ensure hub PSU is adequate and stable under load

Third-Party Components

This repository vendors upstream third-party code under third_party/. Licenses for those components remain with their respective projects.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages