fix: dashcamd OMX crash on restart, add dashcam status indicator
- 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:
@@ -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) {
|
||||
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
struct StatusData {
|
||||
QString time, storage, ram, load, temp, fan, ip, wifi;
|
||||
QString vpn_status, vpn_ip, gps, telemetry;
|
||||
QString dashcam_status, dashcam_size;
|
||||
float temp_c = 0;
|
||||
};
|
||||
|
||||
@@ -49,6 +50,7 @@ private:
|
||||
QLabel *gps_label;
|
||||
QLabel *time_label;
|
||||
QLabel *telemetry_label;
|
||||
QLabel *dashcam_label;
|
||||
QLabel *panda_label;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user