Wired Mirroring with ADB
This topic describes a simple way to enable wired mirroring on an Meta headset running on Android by using
Android Debug Bridge (ADB) and VLC media player. Wired mirroring can be set up quickly, allowing you to show off your experience even when internet connectivity is unreliable.
- Meta Quest
- PC/Mac computer with an open USB Type A slot
- USB to Micro USB cable
Note: You may need to use a different USB cable than the one that came with the headset.
- Android Debug Bridge (ADB) - A versatile command-line tool that allows a client (in this case, your development machine) to send commands to a daemon which runs commands on a device. Once you download ADB or Android Studio with SDK Tools, add the platform-tools and tools directories to your Path system variable in Windows or macOS. If you followed the steps in the Android Development Software Setup topic, ADB should already be installed and the Path system variable should be set correctly.
- VLC media player - A media player that will display the mirrored screen. With VLC tools, you will be able to zoom into either eye. Standard mirroring will create a two-eyed view of the content, displayed as two lens-shaped circles on the screen. There are tools in VLC that allow you to pick one section of the mirrored image to focus on so the audience will see a full-screen view of your application.
- Go through the steps in Device Setup to enable developer mode and install the ADB drivers if necessary.
- Connect the headset to your PC or Mac using a USB cable.
- Open the command-line interface on your PC or Mac.
- Windows PC: Press the Start key and type
cmd
in the Windows Search bar. Right-click on Command Prompt and select Run as administrator. - Mac: Open the Terminal app found at Applications > Utilities > Terminal.
- From the command line, type
adb devices
and press Enter. If you see a device ID along with the word “device”, you are ready. If you see a device ID along with something like “denied” or “inactive”, you need to put on the device and click the Allow this device access to files prompt. - Once you are ready, enter one of the following commands:
- Windows PC:
adb exec-out "while true; do screenrecord --bit-rate=2m --output-format=h264 --time-limit 180 -; done" | "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" --demux h264 --h264-fps=60 --clock-jitter=0 -
- Mac:
./adb exec-out "while true; do screenrecord --bit-rate=2m --output-format=h264 --time-limit 180 -; done" | "/Applications/VLC.app/Contents/MacOS/VLC" --demux h264 --h264-fps=60 --clock-jitter=0 -
Note: In both commands, after the |
, make sure the path to VLC media player is correct for your computer.
- If everything works correctly, VLC should open and begin to mirror your headset. If you are not wearing the device or covering its internal proximity sensor (located in the headset, near the top and between the lenses), nothing will display on the mirrored screen.
Audio output not available for wired mirroring
Audio mirroring is not supported in this method of wired mirroring. To circumvent this, you can run audio from your device’s 3mm headphone jack into your computer.
No interactive zoom / Double vision
To repair this issue, follow these steps:
- Open VLC media player.
- Navigate to Tools > Effects and Filters > Video Effects > Geometry and check the Interactive Zoom box.
- In the top-left corner of the application, you will notice a black square that covers a rectangular view of the mirrored image. You can move this rectangular field or drag to enlarge it. This will effectively crop and zoom the specific area you want to mirror.
Latency issues
- With this process, you should expect a 2 to 4 second delay. Keep this delay in mind when presenting. Do your best to avoid quick bursts of movement and narrate things as they happen on the computer.
- After being connected for a while without use, the mirrored screen may appear pixelated when jumping back into VR. Close the stream between uses to prevent this issue.