Commit Graph

45 Commits (87950eb3127e175f0f2b0bb42440f5350c679369)

Author SHA1 Message Date
Adeeb Shihadeh 87950eb312
setup clang tidy (#19533)
* setup clang tidy

* config

* some cleanup

* little more

* remove that

* fix qcom build
2021-01-05 12:50:23 -08:00
Adeeb Shihadeh c57ee16e86
Set GPU priorities + improved modeld priorities (#2691)
* give gpu threads rt priority

* modeld gets highest prio on core 2

* fix frame stream

* lower prio of cal thread

Co-authored-by: Comma Device <device@comma.ai>
2020-12-15 19:22:03 -08:00
Comma Device 536a8c5876 fix camerad qcom2 build 2020-12-15 04:52:40 +00:00
George Hotz cb238fd2ee
Set camerad CL priority to 4 (#2747)
* priority 2 get

* add to files_common

* cl_ext_qcom

Co-authored-by: Comma Device <device@comma.ai>
2020-12-14 13:59:48 -08:00
Dean Lee 3c08d0f1f7
clutil refactor (#2733)
* cleaup clutil.h

* clutil.c -> clutil.cc

* std::hash

* try simplify functions

* using namespace group help functions

* continue

* add function get_platform_info

* continue

* remove caching

* struct CLContext

* std::cout & CL_ERR_TO_STR

* remove CLU_NO_CACHE

* Revert "struct CLContext"

This reverts commit 882e413f22.

* cl_get_error_string : remove undefied error codes

* replace all printf with std::cout

* util::read_file

* cleanup

* revert CL_ERR_TO_STR

* simplify

* add macro CL_ERR_TO_STR

* cl_get_error_string: fix undeclared errors

* log_size should not +1

* use std::stirng log

* apply review
2020-12-11 13:05:32 +01:00
Dean Lee 42183d913f
Error checking macros for opencl (#2615)
* macro CL_CHECK&CL_CHECK_ERR

* trigger checks
2020-11-30 12:04:49 +01:00
ZwX1616 f244b7c7e1
tici front/wide encodeIdx msgs (#2564)
* different msgs

* also add timestamps

* keep impatient log, remove the other

* meaningless
2020-11-19 16:12:02 -08:00
ZwX1616 6b020241c9
Clean up and test camerad refactor (#2310)
* refactor

add function get_camerabuf_by_type

remove cl_free

use camera_id

move front stuff into frontview_thread

bigger refactor

more

typo

rename camerabuf *c to *b

cleanup header files

remove wideview_thread

camera_qcom.c to c++

fix SConscript

camera_process_buf

space

sendrgb same with before

do autoexposure in processing_thread

correct sendrgb

add camera_common.cc

move yuv_transform to CameraBuf

* use C to keep consitent

* rebase master

* rebase master

* continue refactor

* refactor all camera related data&function out of main

 done

* cleanup

* -use buf.rgb_width&height

* remoe ,

* rebase master

* remove unused std::vector

* add func common_camera_process_front

* fix max

* fix sendrgb

* less crap being logged

* fix indents

* add back thumbnails

* thumbnail fixed on tici

* junk junk junk

* unify api

* fix ptr ref

* lol!

* cleanup

* more simplified

* typos

* remove terminate

* use standard polling

* ops_thread refactor, too much code!

* fix build

* ok

* assert

* listen

* incl more

* wq!

* fix more build

* macos

* fix exp targets

* front is different

* const

* bye

* remath

* remove irrelevant

* do ops in a thread

* fix init

* return null

* QCOM2 ops

* qcom2 build

* missing comma

Co-authored-by: deanlee <deanlee3@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
2020-10-16 21:58:05 -07:00
Adeeb Shihadeh f4e18e0b74
Build openpilot with webcam support in CI (#2070) 2020-10-16 15:16:17 -07:00
Willem Melching 2e182e5c57
Params refactor, simplified (#2300)
* always c++

* Create C++ params class

* get works

* tests hang now

* passes tests

* cleanup string formatting

* handle interrupt in blocking read

* fix memory leak

* remove unused constructor

* Use delete_db_value directly

* Rename put -> write_db_value

* filename cleanup

* no semicolons in cython

* Update common/SConscript

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* add std::string version of delete_db_value

* This is handled

* cleanup encoding

* Add clear method to clear all

* add persistent params

* fix android build

* Should be called clear_all

* only import params when needed

* set params path on manager import

* recusrively create directories

* Fix function order

* cleanup mkdirp

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
2020-10-13 16:23:23 +02:00
ZwX1616 00b642146f
tici camera art II (#2223)
* protect highlights

* fix modeld scale factor

* rewrite logic for accurate and smooth AE

* fix condition

* tune speed

* move to qcom2

* not exactly 2x

* avoid hunting due to ettr policy

* tune to new curve

* gain kickdowns

* log params

* 4x legroom

* no limit needed here

* simple lowpass

* tweak

* pin to a remote core

* speedup AE and lower night exp

* this curve makes more sense

* tuning from fleet data

* fix ui

* only qcom2

Co-authored-by: Comma Device <device@comma.ai>
2020-10-09 16:26:43 -07:00
Adeeb Shihadeh 92922ce2ae these should be debug logs 2020-09-17 13:14:18 -07:00
Adeeb Shihadeh ef21b83937
Improve realtime performance on NEOS (#2166)
* fix setting core affinity

* dmonitoringd doesn't need rt priority

* android only gets two cores

* model and planner get core 2

* log missed cycle count

* neos update

* prod image

* revert NEOS changes

* still need this
2020-09-16 15:33:12 -07:00
Adeeb Shihadeh 0604f194b3 bump max vision clients for tici 2020-09-14 21:29:46 -07:00
ZwX1616 13588e4255
improve tici camerad robustness (#2135)
* equalize performance on three threads

* need to request first

* clean up indexing

* obsolete

* handling skips and drops

* clean up repeated chunks

* use main frame id

* oneshot

* real skip check

* move to test

* should be cropped H here

Co-authored-by: Comma Device <device@comma.ai>
2020-09-14 16:05:57 -07:00
Adeeb Shihadeh 4d5733924a
message builder (#2161)
* use custom MessageBuilder from cereal

* use MesageBuilder.toBytes

* bump cereal

* unused

* another one

* fix ui msg

Co-authored-by: deanlee <deanlee3@gmail.com>
2020-09-12 21:48:15 -07:00
Adeeb Shihadeh 349040d958
driver monitoring cleanup (#2101)
* read rhd from param

* don't need that anymore

* fix build

* bump cereal

* read param from camerad too

* add read_db_bool helper

* bump model replay ref commit, IsRHD wasn't set
2020-08-29 17:16:00 -07:00
robbederks 37d6472bfa
Tici camerad (#2048)
* fix camera config

* typos

* oops

* more typo

* lambless

* forget to send

* visualize hist

* more typo

* 0xC000

* simple

* data loss prevention, clean up later

* loggerd

* back up code

* backup

* fixed memory leak

* fix vsync

* upload ecam

* WB

* 3stream

* fix OMX crash on loggerd rotation

* rewritten debayer kernel

* update viewer

* improved AE

* no artifact lines/grids

* standard trigger

* cleanups

* CCM

* cleanups

* slight tweak

* upd push sock

* build all these

* update tele fl

* update cereal

* upd viewer

* DualCameraState -> MultiCameraState

* cameras_open

* disable frame zmq push by default

* more cleanup

* no apks

* fix submodule error

* wat

* clean up trash

* remove junk

* only build on qcom2

* no need to check these

* update cereal

* some more minor cleanup

* bump panda

* add todo

* minor typo

* Revert "minor typo"

This reverts commit 9233a1df7c.

* not care

* use consistent hdr

* some cleanup

* Update selfdrive/camerad/main.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* more cleanups

* remove irrelevant stuff

* this too

* cleanup

* rerun ci

Co-authored-by: ZwX1616 <zwx1616@gmail.com>
Co-authored-by: Tici <robbe@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-08-26 19:59:56 -07:00
Dean Lee d158837617
add function cl_get_device_id (#1948)
* add func cl_get_device_id

cleanup

* add fix from review
2020-08-17 11:24:39 +02:00
Adeeb Shihadeh 862259a94b
exit camerad cleanly on PC (#2035) 2020-08-16 16:11:09 -07:00
Dean Lee f3fb406eee
camerad: protect concurrent access to shared variables and avoid race conditions (#1966)
* Protect concurrent access for shared resources

* fix
2020-08-11 11:40:11 -07:00
Dean Lee fb41b984b0
release opencl objects (#1978) 2020-08-06 15:44:26 -07:00
Dean Lee c1e7b761a9
camerad: cache rgb_roi_buf&conv_result (#1979)
lgtm
2020-08-05 13:39:03 -07:00
Willem Melching 405d94ec6d qcom2 build fixes 2020-07-27 16:13:25 +00:00
Adeeb Shihadeh eb1aa3d831
Wunused (#1841)
* enable Wunused, first pass

* unused stuff in snpe model

* these are used on phone

* handle sigint and sigterm in modeld

* fix phone build

* camera qcom

* QCOM build works

* delete unused camerad vars

Co-authored-by: Comma Device <device@comma.ai>
2020-07-09 09:25:32 -07:00
ZwX1616 3aa99a01d7
recover EON/C2 AF (#1665) 2020-06-23 14:33:32 -07:00
George Hotz 344a9a3699
Fixups for Mac, and a bunch for PC (#1654)
* fix mac nui

* fix cereal

* builds on mac without warnings

* ui swap shouldn't be instant on pc

* camerad builds on mac

* modeld, and now everything, builds on mac

* ui draws pictures on mac now

* fix camerad shutdown

* support ui looping on pc

* python3 on that

* SCNu64 should be cross platform

* bump cereal and new apk

* clean up

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-06-11 18:21:59 -07:00
Jason Young 68531b071c
Reduce scheduler latency for realtime processes (#1638)
* WIP: reduce boardd and other lags

* Copypasta fault

* Silence spurious startup warning

Co-authored-by: Comma Device <device@comma.ai>
2020-06-05 17:09:41 -04:00
Willem Melching 63c8e8439b
Model + camerad test (#1622)
* kind of works

* move that

* hack to get camerad to reliably terminate

* not sure why SIGTERM wasn't working before

* compare bytes

* clean up some hacks

* gitignore

* fix that

* WIP

* no reboot

* comparison works

* pretty print

* fix build

* run in jenkins

* python path

* space

* raise timeout

* new eon

* skip the copy

* spinner

* spin less

* update model ref commit

* reenable that

* clean up

* fix jenkinsfile

* parallel

* wrap it in a stage

* fix linter

* better progress

* lower timeout

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-06-04 18:57:25 -07:00
Willem Melching ab5af232b2
Use C++ version of SubMaster and PubMaster (#1548)
* add PubMaster & SubMaster

remove 'delete msg'

remove headers

* use constructor to initial all submster

* modify drain sockets

* fix typo in ssconscript.remove lines

no checkValid in loggerd

last modify

handle_message:event->&event

fix type

remove heads

event to auto

* new interface

* api changed

* Revert "use constructor to initial all submster"

This reverts commit 73be7ea46250a325ce41d3a0445e34395a2ae692.

* change to new api

* revert loggerd

* dd

* use new PubSub api

* update to new interface

don't modify loggerd

reset panda

reset opendbc

remove empty lines

* switch to new pubMaster

* update to the new inteface

change

remove error code

. to ->

merge paramsd.cc

update panda

fix typo

simplify

fix typo

* Fix build

* always conflate

Co-authored-by: deanlee <deanlee3@gmail.com>
2020-05-21 16:04:33 -07:00
George Hotz d5ca841b0f Revert "Bypass alignment related copy whenever possible (#1443)"
This reverts commit b225016628.
2020-05-04 09:54:05 -07:00
ZwX1616 968e2585cc
bad AF state logging (#1365) 2020-05-02 21:40:43 -07:00
Dean Lee b225016628
Bypass alignment related copy whenever possible (#1443)
remove blank lines

add file messagehelp.h

remove blank line

simplify

after review
2020-05-01 19:21:00 -07:00
ZwX1616 133b1a20b4
RHD support for driver monitoring (#1299) 2020-04-15 16:48:44 -07:00
George Hotz cfcf3f9368
tici: fix loggerd (#1302)
* loggerd builds

* codec

* add frame_id cams

* working

* no qcam on tici

* pthread always

Co-authored-by: Tici <robbe@comma.ai>
2020-03-31 18:25:05 -07:00
George Hotz 8db0993663
tici: add (somewhat) broken camerad support (#1300)
* capnparm

* building in progress

* scons build works

* that script fixes opencl

* start new camera code

* includes and more camera scripts

* control c works now

* no device control yet

* phy too

* just one camera for now

* fix capnparm

* hmm, the inits are needed

* more cameras

* link stop start

* doesn't work yet

* fix ion on qcom2

* start poll ish

* 4 pictures and done

* no jpeg

* it works to picture

* destroy sync obj

* both work for now

* defined QCOM2

* fix fd leak

* run modeld

* 10 bit mode

* real frame stride

* needs digital gain

* dnew

* no color correcting on new

* that snpe doesn't work

* qcom2 gate

* cleanups

* oops, fix aarch64 detector

* update cereal

* modeld works with SNPE

* fix driver monitoring model

Co-authored-by: Tici <robbe@comma.ai>
2020-03-31 16:34:55 -07:00
ZwX1616 a95e61edf4
add webcam to cameras (#1201) 2020-03-26 19:19:47 -07:00
Willem Melching e69e0486ff camerad zmq_poll, also recover from EAGAIN 2020-03-17 13:40:07 -07:00
Willem Melching a4c94128c2 No logging on EINTR, and log all the errnos 2020-03-16 14:58:21 -07:00
Willem Melching 439b4625b6 Add logging to poll EINTR handling, add another catch in camerad/main.cc 2020-03-16 14:55:12 -07:00
Willem Melching 7669a783d6 Camerad add errno logging, and continue on EINTR 2020-03-16 14:40:24 -07:00
ZwX1616 0608b99cd0 rear not front 2020-03-12 16:11:38 -07:00
ZwX1616 9362b7eacf log focus state 2020-03-12 15:13:35 -07:00
ZwX1616 6322a275d6
dmonitoringd (#1016) 2020-01-30 19:12:44 -08:00
George Hotz 84560ccd55 selfdrive/camerad 2020-01-17 10:52:42 -08:00