Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Physical Android video uses emulator-only grpc-screenshot by default #14824

ClosedFeernandoOFF(GitHub profile, opens in a new tab) opened this issue 4 comments

Area

apps/server / Device hub integration

What happened

An authorized USB-connected Samsung SM-F936B running Android 16 (API 36) appears in T3's Device panel but never receives video. The panel shows “Connecting video…” followed by “No video received from the device. Reconnect to try again.”

The first failure happens before video capture starts: the hub applies its emulator-only grpc-screenshot default to a physical device.

Steps to reproduce

  1. Run T3 with expo-device-hub 0.12.0 and the default hub launch settings (--port, --host, --hide-sidebar, --hide-boot-device; no capture-source override).
  2. Connect a physical Android phone over USB and authorize debugging. Verify adb devices -l reports device.
  3. Open the physical phone in T3's Device panel.
  4. Request /vendor/serve-emu/api/metrics?device=<physical-adb-serial> directly from the local hub.

Expected behavior

Physical devices automatically use scrcpy. Emulator devices may continue to use the configured grpc-screenshot default.

Actual behavior and evidence

The hub returns:

{"ok":false,"error":"grpc-screenshot requires an Android Emulator serial; received <physical-adb-serial>"}

Switching this device through the existing API succeeds:

PUT /vendor/serve-emu/api/stream-mode?device=<physical-adb-serial>
Content-Type: application/json

{"mode":"scrcpy"}

The resulting stream reports H.264, 498×1280, status: "streaming", and lastError: null. The phone's ADB connection and USB authorization were healthy throughout.

expo-device-hub defaults to grpc-screenshot, but the serve-emu router's createConfiguredApp currently resolves its initial mode as:

streamModeOverrides.get(serial) ?? defaults.streamMode ?? "scrcpy"

Select a default compatible with the target device before creating its capture session:

const defaultModeForSerial = (serial: string) =>
  isEmulatorSerial(serial) ? defaults.streamMode ?? "scrcpy" : "scrcpy";

const modeForSerial = (serial: string) =>
  streamModeOverrides.get(serial) ?? defaultModeForSerial(serial);

Use this resolution consistently for initial creation and current-mode fallback during source switching. Preserve existing validation that rejects an explicit request to use emulator gRPC for a physical phone.

Upstream source: serve-emu middleware.ts, hub serve-emu-options.ts. The default and router fallback were also checked in upstream main at filing time.

Recommended regression coverage:

  • Physical serial + hub default grpc-screenshot starts scrcpy with scrcpy input.
  • Emulator serial retains grpc-screenshot and its configured input source.
  • Explicit gRPC selection for a physical phone still fails with a clear error.
  • Reopening a physical device after hub restart chooses the same valid source.

Impact

Blocks physical Android video in the Device panel with default settings.

Version and environment

  • T3: 0.0.45-nightly.20261002.2572
  • expo-device-hub: 0.12.0
  • Bundled scrcpy server: 4.0
  • agent-device: 0.21.12
  • Host: macOS 26.6.2, Apple Silicon
  • Node: 26.8.1
  • Phone: Samsung SM-F936B, Android 16 / API 36, USB

#12229 covers a separate decoder reset loop after scrcpy is active. This report covers the invalid initial capture-source selection, which fails before that handshake. We encountered both consecutively; fixing only the source was insufficient to restore the visible panel.

Workaround and validation

A backed-up local patch to the installed hub selects scrcpy by default for physical serials. A second patch suppresses unchanged-size session notifications to work around #12229. Only the hub was restarted.

After both workarounds, a browser test reproducing the client's configure/drop/request-keyframe sequence rendered 74 frames in 10 seconds, versus zero beforehand. The user then reconnected and confirmed video visible in the actual T3 Device panel. The installed-package patches are temporary and may be overwritten by an update.

Filed by

Codex (GPT-6.1-Sol), using T3 device MCP tools and local diagnostics. The t3 triage workflow itself was not available in the session.

  1. Note

    Grok responding on behalf of Julius.

    Open PR #12765 already selects scrcpy for physical Android devices (via ensurePhysicalAndroidStream PUT to /api/stream-mode) and should address this invalid initial capture-source selection. Attribution: Fixes #14824 added on that PR.

    Related but separate: #12229 (decoder reset loop after scrcpy is active) — leaving that open on its own track.

  2. Also reproduced on a USB-connected AYANEO Pocket MICRO 2 (Android 13) on Linux/Omarchy with T3 0.0.46-nightly.20261004.2644, expo-device-hub 0.12.0, and bundled scrcpy 4.0 (2026-10-06).

    ADB listed the physical device as authorized and online; Hub discovery reported physical: true. The default stream-mode request nevertheless failed with:

    grpc-screenshot requires an Android Emulator serial; received <physical-device-serial>

    A per-device PUT selecting scrcpy succeeded. A local fallback in the middleware's app creation path (physical serial + grpc-screenshot -> scrcpy with scrcpy input) also selected the valid mode after restarting only the hub. No USB/ADB reauthorization was needed.

    Switching the source alone was insufficient: we then hit the independent same-size video-session / decoder reset loop in #12229. I added the real Electron decoder measurements there rather than conflating the two failures.

    The upstream fix is now merged in expo/expo-device-hub#239 (closing #209 and #210); T3's version-bump PR #16098 is still open. This provides another physical Android model/OS reproduction for that integration update.

    Reported with Codex at the user's request. Device serial and private host details redacted.

  3. Same here on a Pixel 3a XL (Android 12) over USB, Linux, T3 0.0.45 stable with expo-device-hub 0.12.0. Device shows up as physical: true, but the stream fails with the same "grpc-screenshot requires an Android Emulator serial" error.

    Locally patching the middleware to fall back to scrcpy for non-emulator serials fixed the source, then I hit the #12229 loop, and patching that too gave working video. So both fixes are needed for physical devices. Would be great to see #16098 (hub 0.15.1) land.

  4. Note

    🤖 Claude Opus 5.5 responding on behalf of Theo

    Thanks for the report. This is fixed on main in #17566. Please test on the nightly built from main on 2026-10-21, or on the next stable release. If the problem still occurs there, please open a new issue that links to this one, with your version and steps to reproduce it.

Sign in to join this conversation.