Skip to content

Commit

Permalink
only two run
Browse files Browse the repository at this point in the history
  • Loading branch information
Comma Device committed Oct 8, 2024
1 parent 9199c64 commit 8d9a9e2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 29 deletions.
1 change: 1 addition & 0 deletions launch_openpilot.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash

export DISABLE_DRIVER=1
exec ./launch_chffrplus.sh
6 changes: 3 additions & 3 deletions selfdrive/selfdrived/selfdrived.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(self, CP=None):
# TODO: de-couple selfdrived with card/conflate on carState without introducing controls mismatches
self.car_state_sock = messaging.sub_sock('carState', timeout=20)

ignore = self.sensor_packets + self.gps_packets + ['alertDebug']
ignore = self.sensor_packets + self.gps_packets + ['alertDebug', 'driverStateV2', 'driverMonitoringState', 'driverCameraState']
if SIMULATION:
ignore += ['driverCameraState', 'managerState']
if REPLAY:
Expand Down Expand Up @@ -169,8 +169,8 @@ def update_events(self, CS):
if not self.CP.pcmCruise and CS.vCruise > 250 and resume_pressed:
self.events.add(EventName.resumeBlocked)

if not self.CP.notCar:
self.events.add_from_msg(self.sm['driverMonitoringState'].events)
#if not self.CP.notCar:
# self.events.add_from_msg(self.sm['driverMonitoringState'].events)

# Add car events, ignore if CAN isn't valid
if CS.canValid:
Expand Down
11 changes: 3 additions & 8 deletions system/camerad/cameras/spectra.cc
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ void SpectraCamera::config_ife(int io_mem_handle, int fence, int request_id, int
tmp.type_1 |= (sizeof(cam_isp_clock_config) + sizeof(tmp.extra_rdi_hz)) << 8;
static_assert((sizeof(cam_isp_clock_config) + sizeof(tmp.extra_rdi_hz)) == 0x38);
tmp.clock = {
.usage_type = 1, // dual mode
.usage_type = 0, // dual mode
.num_rdi = 4,
.left_pix_hz = 404000000,
.right_pix_hz = 404000000,
Expand All @@ -494,7 +494,7 @@ void SpectraCamera::config_ife(int io_mem_handle, int fence, int request_id, int
tmp.type_2 |= (sizeof(cam_isp_bw_config) + sizeof(tmp.extra_rdi_vote)) << 8;
static_assert((sizeof(cam_isp_bw_config) + sizeof(tmp.extra_rdi_vote)) == 0xe0);
tmp.bw = {
.usage_type = 1, // dual mode
.usage_type = 0, // dual mode
.num_rdi = 4,
.left_pix_vote = {
.resource_id = 0,
Expand Down Expand Up @@ -691,18 +691,16 @@ void SpectraCamera::configISP() {
.dt = sensor->frame_data_type,
.format = sensor->mipi_format,

.test_pattern = 0x1, // sensor's bayer pattern
.test_pattern = CAM_ISP_PATTERN_BAYER_GRGRGR,
.usage_type = 0x0,

.left_start = 0,
.left_stop = sensor->frame_width - 1,
.left_width = sensor->frame_width,

/*
.right_start = 0,
.right_stop = sensor->frame_width - 1,
.right_width = sensor->frame_width,
*/

.line_start = 0,
.line_stop = sensor->frame_height + sensor->extra_height - 1,
Expand Down Expand Up @@ -741,9 +739,6 @@ void SpectraCamera::configISP() {
CAM_MEM_FLAG_HW_READ_WRITE | CAM_MEM_FLAG_KMD_ACCESS | CAM_MEM_FLAG_UMD_ACCESS | CAM_MEM_FLAG_CMD_BUF_TYPE,
m->device_iommu, m->cdm_iommu);

ife_patch1.init(m, 12480, 0x20, CAM_MEM_FLAG_HW_READ_WRITE | CAM_MEM_FLAG_UMD_ACCESS | CAM_MEM_FLAG_CMD_BUF_TYPE, m->device_iommu, m->cdm_iommu);
ife_patch2.init(m, 80160, 0x20, CAM_MEM_FLAG_HW_READ_WRITE | CAM_MEM_FLAG_UMD_ACCESS | CAM_MEM_FLAG_CMD_BUF_TYPE, m->device_iommu, m->cdm_iommu);

config_ife(0, 0, 1, 0);
}

Expand Down
15 changes: 0 additions & 15 deletions system/camerad/cameras/spectra.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,6 @@ class SpectraMaster {
int cdm_iommu = -1;
};

class SpectraBuf {
public:
void init(SpectraMaster *m, int s, int a, int flags, int mmu_hdl = 0, int mmu_hdl2 = 0) {
size = s;
alignment = a;
ptr = alloc_w_mmu_hdl(m->video0_fd, size, (uint32_t*)&handle, alignment, flags, mmu_hdl, mmu_hdl2);
assert(ptr != NULL);
};

void *ptr;
int size, alignment, handle;
};

class SpectraCamera {
public:
SpectraCamera(SpectraMaster *master, const CameraConfig &config);
Expand Down Expand Up @@ -134,8 +121,6 @@ class SpectraCamera {
int buf0_handle = 0;
const int buf0_size = 67984; // unclear what this is and how it's determined, for internal ISP use? it's just copied from an ioctl dump
const int buf0_alignment = 0x20;
SpectraBuf ife_patch1;
SpectraBuf ife_patch2;

int buf_handle[FRAME_BUF_COUNT] = {};
int sync_objs[FRAME_BUF_COUNT] = {};
Expand Down
14 changes: 11 additions & 3 deletions system/camerad/debug.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/usr/bin/bash
set -e

#echo 4294967295 | sudo tee /sys/module/cam_debug_util/parameters/debug_mdl

# no CCI and UTIL, very spammy
echo 0xfffdbfff | sudo tee /sys/module/cam_debug_util/parameters/debug_mdl

sudo dmesg -C
scons -u -j8 --minimal .
#DEBUG_FRAMES=1
#DISABLE_ROAD=1 DISABLE_WIDE_ROAD=1
DISABLE_DRIVER=1 LOGPRINT=debug ./camerad
export DEBUG_FRAMES=1
#export DISABLE_ROAD=1 DISABLE_WIDE_ROAD=1
export DISABLE_DRIVER=1
#export LOGPRINT=debug
./camerad

0 comments on commit 8d9a9e2

Please sign in to comment.