Commit Graph

258 Commits

Author SHA1 Message Date
Dean Lee a8c5acb884 c++ replay: publish all frames in CameraServer (#22378)
* cameraserver

* support yuv

* init camera server in start()

* trigger ci
old-commit-hash: 1eb79d7a59a36e75ef2ccb1a8b1cea084784fc43
2021-10-04 16:45:28 +02:00
Dean Lee 5f63a9339c fix yuv420_to_jpeg: thumbnail_width & thumbnail_height must be aliged with 16 pixel. (#22287)
* aligned by 16px

* make buf big enough

* comment

* add comment

* comment
old-commit-hash: ae9305e7ff1bdba7afb94feb5e661ab2472321de
2021-09-23 13:20:10 -07:00
Dean Lee c0777f89bf webcam: add /usr/include/opencv4 to CPPPATH (#22320)
old-commit-hash: 5f9e0f7869eddcaff6e643cb7cf5031fcab82864
2021-09-23 11:43:51 -07:00
Willem Melching cfbee2bdca Script to extract thumbnails from segment (#22294)
* Script to extract thumnails from segment

* fix name

* whitespace
old-commit-hash: 8a836b7e1eb65b4a59a5be25f8b7dce9e2bedd0b
2021-09-21 10:14:16 -07:00
Dean Lee b7f3d92c9b camerad: added replay camera (#21241)
* start refactor

* remove camera_frame_stream from files_common

* rename camera_pc to camera_replay

* continue

* loop one segment

* rename cam_frame_id to stream_frame_id

* apply review

* continue

* more

* publish camera state

* cleanup

* cleanup

* better comment

* delete s->pm in cameras_close()

* add function getFrameCount

* refactor loop

* fix typo

* restore freame stream

* disable roadcam

* dd

* move file

* merge master

* fix test case

* add todo

* white space

* remove from release files

* add files back to relase

* move framereader back to ui/replay

* merge master

test_replay
old-commit-hash: 9b302488f98f7fcaf52a943e98de54196375b5b8
2021-09-19 14:43:54 -07:00
Dean Lee cd4e070b47 camerad: use the YUV buffer to create the jpeg thumbnail (#21936)
* yuv420_to_jpeg

continue

* add comments

* cleanup

* return ky::array
old-commit-hash: e0b5b4573ed34890a5e923012bf96fe311fd11dd
2021-09-17 17:00:21 -07:00
Dean Lee 4c17c06799 Handle EINTR for all syscalls that can return it (#21948)
old-commit-hash: f02c8d0e2c04e45ceeea9f2fe9851319d724a637
2021-08-31 16:22:56 -07:00
Dean Lee 94d1866ccd camera_qcom2: new functions device_acquire & device_config (#22077)
* new function device_acquire & device_config

* add space

* apply reviews

* use the specified struct for each command

* fix typo

* apply review

* remove static

* revert device_control
old-commit-hash: 0d3eec385cb65b9f962f6fbbc05e0f62b751239f
2021-08-31 07:21:40 -07:00
Dean Lee 5f64289206 camera_qcom2: use macros for link control operations (#22088)
old-commit-hash: ee5ef4dab25b638837fecae3fbb1c9acc615b65a
2021-08-30 22:10:18 -07:00
Dean Lee ecf3ee7603 loggerd: create encoder threads from cameras_logged (#21875)
old-commit-hash: d9baaf7eb90f0815c4d635d33244975ad71876d2
2021-08-30 19:33:00 -07:00
Dean Lee 7b9555df75 camera_qcom2: refactor open_v4l_by_name_and_index (#22067)
* refactor

* small cleanup

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: cf4ad99554ddbc7a96984f8876c733b4ee379656
2021-08-30 17:12:22 -07:00
Dean Lee 073898d8fd retry ioctls while errno == EINTR (#22054)
old-commit-hash: 31230e5b60aac7a7968a80d14e96f0a6fc9a9222
2021-08-30 16:07:34 -07:00
Dean Lee 6d054a0012 camera_qcom2: remove req_mgr_session_info from CameraState (#22059)
* remove req_mgr_session_info from CameraState

* handle should be int32_t
old-commit-hash: 37dda3d6bf98e86304bf19e88530cff60204fa45
2021-08-30 15:32:31 -07:00
Dean Lee 92627760de camera_qcom2: fix memory leaks in camera_open (#22061)
old-commit-hash: 7a80bf7fcc05b6955dd26dbbc1f6b44721f90781
2021-08-30 14:59:04 -07:00
Dean Lee 75f686f728 camera_qcom2.cc : fix wrong LOGD order (#22072)
old-commit-hash: 862f93f7f13ea8d4a3fabf30f97f7f624358b22b
2021-08-30 09:21:35 -07:00
Dean Lee 88878cc2cd qcom2/enqueue_buffer: use macro CAM_MEM_FLAG_HW_READ_WRITE (#22060)
old-commit-hash: 0f4227f42b2a3610d6e26d5ad4f249fbf77f7dda
2021-08-28 17:43:50 -07:00
Dean Lee 2658ef5243 camera_qcom2.cc: use V4L_EVENT_CAM_REQ_MGR_EVENT (#22057)
old-commit-hash: ffb1dd019ecad9f2230cea501cec9007229ab102
2021-08-28 14:49:56 -07:00
Dean Lee eb17b4403e camera_qcom2: remove unused variables from MultiCameraState (#22058)
old-commit-hash: df6432c8cda96b0fe2d8e7d81a23295552fbc482
2021-08-28 14:44:30 -07:00
Adeeb Shihadeh 277bd43b15 Revert "tici: give loggerd rt priority (#21503)"
This reverts commit 0a50cf851e79342cf3db01033bc91516c504cbea.

old-commit-hash: 54a4eeb0fccd92c3b2f872175cfedf136a1cfc71
2021-08-22 16:57:53 -07:00
Adeeb Shihadeh 5c1d1ebe76 tici: give loggerd rt priority (#21503)
* give loggerd rt priority

* assert

* little more

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7e2752c878a9e8c38639e4caa234bcabb979db2e
2021-08-20 21:27:31 -07:00
Dean Lee 5d77755f18 camerad: remove unused macros and global (#21970)
old-commit-hash: e646febaaebca8440510824a0b73c9281bf96f3e
2021-08-19 14:49:16 -07:00
Dean Lee f32b1655e4 cameras_qcom2.cc: add a missing newline (#21956)
old-commit-hash: 74ecbbed638c390beb50d3c932779492a5f0af97
2021-08-18 10:37:05 +02:00
Willem Melching ae4f3c98d5 refactor loggerd: trigger rotate in encoder thread (#21860)
* trigger rotate in eoncode thread

* rotate in time

* lgtm

* dcam trigger rotate on C3

* check trigger rotate field

* Use >=

* add rotator thread

* set cnt to 0

* test encodeIdx is increasing across segments

* test both segmentId and encodeId

* fix encodeIdx

* no thread needed

* add log for failed to encode

* stricter C3 test, dont check start encodeId on C2 dcam

* only update last_camera_seen_tms when considered for rotate

Co-authored-by: deanlee <deanlee3@gmail.com>
old-commit-hash: a39873872de5b2239e4b89119974e5aa961eba48
2021-08-06 11:10:33 +02:00
arfy slowy 63b3d6024b fix: spelling typos (#21861)
* fix: typo spelling grammar

* revert

* Update selfdrive/locationd/calibrationd.py

* more revert

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: d74def61f88937302f7423eea67895d5f4c596b5
2021-08-05 12:05:49 -07:00
Willem Melching 9038e1b86f C3 AE improvements (#21698)
* AE improvements

* boardd: also use gain to compute IR brightness

* use default rect for DM autoexposure

* more smooth

* whitespace

* camerad cpu usage

* hcg on is slightly better for noise

* hysteris around high conversion gain

* improve i2c timing

* use AB contexts

* HCG default off

* run at 10 hz

* stay in context A for now

* remove ae thread

* wait till next frame is started before sending i2c

* back at 20fps

* add comment and filter across 3 evs

* remove context switch code

* tuning

* recomened without HCG is 0.8x
old-commit-hash: 25de93d133c386c353155c2b782e3807c46150cd
2021-08-05 16:34:36 +02:00
Dean Lee 94d534afea hw.h: move Hardware-related paths to namespace Path (#21826)
* refactor getenv and path

* apply review
old-commit-hash: fefc70b4cab71a11b3c5ed1b8680606ee2013a48
2021-08-04 13:29:03 +02:00
Adeeb Shihadeh 4d0543d92d 100 yuv buffers for all
old-commit-hash: 4c0caf7f7ea3a0127e6b573a78850004aab8e187
2021-07-26 14:02:49 -07:00
Willem Melching d479b9a5de Revert AE changes (#21682)
* Revert AE changes

* keep YUV buffer count
old-commit-hash: b6b0393e2dc3aba054d55884fcfef192b2a28694
2021-07-22 11:22:19 -07:00
Willem Melching 7a9659a9f7 AE: revert changes to min grey target (#21648)
old-commit-hash: b35f6871cb9ed2049ce1f31fcaeb1914677b8177
2021-07-19 10:37:43 +02:00
Willem Melching afd96fb083 only 100 yuv buffers on C2 (#21622)
old-commit-hash: 0d9e7ad24149217cf9e5e215cc5b60a60a77231c
2021-07-16 11:59:30 +02:00
Willem Melching 6dc20d7c75 tici: AE sane default values (#21610)
* tici: AE sane default values

* set exposure time

* remove comment

* set dc gain variable

* whitespace
old-commit-hash: 3ad40963cc5d30d4afd9693653d1f10a9bee61e8
2021-07-15 16:11:27 +02:00
Willem Melching 7198224cf2 tici: improve AE (#21493)
* simplify histogram calculation

* add debug prints

* faster AE

* revert that

* lower log level

* use minimum recomended gains from datasheet

* use define

* fix min gain

* dynamic grey target

* fix build

* add low pass

* more stable rounding

* increase max gain

* always enable HCG

* correctly set min ev

* fix analog gain

* remove unused variable

* fix build

* move recomended gain into cost function

* tweak cost function a bit

* small LPF on desired ev

* fix typo

* lower ts

* clean up defines

* that was used in common

* add cast

* less cost is fine

* fix tests

* whitespace

* filtering is broken

* put back

* clip gain changes instead

* cost function tweaking

* Only go below recomended gain when absolutely necessary

* small penalty on changing gains
old-commit-hash: 63c9b5606358c435b7291a1b35ee4faf6a7870ba
2021-07-13 23:33:50 +02:00
Adeeb Shihadeh 92e236e7ad increase yuv buffer count to hold 5s (#21528)
* increase yuv buffer count to hold 5s

* bump cereal
old-commit-hash: 4738fe0e45a9fded16333b08d27538aeedf044cf
2021-07-10 14:46:20 -07:00
Willem Melching e0378d41cb Refactor camerad exposure logging (#21506)
* simplify gain logging

* clean up metadata

* log grey fractions

* those are not used

* set grey fracs in message

* fix qcom
old-commit-hash: 47be6c751ec69d2f8957c9a1c6f7776a8bde4f7e
2021-07-08 15:22:00 +02:00
Willem Melching 3c5a97251f tici: Switch to 1D dead pixel correction (#21467)
old-commit-hash: 8d075048b30ea00a9d202165f63445d389426814
2021-07-02 14:01:43 +02:00
Dean Lee def897a2c7 fix webcam crash when failed to read video frame (#21272)
old-commit-hash: 73d741b7be4337b4e8dd39e150ee253b62b86153
2021-06-15 12:25:05 +02:00
Dean Lee 147b355dde add space after function name and if statement (#21225)
old-commit-hash: e4e669bb0fc1a919dfb38800099f8e3ad52346f1
2021-06-11 10:17:52 +02:00
Maxime Desroches 426df0435b Convert C++ while loops from int to bool (#21214)
old-commit-hash: 03df1b08bbe6b4156e9aa0bfbc5a85717094c877
2021-06-09 21:09:21 -07:00
Adeeb Shihadeh edd2f1c1a6 fix qcom and qcom2 builds
old-commit-hash: 9e94fb17cfd95dfc5ad85534e50748d5e4225dac
2021-06-08 16:44:05 -07:00
Dean Lee f70a79b838 Use C++ header files instead of C header files. (#21192)
* use cstring instead of string.h

* use cstdio instead of stdio.h

* remove inttypes.h

* use cstdlib instead of stdlib.h

* use cstdint instead of stdint.h

* #include <cstddef>

* cstdlib

* use cmath

* remove stddef.h

* use cassert

* use csignal

* use ctime

* use cerror

* rebase master
old-commit-hash: c53cb5d570adb82bc454fcabab458d7e7f09738c
2021-06-08 13:46:22 -07:00
Dean Lee 3a698faadc Use full include path (#21194)
old-commit-hash: b06b3ecb60c651dacf079513635f7d9d99228783
2021-06-08 12:09:30 -07:00
Dean Lee 497472932a Cleanup util.h (#20849)
* cleanup util.h

* fix build error:omx_encoder.cc:408: undefined reference to do_exit

* fix build error

* rebase master

* move helper functions back to util

* ExitHandleHelper->ExitHandlerHelper

* std::clamp

* struct ExitHandlerHelper to class

* rebase master

* cleanup

* restore ExitHandler

* prefer cassert
old-commit-hash: 65e0b1e699092355bfcb1f588a5a2ec949a34b77
2021-06-01 16:53:12 +02:00
Adeeb Shihadeh c7c49e8e35 fix up model tests + tools (#21071)
* unlogger: send yuv stream

* fix up model test tools

* fix unlogger

* rename model replay

* bump cereal

* test in actions

* no ci for now
old-commit-hash: cf6d133638caac0d974209f92be9c200cdbcbf3f
2021-05-28 23:08:08 -07:00
Adeeb Shihadeh 39d83ba32c remove oneplus camera params (#21047)
* remove oneplus camera params

* align
old-commit-hash: 8fdbbdef73809d69622a1046c693c144167e5b9a
2021-05-26 17:46:43 -07:00
ShaneSmiskol 75b1c7c4ba Improve focus when using snapshot (#21031)
old-commit-hash: a4571443578d53d414ebc3384414e8502ee3c528
2021-05-26 17:17:04 -07:00
George Hotz 6922150ede Move MCLK from 24 -> 19.2 mhz + Add accuracy in sidebar (#20960)
* wip

* one day i'll flip that right

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: f43671c9878e2babc7c524a6f1476c571e8b900a
2021-05-18 22:37:33 -07:00
Dean Lee 5609f32cee Cleanup includes (#20925)
* remove #include <pthread.h>

* remove #include<stdbool.h> for cc files

* remove #include<iostream>
old-commit-hash: 0495426535490e7d8d503af35ace7a20dc70a7bb
2021-05-17 10:31:31 +02:00
Dean Lee e333e4f189 Cleanup selfdrive/ includes (#20822)
* cleanup include path

* continue

* format includes

* fix testraw.cc

* remove include path from SConstruct

* regroup

* rebase master

* almost done

* apply review

* rename FileReader.xx to filereader.xx

* rename Unlogger.x->unlogger.x

* rename FrameReader.xx -> framereader.xx

* apply reviews

* ui.h

* continue

* fix framebuffer.cc build error:mv util.h up

* full path to msm_media_info

* fix qcom2 camerad

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7222d0f20dc8edfe0d2f3417d1ce7c84fbd32805
2021-05-08 22:15:17 -07:00
Willem Melching 78bf4f5867 Replace ifdef with hw abstraction layer (#20843)
* Replace ifdefs with hardware abstraction layer (#20801)

* add type to class hadwareXXX

* replace ifdefs with hardware layer

* continue

* continue

* new function get_driver_view_transform

* full path to hw.h

* fix build error setup.cc

* apply review

* fix typo

* fix deprecated error:replace deprecated fromPath with new

* fix build error

* Fixes after ifdef clenaup (#20842)

* inheritance doesnt work with static

* fix debayer

* small cleanup

* Update selfdrive/camerad/cameras/camera_common.cc

* Update selfdrive/ui/qt/offroad/settings.cc

* Update selfdrive/common/modeldata.h

* flip conditions

* fix comment

Co-authored-by: Dean Lee <deanlee3@gmail.com>
old-commit-hash: ab319d4f54a53e1a0aa1c2c0d94d56a9acef8362
2021-05-06 14:39:05 +02:00
Willem Melching 39c18d4c5a Revert "Replace ifdefs with hardware abstraction layer (#20801)"
This reverts commit 9f2ad462f39f4c880f283b71bffbc9248a2b577d.

old-commit-hash: 3a95d3ccaae7168073410cd7d392a9564d9d45ba
2021-05-06 12:29:30 +02:00