Android CI / build (push) Canceled after 0s
Fixes flaky Hyperion reconnects and 1h WakeLock cutoffs, disables verbose DEBUG logging, and shows server/FPS/capture stats plus credit in the main status card. Co-authored-by: Cursor <cursoragent@cursor.com>
2.1 KiB
2.1 KiB
Pipeline-Changelog – MediaCodec Capture
Branch: feature/mediacodec-capture-pipeline (v3.0.1-mediacodec)
Problem
Auf Ugoos X5M Pro (Amlogic S905X5M, Android 14):
- FlatBuffers-Verbindung zu Hyperion OK
- MediaProjection-Permission OK
- Playstore-Screenrecorder / scrcpy: Bild OK
- Hyperion Grabber (ImageReader): schwarze Frames
Ursache
MediaProjection → VirtualDisplay → ImageReader liefert auf diesem SoC keine nutzbaren Pixel.
Encoder-Surfaces (MediaCodec / MediaRecorder) schon — wie bei scrcpy und Screenrecordern.
Änderung
| Komponente | Vorher | Nachher |
|---|---|---|
| Capture-Consumer | ImageReader (RGBA) |
MediaCodec Encoder-Input-Surface |
| Pixelgewinnung | acquireLatestImage() |
Encode H.264 → Decode → getOutputImage() YUV→RGB |
| VirtualDisplay-Flags | VIRTUAL_DISPLAY_FLAG_PUBLIC |
VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR |
| Consent (API 34+) | Standard-Intent | MediaProjectionConfig.createConfigForDefaultDisplay() |
| Capture-Auflösung | LED-Größe (≤128×72) direkt | Codec-freundlich (~640px Breite), dann Downscale |
| Logging | meist aus | Permission, VD, Codec, Non-Zero, Send-FPS |
Betroffene Dateien
common/.../HyperionScreenEncoder.java— Pipeline-Umbaucommon/.../util/MediaProjectionHelper.java— neuBootActivity,ToggleActivity, Mobile/TVMainActivity— Capture-IntentHyperionScreenService.java— Debug-LogsREADME.md, dieses Changelog
Stabilität (X5M Freeze)
- Problem: Codec-Pump alle 1 ms + Capture 960×540 @ 4 Mbit → Gerät eingefroren, App/Settings nicht nutzbar
- Fix: Capture zurück auf 640×360, Bitrate ~1.5 Mbit, Pump an Ziel-FPS, Letterbox-Crop sofort locken
- Preferences: null-sicheres Caching + robustes
getInt(leere Strings)
Follow-up (Reconnect / Status / WakeLock)
- Reconnect: echte Retry-Schleife auch vor erstem Connect; Socket-Close nach Write-Fehler;
isConnectedprüft!isClosed - WakeLock ohne 1h-Timeout (Dauerbetrieb TV)
DEBUG=falsein Encoder/Service- Übersicht: Live-Status (Server, Port, Status, Sende-FPS, Capture→Output, Frames, Priorität)