[Bug]: Android device panel shows "No video received" instead of the hub's "ffmpeg not found" error #14278
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/web
Steps to reproduce#
- On Linux, run the T3 server with ffmpeg unavailable to the device hub. Without uninstalling ffmpeg: set
SERVE_EMU_FFMPEG=/nonexistent/ffmpegfor the server (e.g. a systemd drop-in for the t3 service) and restart it. - Open the Device panel and select an Android emulator.
- Wait about 15 seconds.
Expected behavior#
The panel says ffmpeg is missing or unusable, the reason the device hub already reports.
Actual behavior#
The panel shows "No video received from the device. Reconnect to try again." Nothing in the panel or the server trace mentions ffmpeg.
The hub's Android API does report the cause:
GET /vendor/serve-emu/api/stream-mode?device=emulator-5554 → 503
{"ok":false,"error":{"code":"service_unavailable","message":"ffmpeg not found or unusable (tried \"/nonexistent/ffmpeg\"): spawn /nonexistent/ffmpeg ENOENT"}}
In packages/client-runtime/src/device/stream.ts, a non-OK video response becomes throw new Error(`stream ${response.status}`) without reading the body (line 657 on main). The panel then falls through to the first-frame timeout (FIRST_FRAME_TIMEOUT_MS, 15s) and shows the generic message.
Impact#
Minor bug or occasional failure
Version or commit#
t3 v0.0.43-nightly.20260927.2344 (bundled expo-device-hub 0.12.0)
Environment#
Ubuntu 26.04.1 LTS, T3 background service (systemd), Node 24.21.0, Android emulator 37.1.11
Logs or stack traces#
GET /vendor/serve-emu/api/stream-mode?device=emulator-5554 -> 503
{"ok":false,"error":{"code":"service_unavailable","message":"ffmpeg not found or unusable (tried \"/nonexistent/ffmpeg\"): spawn /nonexistent/ffmpeg ENOENT"}}
GET /vendor/serve-emu/api/stream-settings?device=emulator-5554
{"ok":false,"error":"serve-emu start for emulator-5554 is cooling down after a failure"}
Screenshots, recordings, or supporting files#
No response
Workaround#
Install ffmpeg (e.g. sudo apt install ffmpeg) and restart the T3 server. Investigated with Claude Code.
juliusmarminge added labelsbug
juliusmarminge added labelsvia-triage
Note
Grok responding on behalf of Julius.
Fixed by #18784, which just merged. Opening an Android emulator now checks ffmpeg first, before booting the emulator or starting the viewer session, so a missing or unusable ffmpeg (including a bad
SERVE_EMU_FFMPEGoverride) or one without libx264 shows an actionable error instead of timing out with "No video received". Physical Android and iOS still work without ffmpeg. After you changePATHorSERVE_EMU_FFMPEG, restart the local server. Closing this. If you still see the generic message on a build that includes #18784, please reopen.juliusmarminge closed this
Note
Grok responding on behalf of Julius.
Fixed by #18784, which just merged. Opening an Android emulator now checks ffmpeg first, before booting the emulator or starting the viewer session, so a missing or unusable ffmpeg (including a bad
SERVE_EMU_FFMPEGoverride) or one without libx264 shows an actionable error instead of timing out with "No video received". Physical Android and iOS still work without ffmpeg. After you changePATHorSERVE_EMU_FFMPEG, restart the local server. Closing this. If you still see the generic message on a build that includes #18784, please reopen.My ffmpeg setup is fine but I am getting this error:
android devices are unavailable on host local: Android emulator video needs working ffmpeg with the libx264 encoder. Install it on the device host's PATH or set SERVE_EMU_FFMPEG there, then retry opening the emulator. After changing PATH or SERVE_EMU_FFMPEG, turn device support off and on for SSH hosts, or restart the local environment server.
It seems the local device host does not get the login-shell
PATHthat the rest of T3 Code uses, so it cannot find a Homebrew ffmpeg.Setup: macOS (Apple Silicon), T3 Code (Beta) started from the Dock, expo-device-hub 0.22.1, ffmpeg 9.0.2 from Homebrew at
/opt/homebrew/bin/ffmpeg. It has libx264, and a test encode with-c:v libx264works in my terminal.SERVE_EMU_FFMPEGwas not set.What I see in the running processes, all children of the same T3 Code server process:
claude,codexand the terminalzshhave/opt/homebrew/bininPATH.- The
expo-device-hubprocess has only this:~/Library/Android/sdk/platform-tools:~/Library/Android/sdk/emulator:/usr/bin:/bin:/usr/sbin:/sbin
serve-emu resolves the binary as
process.env.SERVE_EMU_FFMPEG?.trim() || "ffmpeg", so with thatPATHthe lookup fails.The SSH device script already adds
/opt/homebrew/bin:/usr/local/bintoPATH, but the local host has no equivalent.Workaround:
launchctl setenv SERVE_EMU_FFMPEG /opt/homebrew/bin/ffmpeg, then restart T3 Code.Suggested fix: build the local device host environment from the login-shell
PATH, the same as agents and terminals. As a fallback, add/opt/homebrew/binand/usr/local/binon macOS, as the SSH script does.
Sign in to join this conversation.
Triage#
Confirmed on current
main. The Android panel never sees the hub's ffmpeg error, so after 15 seconds it shows the generic first-frame message. This is not the iOSstream.avccpath.expo-device-hub0.12.0 (what T3 pins) defaults Android capture togrpc-screenshot. That mode callsassertFfmpegbefore a session is published. WithSERVE_EMU_FFMPEGunset or pointing at a missing binary, startup throwsffmpeg not found or unusable (tried "…"): …, which is the 503 body onGET /vendor/serve-emu/api/stream-mode. A later start during the hub's cooldown only returnsserve-emu start for <serial> is cooling down after a failure, so the ffmpeg text exists only on the request that actually failed.The Device panel does not call that endpoint. It opens
/vendor/serve-emu/ws. In hub 0.12.0,attachEmuSocketdoesrouter.ensure()and on failure callssocket.close()with no code and no reason, discarding the error.createDeviceStreamClienttreats that close as a transient disconnect (connectAndroidinpackages/client-runtime/src/device/stream.ts): it retries, and the first-frame timer started inconnecting()is not reset. AfterFIRST_FRAME_TIMEOUT_MS(15s) it always fails with "No video received from the device. Reconnect to try again."DeviceStreamViewonly rendersdetailonce status iserror, and that string replaces any close reason. The test "does not extend the first-frame deadline each time a socket reconnects" locks this in: a close reason ofrestartstill becomes "No video".Line 657 (
throw new Error(`stream ${response.status}`)) isreadIosVideo. Android never fetches that body. Patching it would not surface this error.Not a duplicate of #12229 or its open PR #12237 (keyframe handshake and capture source) or #12639 (that recovery work is what added this 15s generic timeout). Still present on
main; no newer release fixes it.A useful fix has to read the startup error from the attempt that failed. Polling
stream-modeafter the socket has already died usually hits the cooldown string instead. Either the hub should close the socket with the error (123-byte WebSocket reason limit), or the client should learn the failure from the start call itself and fail immediately with that message instead of waiting out the first-frame timer.