mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 16:23:46 +08:00
Here a we go
This commit is contained in:
Binary file not shown.
@@ -24,6 +24,8 @@
|
||||
#include "common/clutil.h"
|
||||
#include "common/params.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/timing.h"
|
||||
#include "common/watchdog.h"
|
||||
|
||||
|
||||
ExitHandler do_exit;
|
||||
@@ -285,6 +287,7 @@ void camerad_thread() {
|
||||
// poll events
|
||||
LOG("-- Dequeueing Video events");
|
||||
while (!do_exit) {
|
||||
watchdog_kick(nanos_since_boot());
|
||||
struct pollfd fds[1] = {{.fd = m.video0_fd, .events = POLLPRI}};
|
||||
int ret = poll(fds, std::size(fds), 1000);
|
||||
if (ret < 0) {
|
||||
|
||||
@@ -276,7 +276,9 @@ int SpectraCamera::clear_req_queue() {
|
||||
.flush_type = CAM_FLUSH_TYPE_ALL,
|
||||
};
|
||||
int err = do_cam_control(m->icp_fd, CAM_FLUSH_REQ, &cmd, sizeof(cmd));
|
||||
assert(err == 0);
|
||||
if (err != 0) {
|
||||
LOGE("failed to flush BPS requests: %d", err);
|
||||
}
|
||||
LOGD("flushed bps: %d", err);
|
||||
}
|
||||
|
||||
@@ -1012,7 +1014,7 @@ void SpectraCamera::enqueue_frame(uint64_t request_id) {
|
||||
}
|
||||
|
||||
if (icp_dev_handle > 0) {
|
||||
ret = do_cam_control(m->cam_sync_fd, CAM_SYNC_CREATE, &sync_create, sizeof(sync_create));
|
||||
ret = do_sync_control(m->cam_sync_fd, CAM_SYNC_CREATE, &sync_create, sizeof(sync_create));
|
||||
if (ret != 0) {
|
||||
LOGE("failed to create fence: %d %d", ret, sync_create.sync_obj);
|
||||
} else {
|
||||
|
||||
@@ -56,23 +56,24 @@
|
||||
},
|
||||
{
|
||||
"name": "boot",
|
||||
"url": "https://commadist.azureedge.net/agnosupdate/boot-0191529aa97d90d1fa04b472d80230b777606459e1e1e9e2323c9519839827b4.img.xz",
|
||||
"hash": "0191529aa97d90d1fa04b472d80230b777606459e1e1e9e2323c9519839827b4",
|
||||
"hash_raw": "0191529aa97d90d1fa04b472d80230b777606459e1e1e9e2323c9519839827b4",
|
||||
"size": 18515968,
|
||||
"url": "https://www.dropbox.com/scl/fi/9l9io42qfx2shr9er5jqx/boot9.img.xz?rlkey=lbtxz862kxbvn3jn98ejitj8p&st=vr35tgz7&dl=1",
|
||||
"hash": "ab2eba0f96b2f48efa376330c3eb509158361adf3ad9c20f269ec92457aa841f",
|
||||
"hash_raw": "ab2eba0f96b2f48efa376330c3eb509158361adf3ad9c20f269ec92457aa841f",
|
||||
"size": 48343040,
|
||||
"sparse": false,
|
||||
"full_check": true,
|
||||
"has_ab": true,
|
||||
"ondevice_hash": "492ae27f569e8db457c79d0e358a7a6297d1a1c685c2b1ae6deba7315d3a6cb0"
|
||||
"ondevice_hash": "c12865a879012d6ad3da538c2ae8aff7d58c308c303fc5d8af309cb1707bc036"
|
||||
},
|
||||
{
|
||||
"name": "system",
|
||||
"url": "https://www.dropbox.com/scl/fi/8fd3w7hbhsyq146kqqdab/system8.img.xz?rlkey=5zt15mtuehdlj8ncj6pwn7zjy&st=j6tr4d47&dl=1",
|
||||
"hash": "4c01245932068aedfceb41cb1aab1f7f044f6659aa2fe2de558f99e2d3aa5793",
|
||||
"hash_raw": "4c01245932068aedfceb41cb1aab1f7f044f6659aa2fe2de558f99e2d3aa5793",
|
||||
"size": 5368709120,
|
||||
"url": "https://www.dropbox.com/scl/fi/3gtw78kxn6xs6dil10fmc/system9.img.xz?rlkey=uwj6tss7lw3j1di09xvtdugcy&st=ghnm9teb&dl=1",
|
||||
"hash": "b6f1e5ade7baa0078990e881b9f392b6a29164347df8f54be20c81e9c9dbabfe",
|
||||
"hash_raw": "b6f1e5ade7baa0078990e881b9f392b6a29164347df8f54be20c81e9c9dbabfe",
|
||||
"size": 4718592000,
|
||||
"sparse": false,
|
||||
"full_check": false,
|
||||
"has_ab": true
|
||||
"has_ab": true,
|
||||
"ondevice_hash": "b6f1e5ade7baa0078990e881b9f392b6a29164347df8f54be20c81e9c9dbabfe"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -522,6 +522,14 @@ class ManagerProcess(ABC):
|
||||
if dt > self.watchdog_max_dt and ENABLE_WATCHDOG:
|
||||
self.capture_watchdog_debug_dump_async(f"watchdog_timeout started={started}", dt)
|
||||
cloudlog.error(f"Watchdog timeout for {self.name} (exitcode {self.proc.exitcode}) restarting ({started=})")
|
||||
if isinstance(self, NativeProcess):
|
||||
sentry.capture_message(
|
||||
f"Native process watchdog timeout: {self.name}",
|
||||
level="fatal",
|
||||
tags={"process": self.name, "process_kind": "native", "failure": "watchdog"},
|
||||
extras={"pid": self.proc.pid, "watchdog_dt": dt, "started": started},
|
||||
flush_timeout=0.5,
|
||||
)
|
||||
self.restart()
|
||||
|
||||
def stop(self, retry: bool = True, block: bool = True, sig: signal.Signals = None) -> int | None:
|
||||
@@ -715,7 +723,16 @@ def ensure_running(procs: ValuesView[ManagerProcess], started: bool, params=None
|
||||
for p in procs:
|
||||
# Reap crashed processes so they can be cleanly restarted below.
|
||||
if p.proc is not None and p.proc.exitcode is not None and not p.shutting_down:
|
||||
cloudlog.error(f"Process {p.name} crashed with exitcode {p.proc.exitcode}, restarting")
|
||||
exitcode = p.proc.exitcode
|
||||
cloudlog.error(f"Process {p.name} crashed with exitcode {exitcode}, restarting")
|
||||
if isinstance(p, NativeProcess):
|
||||
sentry.capture_message(
|
||||
f"Native process crashed: {p.name}",
|
||||
level="fatal",
|
||||
tags={"process": p.name, "process_kind": "native"},
|
||||
extras={"exitcode": exitcode, "started": started},
|
||||
flush_timeout=0.5,
|
||||
)
|
||||
p.stop(retry=False)
|
||||
|
||||
if p.enabled and p.name not in not_run and p.should_run(started, params, CP, starpilot_toggles):
|
||||
|
||||
@@ -12,6 +12,7 @@ from openpilot.system.manager.process import PythonProcess, NativeProcess, Daemo
|
||||
|
||||
WEBCAM = os.getenv("USE_WEBCAM") is not None
|
||||
UI_WATCHDOG_MAX_DT = int(os.getenv("UI_WATCHDOG_MAX_DT", "10"))
|
||||
CAMERAD_WATCHDOG_MAX_DT = int(os.getenv("CAMERAD_WATCHDOG_MAX_DT", "5"))
|
||||
|
||||
def driverview(started: bool, params: Params, CP: car.CarParams, starpilot_toggles: SimpleNamespace) -> bool:
|
||||
return started or params.get_bool("IsDriverViewEnabled")
|
||||
@@ -123,7 +124,8 @@ procs = [
|
||||
NativeProcess("stream_encoderd", "system/loggerd", ["./encoderd", "--stream"], or_(and_(livestream, not_(iscar)), notcar)),
|
||||
PythonProcess("logmessaged", "system.logmessaged", always_run),
|
||||
|
||||
NativeProcess("camerad", "system/camerad", ["./camerad"], or_(camera_run, livestream), enabled=not WEBCAM),
|
||||
NativeProcess("camerad", "system/camerad", ["./camerad"], or_(camera_run, livestream), enabled=not WEBCAM,
|
||||
watchdog_max_dt=CAMERAD_WATCHDOG_MAX_DT),
|
||||
PythonProcess("webcamerad", "tools.webcam.camerad", driverview, enabled=WEBCAM),
|
||||
PythonProcess("proclogd", "system.proclogd", and_(allow_logging, only_onroad), enabled=platform.system() != "Darwin"),
|
||||
PythonProcess("journald", "system.journald", and_(allow_logging, only_onroad), platform.system() != "Darwin"),
|
||||
|
||||
Reference in New Issue
Block a user