You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0fb5775
Browse filesBrowse the repository at this point in the historyBrowse files
feat: stream Android emulators on Windows and Linux with OpenH264
Non-macOS builds link native_stubs.c instead of the macOS simulator bridge,
so the Android emulator WebRTC source had no H.264 encoder and every stream
failed with the stub error. Frame capture (emulator gRPC screenshots) and the
WebRTC transport were already cross-platform Rust; only the encoder was
missing.
Server:
- Add transport/software_h264.rs: an OpenH264 encoder (openh264 crate,
compiled from source, BSD) that turns RGBA/BGRA emulator frames into
Annex B baseline H.264. Bitrate follows the macOS budget (bits per pixel
with a minimum), keyframes honor RTCP requests, and the encoder rebuilds
on size or quality changes. Unit tests cover the budget math, frame
validation, keyframe forcing, and reinitialization.
- Route the Android WebRTC source through it on non-macOS builds; macOS
keeps the native VideoToolbox/x264 path behind the C ABI. Frame
publishing is shared between both paths.
- Reframe platform.rs around iOS simulator support: liveVideo now reports
supported: true everywhere with encoder ("native" or "openh264"),
androidEmulator, iosSimulator, and an iosSimulatorReason off macOS.
WebRTC offers for iOS simulators on non-macOS answer 501; Android offers
proceed.
- CLI banner note now says Android streams with software H.264 and iOS
simulators require macOS.
CI: add a Linux and Windows cargo clippy/test job so the OpenH264 module and
the native stubs are linted and tested where they are actually compiled.
Docs: per-platform encoder table, health/REST field docs, troubleshooting
entries for the iOS message and slow software encoding, AGENTS pointer.
Cargo.lock is not updated here (no Rust toolchain on the authoring machine);
the first cargo build adds the openh264 entries.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ view inside the editor.
39
39
40
40
## Features
41
41
42
-
- Supports native H.264 streaming for both iOS simulators and Android emulators (live video requires the macOS build; the Windows and Linux CLIs manage Android emulators without a browser stream)
42
+
- Supports native H.264 streaming for both iOS simulators and Android emulators (iOS simulators need the macOS build; Windows and Linux stream Android emulators with a built-in OpenH264 software encoder)
43
43
- Full simulator control & inspection using private iOS accessibility APIs and Android UIAutomator - available using `simdeck` CLI
44
44
- Real-time screen `describe` command using accessibility view tree - available in token-efficient format for agents
45
45
- Profiling built-in: CPU, memory, disk writes, network throughput, hang signals, and stack sampling
|`videoCodec`| Requested codec mode: `auto`, `hardware`, or `software`|
52
57
|`hostOs`| Server build target: `macos`, `windows`, or `linux`|
53
-
|`liveVideo`|Whether this build can encode the live H.264 stream|
58
+
|`liveVideo`|Live stream encoder and per-platform device support|
54
59
|`androidGpu`| Android emulator renderer mode for SimDeck-owned boots |
55
60
|`streamQuality`| Active stream profile and limits |
56
61
|`webRtc`| ICE settings the browser should use |
57
62
58
-
`liveVideo` is `{ "supported": true, "requires": "macos" }` on macOS. Windows
59
-
and Linux builds return `supported: false` plus a `reason` string, because live
60
-
H.264 encoding for both iOS simulators and Android emulators lives in the macOS
61
-
native bridge. Clients should show that reason instead of opening a WebRTC
62
-
offer; the offer endpoint answers `501 Not Implemented` with the same message.
63
+
`liveVideo.encoder` is `native` on macOS (VideoToolbox or x264 through the
64
+
simulator bridge) and `openh264` on Windows and Linux, where Android emulator
65
+
frames are encoded in software. `androidEmulator` is `true` everywhere.
66
+
`iosSimulator` is `true` only on macOS; other builds add an
67
+
`iosSimulatorReason` string, and the WebRTC offer endpoint answers iOS
68
+
simulator offers there with `501 Not Implemented` and the same message.
69
+
`supported` is `true` for every shipped build; a client should treat
70
+
`supported: false` plus `reason` as "do not open a WebRTC offer".
63
71
`GET /api/stream-quality` includes the same `liveVideo` block.
64
72
65
73
When auth is required, the `401` JSON body still includes `serverId`, `advertiseHost`, `hostId`, `hostName`, `httpPort`, and `serverKind` so native clients can group endpoints before pairing.
Copy file name to clipboardExpand all lines: docs/guide/troubleshooting.md
+22-9Lines changed: 22 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,19 +107,32 @@ Android IDs in SimDeck use `android:<avd-name>`.
107
107
108
108
## Stream is black or stuck
109
109
110
-
### Live video requires macOS
110
+
### iOS simulators require macOS
111
111
112
112
```text
113
-
Live H.264 video streaming requires macOS. This SimDeck build for Windows can manage devices but does not include the native H.264 encoder...
113
+
iOS simulators require macOS. This SimDeck build for Windows can boot, control, and stream Android emulators, but the iOS simulator bridge is only available on macOS.
114
114
```
115
115
116
-
This is expected on the Windows and Linux builds, for both iOS simulators and
117
-
Android emulators. Those builds link a stub instead of the macOS native bridge
118
-
that owns VideoToolbox and x264 encoding, so the browser stream, the encoder
119
-
menu, and `--video-codec` cannot work there. Device control, `describe`,
120
-
screenshots, and the inspectors still run. Use a Mac to see the live screen, or
121
-
pair a Windows or Linux browser with a SimDeck service running on a Mac. Check
122
-
`liveVideo.supported` in `GET /api/health` when scripting against the service.
116
+
This is expected on the Windows and Linux builds. They link a stub instead of
117
+
the macOS native bridge that owns iOS simulator control and the VideoToolbox
118
+
and x264 encoders. Android emulators still boot, stream, and accept input on
119
+
those hosts through the built-in OpenH264 software encoder. Use a Mac for iOS
120
+
simulators, or pair a Windows or Linux browser with a SimDeck service running on
121
+
a Mac. Check `liveVideo.iosSimulator` in `GET /api/health` when scripting
122
+
against the service.
123
+
124
+
### Android stream is slow on Windows or Linux
125
+
126
+
Those builds encode with OpenH264 in software. Lower the encoded size first,
127
+
then the frame rate:
128
+
129
+
```sh
130
+
simdeck service restart --stream-quality low
131
+
```
132
+
133
+
`GET /api/metrics` lists `androidEncoders[].encoder.native` with
134
+
`latestEncodeLatencyUs` and `skippedFrames`; if encode latency stays above the
135
+
frame interval, the host CPU cannot keep up with the selected profile.
Copy file name to clipboardExpand all lines: docs/guide/video.md
+20-11Lines changed: 20 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,26 @@ SimDeck streams live device video to the browser. Local iOS sessions default to
5
5
iOS simulator H.264 uses VideoToolbox for hardware encoding and x264 for software encoding.
6
6
Android emulator H.264 uses the emulator gRPC `streamScreenshot` API when SimDeck owns the boot. SimDeck receives raw RGBA frames, pads odd dimensions for H.264, and encodes them on the Mac. If the gRPC endpoint is unavailable, SimDeck falls back to the emulator `-share-vid` display surface and reads BGRA frames from the `videmulator<console-port>` shared memory region.
7
7
8
-
## Platform requirement
9
-
10
-
Live video needs the macOS build. Both encoders above live in the macOS native
11
-
bridge, so the Windows and Linux CLIs link a stub instead and cannot stream iOS
12
-
simulators or Android emulators to the browser. Those builds still manage
13
-
Android emulators, but `--video-codec`, stream quality, and the encoder menu
14
-
have no effect there. The service reports this through `liveVideo` in
15
-
`GET /api/health` and `GET /api/stream-quality`, prints a `Live video:` note
16
-
when it starts, and answers WebRTC offers with `501 Not Implemented` and the
17
-
same explanation. The browser client hides the retry loop and shows that
0 commit comments