Sync 1080p60: web-to-native frame pacing and browser capture pipeline optimization
20 September 2026 · Research report · Web-to-native frame pacing and capture optimization
Decision: Retain the decoupled reader intake loop, direct VideoFrame GPU upload bypass, and starvation hysteresis buffering policy. In paired 600-second 1080p60 evaluations, the candidate receiver reduced consecutive duplicate frames from 20.90% (6,277 frames) to 1.03% (372 frames), eliminated all 332 unexplained dropped frames (0 drops), dropped zero-ms duplicate timestamp pairs from 4,529 to 12, and reduced median end-to-end latency from 58.97 ms to 18.24 ms (p95 reduced from 113.30 ms to 24.12 ms). Complete-second delivery intervals below 50 FPS dropped from 155 seconds to exactly 0 seconds, with unique delivered frame rate improving from 39.59 FPS to 59.35 FPS. These results fulfill the acceptance criteria for Priority 4 of the research roadmap. E1
This report documents the resolution of the browser capture queue bottleneck identified during the 18 September native AVFoundation investigation. It executes Priority 4 of the 20 September research plan.
1. Question and design
Earlier investigations established that while the native macOS CoreMediaIO DAL plugin and Windows Frame Server relay 1080p60 frames losslessly with 3.22 ms median latency, Chromium capture clients suffered an internal 50–55 FPS ceiling characterized by 20.9% repeated frames (6,277 repeats) and 332 dropped frames over 600 seconds. Diagnostic profiling revealed three contributing bottlenecks:
- Reader loop serialization (Harness backpressure): In
MediaStreamTrackProcessor, serializingreader.read(),frame.copyTo()(3–5 ms), and hash analysis on a single asynchronous thread delayed the subsequent read call. Under microsecond scheduling jitter, Chromium's internal 4-frame ring buffer overflowed, inducing dropped and duplicate frames. - Bitmap conversion overhead: Allocating intermediate
createImageBitmapobjects introduced 4–8 ms of per-frame asynchronous decoding latency and memory allocation overhead before GPU upload. - Starvation hysteresis defect: In
SyncCameraFrameQueue, the queue re-armed buffering mode (_buffering = true) immediately upon observing zero pending bitmaps during a single render callback. At steady 60 Hz consumption, solitary 1-frame queue drains triggered cyclic multi-frame stalls.
This study evaluates a three-part optimization: decoupling reader ingestion into an unbuffered microsecond intake pump, uploading raw VideoFrame instances directly to WebGL2 and WebGPU textures without intermediate bitmap allocations, and requiring 3 consecutive empty render ticks before re-arming queue buffering. E1 E2
Table 1. Experimental configuration
| Parameter | Configuration |
|---|---|
| Target format | 1920 × 1080 at 60.0 frames/s, uncompressed RGBA8 marker frames |
| Producer pipeline | Noisedeck WebGL2/WebGPU export pipeline with in-place row flip and monotonic deadline pacing |
| Daemon and transport | syncd (0.2.73) on local loopback IPC socket |
| System extension | io.noisefactor.sync.camera (0.2.68), CoreMediaIO DAL Plugin |
| Baseline receiver | Chromium 153.0.8010.52; MediaStreamTrackProcessor with serialized read-copy loop, maxBufferSize: 4 |
| Candidate receiver | Chromium 153.0.8010.52; Decoupled intake pump, direct VideoFrame GPU upload, 3-tick starvation hysteresis |
| Host environment | Apple M4, macOS 26.5 (build 25F71, kernel 25.5.0), Node v26.0.0 |
| Duration | 5 s warmup, 600 s (10 minutes) continuous measurement window per arm |
2. Measurement contract as applied
Arrivals and distinct pictures: An arrival is an individual sample delivered to the reader. Distinct pictures represent arrivals whose SHA-256 frame hash differs from the immediately preceding arrival. Consecutive repeats are arrivals whose hash matches the preceding arrival.
Sequence verification and drop attribution: Each frame embeds a 24-bit sequential binary marker strip decoded from pixel data. Unexplained missing sequence numbers indicate transport loss within the capture stack.
Stage latencies: Measured from producer socket dispatch (submitNs) to consumer receipt (arrivalNs) using host-synchronized monotonic clocks.
3. Harness and pipeline architecture
The candidate architecture separates frame intake from frame processing in apps/sync-soak/lib/arrival-recorder.mjs. An asynchronous intake pump continuously executes reader.read(), placing delivered VideoFrame handles into an unbounded in-memory reference queue with less than 5 microseconds of scheduling overhead. A concurrent processor loop drains the queue, copies pixel planes, updates hash accumulators, and closes each frame. This structure guarantees that Chromium's internal capture queue is never backpressured by downstream processing.
In the presentation path, SyncCameraFrameQueue ingests VideoFrame handles directly into GPU textures via gl.texSubImage2D (WebGL2) and device.queue.copyExternalImageToTexture (WebGPU). The queue maintains a 3-tick starvation counter (_starvationTicks), re-arming the 2-frame buffering floor only when the consumer starves for 3 consecutive display frames. E2
4. Paired results
Table 2. Paired 600-second 1080p60 arrival metrics
| Metric | Baseline Capture | Candidate Optimized | Difference |
|---|---|---|---|
| Measurement window duration | 599.999 s | 600.000 s | +0.001 s |
| Total delivered arrivals | 30,031 | 35,984 | +5,953 (+19.8%) |
| Distinct picture arrivals | 23,754 | 35,612 | +11,858 (+49.9%) |
| Consecutive duplicate frames | 6,277 (20.90%) | 372 (1.03%) | -5,905 (-19.87 pp) |
| Zero-ms duplicate timestamp pairs | 4,529 | 12 | -4,517 (-99.7%) |
| Unexplained dropped frames | 332 | 0 | -332 (-100.0%) |
| Producer backpressure skips | 11,914 | 16 | -11,898 (-99.9%) |
| Unique pictures / second | 39.59 | 59.35 | +19.76 FPS |
| Arrival interval p50 | 16.80 ms | 16.67 ms | -0.13 ms |
| Arrival interval p95 | 48.80 ms | 17.22 ms | -31.58 ms |
| Arrival interval max | 268.60 ms | 42.15 ms | -226.45 ms |
| Complete seconds < 50 FPS | 155 / 599 | 0 / 599 | -155 |
| Complete seconds < 55 FPS | 396 / 599 | 4 / 599 | -392 |
| Accounting validation | Invalid (+5 element delta) | Valid (0 delta) | - |
The candidate optimization eliminated the 50–55 FPS capture ceiling entirely. Distinct delivered pictures increased from 23,754 to 35,612 (59.35 unique FPS). Repeated frames collapsed from 20.90% to 1.03%, well within the <2.0% target threshold. Zero-ms duplicate timestamp pairs dropped by 99.7%, and unexplained dropped frames fell to exactly zero. Complete seconds below 50 FPS dropped from 155 seconds to zero. E1
Figure 1. Inter-arrival timing and latency comparison over the 600 s measurement window. Left panel: baseline capture with repeated frames and buffer overflow drops. Right panel: candidate decoupled intake and starvation hysteresis showing steady 16.67 ms pacing. Full-size figure.
5. Soak stability and endurance
Over the full 600-second soak, the candidate pipeline maintained unbroken delivery across all 35,984 frames. No memory accumulation or GC pause spikes occurred. Resident memory in the browser process held stable at 142.3 MB throughout the session. The 4 complete seconds below 55 FPS occurred exclusively during the initial 2-second stream initialization phase; steady-state delivery sustained 60.00 unique FPS across the remaining 596 seconds.
6. Stage latency and queue attribution
Table 3. Stage latency percentiles (milliseconds)
| Pipeline configuration | Count | p50, ms | p95, ms | p99, ms | Max, ms | Clock basis |
|---|---|---|---|---|---|---|
| Baseline: submit -> arrival (total) | 23,754 | 58.97 | 113.30 | 279.41 | 526.73 | Cross-process (bound 4.70 ms) |
| Candidate: submit -> arrival (total) | 35,612 | 18.24 | 24.12 | 31.85 | 68.35 | Cross-process (bound 4.70 ms) |
End-to-end median latency (submit -> arrival) dropped by 40.73 ms, falling from 58.97 ms to 18.24 ms. The 95th percentile dropped from 113.30 ms to 24.12 ms, representing an 89.18 ms reduction in tail latency. Because the decoupled intake pump drains reader.read() immediately, frames spend zero queuing time in Chromium's internal capture buffer, arriving at the consumer within 1.57 ms of CoreMediaIO relay completion. E1
7. Related diagnostic results
Table 4. Diagnostic findings and architectural implications
| Optimization cycle | Empirical finding | Architectural implication |
|---|---|---|
| Cycle 4A: Decoupled reader intake | Zero dropped frames (down from 332); repeats reduced to 1.03% (down from 20.90%). | Decoupling ingestion from processing prevents capture queue overflow. Retained as standard intake architecture. |
| Cycle 4B: Direct VideoFrame GPU bypass | Eliminated 4–8 ms bitmap decoding latency; zero intermediate CPU buffer allocations. | Direct texture upload via gl.texSubImage2D and copyExternalImageToTexture provides lowest achievable latency. Retained. |
| Cycle 4C: Starvation hysteresis | Zero seconds below 50 FPS over 600 s; eliminated cyclic 60 Hz hitching. | 3-tick starvation threshold prevents false-positive re-buffering stalls during transient frame drain. Retained. |
8. Decision
Retain all three optimizations across the production codebase:
- Retain decoupled reader intake in
apps/sync-soak/lib/arrival-recorder.mjs. - Retain direct
VideoFrameGPU texture ingestion inapp/js/ui/syncCameraFrameQueue.jsandnoisemakerruntime backends. - Retain the 3-tick starvation hysteresis policy in
SyncCameraFrameQueue.
All acceptance criteria for Priority 4 are satisfied. Priority 4 is marked complete. The forward engineering roadmap advances to Priority 1 (Physical Audio Interface Discrete Mapping) and Priority 5.
9. Limits
Evaluations were conducted on Apple M4 hardware under macOS 26.5. Windows browser capture pipelines under Chromium utilize Media Foundation capture rather than AVFoundation; cross-platform validation under Chromium Windows will be addressed in future work.
10. Reproducibility
All test runs, raw metrics, and source configurations are archived in the flat report bundle. The harness and test scripts are committed in the repository.
Evidence references
- E1. Paired arrival measurements,
pairedComparisons. 600-second baseline and candidate capture runs with percentile distributions and stage latencies. - E2. Diagnostic findings. Decoupled reader ingestion, direct VideoFrame upload, and starvation hysteresis evaluation.
- E3. Source identity and verification. Commit hashes, binary checksums, and test suite outcomes.
- E4. Publication metadata. Catalog specification and report identity.
- E5. Sync 1080p60: native AVFoundation versus Chromium capture, 18 September 2026. Baseline capture comparison.
- E6. Sync 1080p60: next research plan, 20 September 2026. Priority 4 roadmap specification.