Device Control
Service

Granular control over device interaction subsystems. Independently manage screen mirroring, audio forwarding, and input peripherals.

Scrcpy_Control_Service Dart Stream/Process Low Latency
🖥️ Screen
ADB
🔊 Audio
⌨️ Input
📺

Screen Mirror

Toggle

High-performance visual mirroring with configurable bitrate and resolution scaling.

H.264/H.265 Decoding
Stateless Window Management
Frame Buffer Optimization
toggleScreenMirror(device)
🔊

Audio Forwarding

Toggle

Independent audio stream processing using Opus codec for ultra-low latency.

Opus Codec (192Kbps)
No-Video Mode
Buffer Config (10ms-50ms)
toggleAudioControl(device)
🎮

Input Bridge

Toggle

UHID-based peripheral injection for seamless mouse and keyboard control without physical connection.

UHID Mouse Injection
Keyboard Event Mapping
Shortcut Modifiers
toggleInputControl(device)

Backend Implementation

1
2
3

Process Management

Each service runs in an isolated Process.start() instance. This prevents a crash in one subsystem (e.g., Audio) from affecting others (e.g., Screen Mirroring).

State Broadcasting

A central ValueNotifier emits real-time state changes for UI updates across the application.

StateNotifier<Map<String, bool>>

Resource Cleanup

Strict exitCode listeners ensure PID termination and resource release when services are toggled off.