Skip to content

tmars/AmblyoBye_PicoG2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AmblyoBye — Pico G2 4K Port

AmblyoBye is a virtual reality (VR) application designed to assist in the treatment of amblyopia (commonly known as "lazy eye") through dichoptic movie viewing.

This is a port of AmblyoBye by Alex Muraru (originally for Meta Quest 2/3, Unity 6) to Pico G2 4K (3DoF headset, Unity 2021.3 LTS, Pico Legacy VR SDK).


Why Pico G2 4K?

The Pico G2 4K is the VR headset qualified to work with Luminopia — the first FDA-cleared binocular treatment for amblyopia. This makes it a proven, clinically validated platform for dichoptic therapy.

AmblyoBye provides a free, open-source alternative to Luminopia's commercial software using the same headset.


Purpose

AmblyoBye is inspired by research indicating that dichoptic movie viewing can enhance visual function in amblyopic patients, even beyond the critical period of visual development.

Studies have shown that presenting different images to each eye can promote binocular vision and reduce suppression of the amblyopic eye (source).

The app plays videos with a dichoptic filter — each eye sees a different set of "puzzle pieces" (blob pattern). The brain is forced to use both eyes to see the full picture, which helps treat amblyopia.


Supported Devices


Features

Dichoptic rendering:

  • Complementary dichoptic rendering — each eye sees inverted blob pattern
  • Adjustable Eye Bias, Blob Scale, Blob Gray Color, Blob Change Timer

Video playback:

  • Video picker with pagination
  • Seek controls: 5s, 10s, 1m, 5m, 10m forward/back
  • Pause/Play
  • Video playback position saved per file (resume where you left off)
  • Last played video remembered across sessions

Statistics & notifications:

  • SQLite database for session tracking (start, stop, pause, resume, crash detection)
  • Telegram notifications — one live-updating message per session:
    Started: Luka.mp4
    
    ⏱ 5 min (13:35)
    ⏱ 10 min (13:40)
    😴 Paused at 12 min (13:42)
    ▶️ Resumed (13:44)
    🔴 Ended: 15 min. Today: 45 min (13:47)
    
  • Weekly summary sent on first play of each day
  • Crash/force-kill detection on next launch
  • "Send Stats to TG" button — sends stats.db file to Telegram
  • Fully optional — works without Telegram config

Proximity sensor:

  • Auto-pause video when headset is removed
  • Auto-resume when headset is put back on
  • Manual pause is not overridden by headset events

VR UI:

  • Gaze-based UI — look at buttons and press to click
  • Works with controller (touchpad) and without (headset body button)
  • VR-friendly +/- buttons instead of sliders
  • Screen distance adjustment (closer/farther)
  • All settings persist between sessions
  • Black background for minimal distraction
  • Session watch time tracking

Screenshots

Left Eye View Right Eye View
Each eye sees different puzzle pieces Inverted blob pattern per eye

Screenshots from the original Quest version are available in the original repository. The dichoptic effect is identical on Pico G2.


In-App Settings

  • Eye Bias — adjusts the infill percentage of the blobs.
    • 0 → full suppression on the left eye
    • 0.5 → balanced (both eyes see equal amount)
    • 1.0 → full suppression on the right eye
    • For left eye amblyopia, use values > 0.5 to suppress the right eye more
  • Blob Scale — size of the blob-shaped contrast mask
  • Blob Color — how dark/light the blobs appear (0 = black, 255 = white)
  • Blob Timer — how often the blob mask changes position (in seconds)
  • Screen Distance — move the video screen closer or farther

Suggested starting settings

Setting Value
Eye Bias 0.50
Blob Scale 1.0
Blob Color 70
Blob Timer 5

Controls

With controller

  • Touchpad click: Show/hide settings menu, click UI buttons

Without controller (headset body buttons)

  • Back button: Show/hide settings menu, click UI buttons
  • Volume buttons: System volume (handled by OS)

In settings menu

Look at a button with the gaze reticle (white dot in center), then press touchpad or back button to click.


Installation & Setup

Requirements

  • Unity 2021.3.0f1 (LTS) — other 2021.3.x may work
  • Android SDK (API 26+)
  • Android NDK r21d (required for IL2CPP / ARM64 build)
  • Pico G2 4K headset

1. Install Unity

Install Unity 2021.3.0f1 via Unity Hub with modules:

  • Android Build Support
  • Android SDK & NDK Tools (or provide your own)
  • OpenJDK

2. Android NDK

Download Android NDK r21d and extract it to a permanent location.

In Unity: Edit → Preferences → External Tools:

  • Uncheck "NDK Installed with Unity"
  • Set NDK path to your extracted android-ndk-r21d folder

3. Open the project

Open the project folder in Unity 2021.3.0f1.

4. Build

In Unity menu:

  1. Build → 0. Fix Android Tools — sets SDK/NDK paths
  2. Build → 3. Create Scene + Build APK — generates the scene and builds the APK

The APK is output to Builds/AmblyoBye_PicoG2.apk.

The scene is built entirely in code (SceneBuilderAndBuild.cs). There is no manual scene editing — everything (UI, video player, materials, event system) is created programmatically.

