port dashcamd: hardware-encoded MP4 dashcam
VisionIPC frames from camerad → OMX H.264 hardware encoder → 3-min MP4
segments + SRT GPS subtitles in /data/media/0/videos/<trip>/. Manages
its own trip lifecycle (WAITING/RECORDING/IDLE_TIMEOUT) and writes
DashcamState/DashcamFrames memory params for the UI's Status window.
Honors DashcamShutdown for graceful close before power-off.
Files added:
- selfdrive/clearpilot/dashcamd.cc + SConscript
Files modified:
- selfdrive/frogpilot/screenrecorder/omx_encoder.{cc,h}: ported broken's
version, which adds encode_frame_nv12() (direct NV12 input from camerad,
alongside the existing encode_frame_rgba used by the disabled screen
recorder) and simplifies the libyuv conversion paths to NEON-only since
this device is aarch64.
- selfdrive/SConscript: register selfdrive/clearpilot/SConscript so the
dashcamd binary is part of the build.
- selfdrive/manager/process_config.py:
- camerad gating driverview → always_run so dashcamd can record the
moment ignition+drive arrives without waiting for camera startup.
- Register dashcamd as NativeProcess gated always_run.
- system/loggerd/deleter.py:
- MIN_BYTES 5 GB → 9 GB to leave headroom for dashcam footage.
- delete_oldest_video(): trip-aware cleanup. Drops entire oldest trip
dir first; if only the active trip remains, drops oldest segment
inside it; cleans up legacy flat .mp4s too.
- cleanup_log2(): keeps /data/log2 session logs under 4 GB total.
- Hooked into deleter_thread: video first when out of bytes/percent;
log2 quota check on the idle path. New code uses print(stderr) per
the no-cloudlog rule.
Verified: built clean, manager started, dashcamd in WAITING state
(DashcamState=waiting, DashcamFrames=0), camerad running, no errors.
This commit is contained in:
@@ -54,7 +54,9 @@ def allow_uploads(started, params, CP: car.CarParams) -> bool:
|
||||
procs = [
|
||||
DaemonProcess("manage_athenad", "selfdrive.athena.manage_athenad", "AthenadPid"),
|
||||
|
||||
NativeProcess("camerad", "system/camerad", ["./camerad"], driverview),
|
||||
# CLEARPILOT: camerad runs always (was driverview) so dashcamd can record
|
||||
# the moment ignition+drive-gear arrives without waiting for camera startup.
|
||||
NativeProcess("camerad", "system/camerad", ["./camerad"], always_run),
|
||||
NativeProcess("logcatd", "system/logcatd", ["./logcatd"], allow_logging),
|
||||
NativeProcess("proclogd", "system/proclogd", ["./proclogd"], allow_logging),
|
||||
PythonProcess("logmessaged", "system.logmessaged", allow_logging),
|
||||
@@ -89,6 +91,9 @@ procs = [
|
||||
# CLEARPILOT: speed/cruise overlay daemon. Reads gpsLocation + carState, writes display
|
||||
# params for the onroad UI; asserts ClearpilotPlayDing on speed-limit warning transitions.
|
||||
PythonProcess("speed_logicd", "selfdrive.clearpilot.speed_logicd", only_onroad),
|
||||
# CLEARPILOT: dashcam — VisionIPC frames → OMX H.264 → 3-min MP4 segments + SRT
|
||||
# GPS subtitles in /data/media/0/videos/. Manages its own trip lifecycle.
|
||||
NativeProcess("dashcamd", "selfdrive/clearpilot", ["./dashcamd"], always_run),
|
||||
# PythonProcess("ugpsd", "system.ugpsd", only_onroad, enabled=TICI),
|
||||
#PythonProcess("navd", "selfdrive.navd.navd", only_onroad),
|
||||
PythonProcess("pandad", "selfdrive.boardd.pandad", always_run),
|
||||
|
||||
Reference in New Issue
Block a user