fix: dashcamd OMX crash on restart, add dashcam status indicator
Some checks failed
prebuilt / build prebuilt (push) Has been cancelled
badges / create badges (push) Has been cancelled

- Reset OMX subsystem (Deinit/Init) on dashcamd startup to clear stale
  encoder state from previous unclean exits
- Validate OMX output buffers before memcpy to prevent segfault
- Validate VisionBuf frame data before encoding
- Add dashcam row to status window showing recording state and disk usage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-16 00:44:13 -05:00
parent 3cbb81f9f1
commit 9ac334b7cf
5 changed files with 39 additions and 0 deletions

View File

@@ -263,6 +263,11 @@ static StatusWindow::StatusData collectStatus() {
// Telemetry
d.telemetry = readFile("/data/params/d/TelemetryEnabled");
// Dashcam
QString dashcam_pid = shellCmd("pgrep -x dashcamd");
d.dashcam_status = dashcam_pid.isEmpty() ? "stopped" : "recording";
d.dashcam_size = shellCmd("du -sh /data/media/0/videos 2>/dev/null | awk '{print $1}'");
// Panda: checked on UI thread in applyResults() via scene.pandaType
return d;
@@ -305,6 +310,7 @@ StatusWindow::StatusWindow(QWidget *parent) : QFrame(parent) {
vpn_label = makeRow("VPN");
gps_label = makeRow("GPS");
telemetry_label = makeRow("Telemetry");
dashcam_label = makeRow("Dashcam");
layout->addStretch();
@@ -376,6 +382,16 @@ void StatusWindow::applyResults() {
telemetry_label->setText("Disabled");
telemetry_label->setStyleSheet("color: grey; font-size: 38px;");
}
if (d.dashcam_status == "recording") {
QString text = "Recording";
if (!d.dashcam_size.isEmpty()) text += " (" + d.dashcam_size + ")";
dashcam_label->setText(text);
dashcam_label->setStyleSheet("color: #17c44d; font-size: 38px;");
} else {
dashcam_label->setText("Stopped");
dashcam_label->setStyleSheet("color: #ff4444; font-size: 38px;");
}
}
void StatusWindow::mousePressEvent(QMouseEvent *e) {