5. Install on Pico G2

adb install -r Builds/AmblyoBye_PicoG2.apk

6. Add videos

adb push "MyVideo.mp4" "/sdcard/Android/data/com.amblyobye.amblyobye/files/Movies/"

Supported formats: .asf, .avi, .dv, .m4v, .mp4, .mov, .mpg, .mpeg, .ogv, .vp8, .webm, .wmv

For best compatibility, convert videos to MP4 (H.264, AAC audio) using HandBrake or similar tools.

CLI helper — pico.sh

The included pico.sh script wraps common ADB/Unity commands:

./pico.sh build                # Build APK via Unity CLI
./pico.sh deploy               # Build + install + launch (all-in-one)
./pico.sh update               # Install/update APK on device
./pico.sh upload all           # Sync all videos from videos/ folder to device
./pico.sh upload movie.mp4     # Upload a single video
./pico.sh download <URL>       # Download video from URL to videos/
./pico.sh stats                # Pull stats.db and show watch statistics
./pico.sh tg-config <file>     # Push telegram.cfg to device
./pico.sh launch               # Launch app on device

The download command uses yt-dlp and supports YouTube, VK, and most video sites. The venv is set up automatically on first run (requires Python 3).

Put your video files in the videos/ folder, then run ./pico.sh upload all to sync them to the headset.

Telegram notifications (optional)

  1. Create a bot via @BotFather and get the token
  2. Get your chat ID (send /start to the bot, then use @userinfobot or check via API)
  3. Create telegram.cfg:
    bot_token=123456:ABC-DEF...
    chat_id=123456789
    
  4. Push to device:
    ./pico.sh tg-config telegram.cfg

If no config file is present, the app works normally without any notifications.


Architecture (for developers)

Key files

File Description
Assets/Editor/SceneBuilderAndBuild.cs Programmatic scene builder + APK build automation
Assets/Resources/Scripts/DichopticMovieSceneManager.cs Main app logic, UI, video playback, settings
Assets/Resources/Scripts/VRUISetup.cs VR camera + gaze reticle setup
Assets/Resources/Scripts/PicoTouchpadClick.cs Input bridge (touchpad + headset body button → UI clicks)
Assets/Resources/Scripts/PicoEyeIndexSetter.cs Sets _PicoEyeIndex per eye in OnPreRender
Assets/Resources/Scripts/SliderPlusMinus.cs VR-friendly +/- button controls
Assets/Resources/Scripts/DichopticMovieSettingsManager.cs Settings persistence to file
Assets/Resources/Scripts/StatsDatabase.cs SQLite stats database (session events, crash detection)
Assets/Resources/Scripts/TelegramNotifier.cs Telegram Bot API (live session messages, file sending)
Assets/Resources/Shaders/DichopticMovieUnlit.shader Dichoptic filter shader

Dichoptic shader

float blobVisible = lerp(noiseMask, 1.0 - noiseMask, eyeIndex);
  • Eye 0 (left): sees blobs where noise > threshold
  • Eye 1 (right): sees inverted pattern (noise <= threshold)
  • _PicoEyeIndex is a global shader float set per-eye camera in OnPreRender

Differences from the original

Original (Quest 2/3) This port (Pico G2 4K)
Engine Unity 6000.2.11f1 Unity 2021.3.0f1
VR SDK OpenXR Pico Legacy VR SDK
Tracking 6DoF 3DoF (head rotation only)
Input Quest controllers (thumbstick, trigger) Gaze + touchpad / headset body button
UI controls Sliders +/- buttons (gaze-friendly)
Eye rendering XR stereo per-eye _PicoEyeIndex via OnPreRender
Scene Manual Unity editor scene Fully code-generated

Therapy Guidelines

  • Recommended: 1 hour/day, 6 days/week
  • Wear prescription glasses inside the headset
  • Do NOT use while in a moving vehicle
  • Consult your ophthalmologist for personalized recommendations

Research Background

Sauvan, L., Stolowy, N., Denis, D., Matonti, F., Chavane, F., Hess, R. F., & Reynaud, A. (2019). Contribution of Short-Time Occlusion of the Amblyopic Eye to a Passive Dichoptic Video Treatment for Amblyopia beyond the Critical Period. Neural Plasticity, 2019. DOI: 10.1155/2019/6208414

S. Boniquet-Sanchez, N. Sabater-Cruz (2019). Current Management of Amblyopia with New Technologies for Binocular Treatment. DOI: 10.3390/vision5020031

C. Lunghi, M. Berchicci, M. Concetta Morrone, F. Di Russo (2015). Short-term monocular deprivation alters early components of visual evoked potentials. DOI: 10.1113/JP270950


Disclaimer

AmblyoBye is intended for use under the guidance of a qualified eye care professional. It is not a substitute for professional medical advice, diagnosis, or treatment. Improving your vision while having strabismus might lead to diplopia. Please take that into consideration.

Always seek the advice of your physician or other qualified health provider with any questions you may have regarding a medical condition.


License

This project is a fork of AmblyoBye by Alex Muraru. See original repository for license terms.

Contact