Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inquiry into mutex locking changes in Device and Queue #520

Closed
diablodale opened this issue Jul 12, 2022 · 16 comments
Closed

inquiry into mutex locking changes in Device and Queue #520

diablodale opened this issue Jul 12, 2022 · 16 comments

Comments

@diablodale
Copy link
Contributor

I'm unsure of some mutex locking changes in commit 55066c5

dai::DeviceBase::closed changed from atomic<bool> to pair of std::mutex + bool

The two places I find these vars are used DeviceBase::isClosed() and DeviceBase::close() correctly implement the mutex+bool pair.
My concern is that there is no known case for this code change and no functional bug.
This change adds code complexity, more cpu, and additional memory use when not needed.
And finally, it makes a substantial behavior change. This change creates a blocking behavior where the original code did not.
Now multiple threads which call these functions will block rather than quickly returning.
Since this is a blocking behavior change, this is a risky change for no known need.

When I refactored this code months ago, I had my head around the locking needs of the multiple threads running. At that time I felt the atomic<bool> was the better choice for simplicity and its non-blocking behavior. It didn't matter which thread closed a device; it only mattered that one thread ran the close code. I acknowledge that I can be wrong and write bugs. But that isn't the case here as there is no known bug and no imagined case.

int DeviceBase::getXLinkChunkSize() {
    checkClosed();

    return pimpl->rpcClient->call("getXLinkChunkSize").as<int>();
}

checkClosed() there is useless.
It calls isClosed() which locks the mutex and returns the bool value of closed.
If it is true then checkClosed() throws which then prevents the call to pimpl->rpcClient->call().
But the checking of the value and the throw are disconnected making the test useless.

Time Thread 1 Thread 2
1 DeviceBase::getXLinkChunkSize()  
2 checkClosed() returns false  
3 …os pauses thread… DeviceBase::close()
4 …os pauses thread… std::unique_lockstd::mutex lock(closedMtx);
5 …os pauses thread… if(!closed) {
6 …os pauses thread… closeImpl();
7 …os pauses thread… closed = true;
8 pimpl->rpcClient->call("getXLinkChunkSize").as();  
9 call(…)  
10 💥 or something fails/bad/errors/etc  

Changing the behavior of the closed/closedMtx to be blocking doesn't help any of the cases that I can readily find. Instead, the above commit causes mutex locking and blocking of threads in the multithreaded world of depthai+xlink sending/receiving packets and making RPC calls. I think this change should be reverted.

dai::XLinkConnection::closed changed from atomic<bool> to pair of std::mutex + bool

Same everything as above. No known need, more complex, and behavior change to blocking.
XLinkConnection::isClosed() is now blocking. Therefore XLinkConnection::checkClosed() is now blocking.
Suprisingly, I didn't find any code calling XLinkConnection::checkClosed() so I don't have a code example.
I also think this change should be reverted.

ai::LockingQueue::destructed changed from std::atomic<bool> to to pair of std::mutex + bool plus redundant if() tests

Same everything as above. No known need, more complex, and (less concerning) behavior change to blocking.
I intentionally removed the if(destructed) and you agreed in my commit fc4b314.
Comments start at #366 (comment)
I don't now have the entirety of that codebase in my head. I would need time to recreate (ugh) my knowledge.
But I trust the decision we both made in Feb...unless you have a specific bug or imagined scenario. 🤔

@Luxonis-Brandon
Copy link
Contributor

Thanks for all the details here!

@themarpe
Copy link
Collaborator

Hi @diablodale

I'll only address the last one currently: #509 (comment)
Let me know if that describes the issue at hand.

Will revisit first two cases later today

@themarpe
Copy link
Collaborator

I agree on the first point.
Check closed should take the mutex as well & then throw if its closed to work as expected.

Yes, both 1st and 2nd cases could be reverted. The imagined scenario doesn't actually require this, could be done with the previous impl (which is a known time after close actually closes).

@diablodale
Copy link
Contributor Author

Hi. Revisiting this as I've returned from my travels. I don't see there was activity in the codebase related to this. Can I make a PR to revert some of these changes?

@themarpe
Copy link
Collaborator

themarpe commented Dec 9, 2022

Hi @diablodale

You may - first and second cases don't have any specific rationale behind it apart from only returning when it was closed after its actually closed

@diablodale
Copy link
Contributor Author

@themarpe , hi. I've got time this week to work on this. I see checkClosed() has spread and in the majority of cases it is useless. None of those cases are thread-safe and the check/throw has a random outcome. I give one of many possible threading scenarios in the OP above.

I recommend the code be fixed as any safety intended by checkClosed() doesn't work. Often, the authors intended to implement..."I need to run some code, but my code can only run if the device is closed, so check that the device is closed and throw if it is open". To implement that...a mutex lock is needed. A lock needs to be held during the entire block of code that has the restriction "...my code can't run if the device is open...". All call locations may not have this same intention. Each call location needs to be analyzed to see if there are other intentions. I see ~50 locations. 🫤

I need to look more, but I have a gut worry around the restriction: "the device is closed" or is it "the device is not open". This might be coded differently in the underlying booleans and mutex. I have to review the code.

If that worry is false, then I might be able to reduce refactoring by using a movable lock like unique_lock and change checkClosed() to return an r-value of that lock and use [[nodiscard]]. The latter is c++17 only so this is error prone...even more since core devs have gotten used to errant usage. Since you want to support c++14, it is probably better to delete the bad checkClosed() function and create a new one like getClosedLock() that returns the r-value and heavily hints there is a return.

Comments before I start coding?

@diablodale
Copy link
Contributor Author

Also problematic is that isClosed() is a public function on several classes; and it is exposed to both C++ and Python.
isClosed() is not thread-safe and I recommend removing it completely.
Until you approve the removal, I'll doc/mark the API strongly to discourage usage and provide warnings.

@themarpe
Copy link
Collaborator

Hi @diablodale

I need to look more, but I have a gut worry around the restriction: "the device is closed" or is it "the device is not open". This might be coded differently in the underlying booleans and mutex. I have to review the code.

The intention is to error out if device was already closed/disconnected.

I agree on it not being thread safe, at the time was mostly a quick add, to see if device went down already.

I think would be best that underlying RPC calls themselfs would check for that & properly error out, that way there would be no need to hold the lock until rpc is finished, etc...

@themarpe
Copy link
Collaborator

WRT isClosed - main intention is to check wheter or not the device connection is still live.
The removal of it is not planned, and would be better to address the shortcomings of it at the current state

@diablodale
Copy link
Contributor Author

WRT isClosed - main intention is to check wheter or not the device connection is still live. The removal of it is not planned, and would be better to address the shortcomings of it at the current state

ok. Callers that spin on isClosed() with a wait(1s) as seen in some examples are not a concern. The concern is the other callers that do active work with the expectation that the device in up and running. Pseudocode...

while (not device.isClosed()) {
  device.makeStateChanges()
  device.push(data)
  device.pull(data)
}

Imagine that above in python. There's nothing that prevents this scenario...

python interpreter some other thread
call isClosed()  
   
receive FALSE from isClosed()  
  set running=false, deallocate all device/queue resources, etc.
logical NOT(FALSE) --> TRUE  
   
while(TRUE) loop  
   
device.makeStateChanges()  
💣 throws, crashes etc.  

Given isClosed() is unreliable/random, I almost think it is better to write the loop as while(true) and let the throw/crash cause the loop exit.

@diablodale
Copy link
Contributor Author

diablodale commented Mar 14, 2023

I also want to highlight a scenario that I see repeatedly, provide a suggestion, and ask your feedback so that I know what to do throughout the codebase.

/**
* Try to retrieve message T from queue. If message isn't of type T it returns nullptr
*
* @returns Message of type T or nullptr if no message available
*/
template <class T>
std::shared_ptr<T> tryGet() {
if(!running) throw std::runtime_error(exceptionMessage.c_str());
std::shared_ptr<ADatatype> val = nullptr;
if(!queue.tryPop(val)) return nullptr;
return std::dynamic_pointer_cast<T>(val);
}

Two issues in this code:

  1. if(!running) throw... is not thread-safe. The running state can change any nanosecond after getting the low-level boolean like in the negation, in the if evaluation, in between it and the throw, etc.
  2. The whole function may not be thread-safe. What is the intention with regards to DataOutputQueue state while this function is called? Is it...
    a. "Allow close/deallocating resources while I try to retrieve message T from those resources (e.g. queue)"
    b. "Prevent close/deallocating resources while I try to retrieve message T from those resources (e.g. queue)"

If the intention is 2b...then a mutex lock is needed so that close() can't proceed at the same time tryGet() is running. I don't think this specific scenario will cause a crash since the queue has its own internal mutex locks. Instead, this is more a semantic/logical inquiry so that I understand the intention

@diablodale
Copy link
Contributor Author

diablodale commented Mar 14, 2023

I think would be best that underlying RPC calls themselfs would check for that & properly error out, that way there would be no need to hold the lock until rpc is finished, etc...

Reviewing the develop codebase, I think the rpc functionality protects itself and throws when bad things happen. Here's what I've seen in code.

  • DeviceBase::init2() creates the pimpl->rpcStream and pimpl->rpcClient
  • pimpl->rpcStream retains a std::shared_ptr<dai::XLinkConnection> which it copied during construct. The XLinkConnection won't ~destroy itself due to this shared ownership. Naturally, a connection can fail due to unexpected problems.
  • pimpl->rpcClient lambda retains a copy of the pimpl->rpcStream. That specific xlinkstream will not ~destroy itself due to this shared ownership. And remember that specific xlinkstream contains the shared XLinkConnection.
  • pimpl->rpcClient lambda calls rpcStream->write() and ->read(). Both of them will throw if they encounter any low-level XLink errors. So if at any time the XLinkConnection and/or XLinkStream die, then these two function calls should throw. The throw will cascade up the call hierarchy. First out of the lambda and to the code that called rpcClient->call().
  • Many (not all) of the places checkClosed() is used are within functions that use RPC. For example, DeviceBase::setTimesync() calls pimpl->rpcClient->call("setTimesync", .... The throw I describe directly above will cascade up from within the rpcClient->call() and then further up. This throw will be throw XLinkWriteError(status, streamName) instead of the checkClosed throw std::invalid_argument("Device already closed or disconnected");. Personally, I'm ok with the low level throw and I also don't think invalid_argument is appropriate since the timesync argument was valid...it was something else that failed. But if you want, it is possible to wrap all the pimpl->rpcClient->call() call locations with a try/catch and throw whatever you want.

There is likely an issue with blindly calling pimpl->rpcClient->call(). It is the basic issue of calling a function through a nullptr. If some thread or code somewhere calls one of these DeviceBase functions like DeviceBase::setTimesync() while something else has closed() the Device and the C++ runtime is destructing the pimpl, then depending on when setTimesync() is called then the rpcClient and/or the pimpl itself can be invalid. A hack for that is to check if pimpl != nullptr before ->rpcClient and then again before ->call(). But that's a race condition as another thread can again be destructing pimpl or DeviceBase. To safely call, I think a mutex is needed to prevent the pimpl and rpcClient pointers from becoming invalid.

diablodale added a commit to diablodale/depthai-core that referenced this issue Mar 14, 2023
diablodale added a commit to diablodale/depthai-core that referenced this issue Mar 14, 2023
diablodale added a commit to diablodale/depthai-core that referenced this issue Mar 14, 2023
diablodale added a commit to diablodale/depthai-core that referenced this issue Mar 14, 2023
diablodale added a commit to diablodale/depthai-core that referenced this issue Mar 14, 2023
diablodale added a commit to diablodale/depthai-core that referenced this issue Mar 14, 2023
@diablodale
Copy link
Contributor Author

The draft PR passed all test+examples. And it ran continuously for ~4hrs serving depth+color. 👍

I've also been thinking about two things:

Checking for pimpl != nullptr is wrong

The only time pimpl could be nullptr is when the DeviceBase is destructed. To create that scenario, a client app has to call an API on a destructed object. ❌ This is a basic c++ bug in the client app. Not a depthai-core bug. Even if we wanted to be helpful, a class's code can not reliably self-inspect a destructed instance.

As example...one of my own apps. I create a Device (which contains a DeviceBase) and then spawn several threads which call APIs on that Device. When I want to end my app, I stop/join all my threads, and then I allow the Device to be destructed. It is the client app's responsibly to not use a destructed object.

I am removing this pimpl check. Pushing a commit, I'll rebase later.

All those auto lock = getLockPreventClose();

The majority are calls to pimpl->rpcClient->call(...).

If something internally fails during Device construct or during running, then the Device might internally close() itself. That close() tears down XLink and therefore all the rpcClient->call() will correctly throw. If there is a hardware/cable/usb/ether failure, the XLink infrastructure will fail and again will correctly throw. All the throw cases are the responsibility of the client app to catch and manage...or not and let their app crash.

I see no need for this lock or an additional check+throw for "closed" for these cases.

Calls to the logger pimpl->setLogLevel(...) and pimpl->getLogLevel()

These are the only other API calls that had checkClosed. Both of these APIs use DeviceBase::Impl::logger and some static code. Therefore, the same thinking applies. pimp and pimpl::logger will always be valid until destruct. And the static code can always be run. If a client wants to call these log apis while the DeviceBase is closed...it is no harm. It will correctly adjust a logger that will never be used.

I see no need for this lock or an additional check+throw for "closed" for these cases.

🤔

Is there a test case that I can review or run that helps me see the need for checkClosed()? Why did the code have all those?

As an experiment, I removed the lock+check+throw functionality of getLockPreventClose(). Recompiled. All test+examples passed 100%.

@themarpe
Copy link
Collaborator

Thanks for the thorough dive into this

I'll start at the "closed" event. The closed event is thought to be a one time event that puts a "closed" from 0->1. It signifies that underneath the device is not available anymore. If more operations are done on Device obj, that is fine. The underlying communication will just error out in that case. However, to not retain a user in some codepath where a device is still thought to be "connected", the check is done to exit from that before hand.

a. "Allow close/deallocating resources while I try to retrieve message T from those resources (e.g. queue)"

I think the thinking falls inline more with an "event" than a "can deallocate & make things invalid".

So I think the overall thread safety WRT the isClosed isn't "important" from perspective of being exact with when the comms fall down, but to be still correct if eg an explicit close is called and at the same time isClosed is checked. Sooner or later any functionality requiring underlying comms, would fail, which would address the new state that the device is in.

Imagine that above in python. There's nothing that prevents this scenario...

And just to apply it to this scenario as well, the final 💣 💥 (device.makeStateChanges() ->💣 throws, crashes etc) should never be a "boom" per se. If device is closed / link falls down, the device itself is still in an okay state, to have calls be made against it, etc..., but throws will notify the user that any "comm" ops are now out of the picture as the link is down. I think this is valid / have no other means of how to do otherwise for such an "async" event.


while something else has closed() the Device and the C++ runtime is destructing the pimpl, then depending on when setTimesync() is called then the rpcClient and/or the pimpl itself can be invalid.

Wouldn't this case also be covered by essentially the Device object staying alive unless a caller has made a mistake of letting it destruct and then calling one of its functions? The pimpl should remain alive?


I am removing this pimpl check. Pushing a commit, I'll rebase later.

Sounds fair on the reasoning, the pimpl should survive the whole lifetime of the parent obj.


I see no need for this lock or an additional check+throw for "closed" for these cases.

I agree (I tried picturing this point above)

Is there a test case that I can review or run that helps me see the need for checkClosed()? Why did the code have all those?

None unfortunately, apart from a either "close" or cable disconnect while doing calls to comms functions.
Reasoning, mostly legacy - just throwing a better error at the end of the comms function - or - as said - catching that one and throwing a more appropriate one in Device, is the way to go here IMO.


(I went through these not in the greatest detail, sorry in advance - let me know if certain things should be expanded upon)

@diablodale
Copy link
Contributor Author

I removed all the checkClosed() and my experimental getLockPreventClose(). Pushed to the draft PR.

I clearly hear you want isClosed() 👂👍. Do you want me to remove the [[deprecated]] warning I put on isClosed()?

In basic single-threaded code (probably most python scripts), explicit calling closed(), then checking isClosed() works. I am concerned about unpredictable hardware/cable failures, the rare multithreaded python script, or multithreaded C++ programs. These do not have clean close() followed by clean isClosed() and then a sleep() loop. Instead, they are random in order and could be simultaneous.

  synchronous calls, single-threaded asynchronous calls, hw failures, or multi-threaded
isClosed()
try/except

Well written code should wrap Device activity with code to catch exceptions. isClosed() only handles basic synchronous clean-close single-threaded scenarios. The try/except handles all cases...it handles the async hardware events and it handles the synchronous scenarious since they will throw. Maybe we should add more doxygen text to isClosed() to further warning and maybe give example?

diablodale added a commit to diablodale/depthai-core that referenced this issue Mar 16, 2023
diablodale added a commit to diablodale/depthai-core that referenced this issue Mar 16, 2023
diablodale added a commit to diablodale/depthai-core that referenced this issue Mar 16, 2023
diablodale added a commit to diablodale/depthai-core that referenced this issue Mar 16, 2023
diablodale added a commit to diablodale/depthai-core that referenced this issue Mar 16, 2023
@themarpe
Copy link
Collaborator

Do you want me to remove the [[deprecated]] warning I put on isClosed()?

Yes, please do.

The distinction made is point on - sentence or two can be added to docs of this function +1.

saching13 added a commit that referenced this issue Apr 3, 2023
* Several FW updates:
- !!! For all sockets/cameras to be scanned, the EEPROM calib data boardName/productName should contain "FFC" or an FFC-related board name: 1090/2090/2088. Otherwise the behavior is to scan only for standard OAK devices sockets/cameras
- Some more checks for the LCM48 (on MAX) supported resolutions
- Fixes for RGB-mono SW-sync for standard OAK-D / OAK-D-Lite camera configs
- AR0234 monochrome support, however needs an OV9282 enabled at the same time for now

* Color/MonoCamera: handle some more cases for newly added resolutions/sockets

* Update shared/FW after merge, fix error log printed for MonoCamera AUTO socket

* Closes: #355

* Bump version to 2.18.0

* Updated FW with some Color/MonoCamera fixes

* stability test

* Update FW:
- fix for high system load crash, especially on PoE devices
- for for OV9282 as MonoCamera on RGB/CAM_A socket

* FW: OV9282 720p/800p max FPS: 60 -> 120

* stability test

* Added a convinience setTimesync function

* Added isUserBootloaderSupported to DeviceBootloader

* Updated XLink with Windows improvements when scanning for already booted USB devices

* Updated FW with device time reset on boot

* Bump to v2.19.0

* Improved wording on unavailable devices

* Fix yolo v5 decoding when there is a single class

* FW: fixes for certain OV9782 and OV9282 permutations/configs,
fix for OV9782/OV9282 alone failing on RGB/CAM_A socket

* Update CI to Node16 compatible actions

* Update FW: fix image size when decimation filter is enabled

* Stability test - limit FPS (#633)

* Print CPU usage

* Limit the FPS so POE devices aren't maxed out

* Increase FPS

* Reverse changes to the system logger example

Co-authored-by: TheMarpe <martin.peterlin7@gmail.com>
Co-authored-by: Matevz Morato <matevz.morato@gmail.com>

* Added getProductName

* Added ids to IO for trace events

* Modified pipeline schema dump to happen on trace log level as well

* Renamed to getDeviceName and added some legacy handling

* Updated FW with productName as protected field and ImageManip behavior revert

* Updated style

* Added IR driver support for new OAK-FFC 4P

* FW: bugfix for device bootup with default static IP

* OAK-FFC 4P R5M1E5 IR/Dot support

* Bump to v2.19.1

* Added EepromError exception class and improved exception handling in calibration related methods

* Increased limit on DeviceBootloader monitor timeout

* Fixed check for user-provided toolchain file when given relative path (#645)

* Fixed check for user-provided toolchain file when given relative path

* WIP: camera/socket board configuration and capability to specify name/alias for a camera instead of socket

* Updated Bootloader to v0.0.22

* Added camera naming capabilites, setting and retrieving. WIP: rest of devices

* FW/CameraControl: fix still-capture for sockets other than RGB/center

* [FW] Fixed ImageManip + Subpixel issues and added FFC camera naming

* get/set camera FrameEvent filter

* Update depthai-shared submodule

* Disable depthai-shared commit hash check

* Change github workflows ubuntu version

* Update submodule

* Rename event filter

* fix #650 missing XLinkProtocolToStr() (#657)

- add local xlinkproto -> string from
  luxonis/XLink/tree/5c61615066af6539e50a4a17b5df3466e4350b21

* Updated grammar

* Update firmware

* WIP: Camera node

* Added capability to set XLink logging level via XLINK_LEVEL env var

* Replace "_CMAKE_" variables with "_DEPTHAI_" (#662)

"_CMAKE_" variables are reserved for internal use and should not be used.
This change also makes it harder for other CMake scripts to accidentall overwrite this variable.

Co-authored-by: Cameron Blomquist <cblomquist@lsa2.com>

* Add comments

* Update FW: Add missing python bindings for boundingBoxMapping

* Updated NETWORK Bootloader with dual protocol capabilities

* [FW] Fixed a bug in board downselection. OAK-D S2/Pro camera enumeration fix.

* [FW] Added support for Mono video/preview in Camera node

* CI - Fixed style & tidy jobs

* Updated dual BL to v0.0.23 temporary build

* Added OAK-D-LR support. WIP: Orientation capability

* [FW/XLink] Explicitly limited to single connection

* ImageManip added colormap capability. TODO min/max range selection

* Add option to override baseline and/or focal length for disparity to depth conversion

* [FW] OAK-D-LR - Fixed default image orientation

* Updated brief description that affects docs of the DetectionParser node.

* Modified API of Camera a bit

* Updated FW with Camera changes and warp capabilities

* Updated FW with Camera warp capabilities

* Added dai::span

* Added undistort/warp API to Camera node

* FW - Modifed watchdog to do a graceful reset instead

* Added additional API to retrieve timestamps at various exposure points

* Fixed documentation on ObjectTracker::setMaxObjectsToTrack

* WIP: mockIsp capabilities

* [FW] Fix for CAM_C not being detected

* Device - Added non exclusive boot option

* Slight Colormap API improvements

* [FW] Added OpenVINO version 'universal'

* Added DeviceBase convinience constructors taking name or deviceid as string

* Add mode and median support to SLC

* Disabled some of the functionality for now

* Tweaked getTimestamp & exposure offset API

* FW: IMX296 support, added THE_1440x1080 resolution

* FW: IMX296 Camera node, IMX378 1080p limited to 60fps

* Bump version to 2.20.0

* Applied formatting

* Temporary revert to macos-11 for CI due to Catch2 issues

* Update FW, API

* Update FW

* Modified OpenVINO::VERSION_UNIVERSAL

* Updated Bootloader to 0.0.24

* Bump version and FW to 2.20.1 (Status LEDs improvement)

* calibration_flash example fix

* Fixed api docs for Warp HW ids

* FW: fix crash with ColorCamera at high resolution and certain ISP scaling

* FW: fix crash with ColorCamera at high resolution and certain ISP scaling

* Bump version to 2.20.2

* Added an ColorCamera isp scale example, and modified test workflow

* Implement multi stereo support

* Implement brightness filter

* FW: fix OV9282 SW-sync on devices with OV9782 RGB camera

* Update FW: Fix OOM due to too many SIPP pipelines

* Modified default device config OpenVINO version to universal

* Merge branch 'catch2_update'

* FW: handle EEPROM `boardOptions` bit 7 for separate I2C on L/R

* FW: fix for IMX378/477/577 on sockets other than RGB

* Update FW: support for stereo alignment to original left or right inputs; OOM fix for 4 stereo nodes with median filter

* Update FW: parsing optimization and improvements for Yolo v6, v6r2, v8

* Update FW w/ syncing stall fix

* Update stereo with more robust frame sync

* Update FW with optional override of spec translation for stereo algorithm calculations

* Correct type

* Update SPIOut.hpp

to address error C4458: declaration of 'id' hides class member

* Expose center alignment scale factor for debug purposes

* Expose SIPP mempool configurable sizes

* Update FW

* Fixed usage of DeviceBootloader with incomplete DeviceInfo and added a convinience constructor

* Closes: #714

* Add alpha scaling option for StereoDepth

* Update FW before merge

* Update FW with RGB alignment fix

* Update FW with performance metrics when DEPTHAI_LEVEL=info is enabled; enable brightness filter for 0 intensity pixels by default

* Improve spatial calculation X and Y accuracy; fix RGB alignment when custom output depth size is specified

* [XLink] Increased max number of links from 32 to 64

* Add crash dump functionality

* Change API to return just crash dump

* Update FW with commit hash attached to crash dump

* Update FW with fix for serialization of thread name

* Add hasCrashDump API

* Update FW

* Update FW, crash dump contains device ID

* Enable MEDAIN spatial calculation method for SpatialDetectionNetwork

* Update FW

* Update docs

* FW: HW sync (trigger mode) enabled for OAK-D-LR, for cameras with matching FPS

* Change default SIPP buffer sizes

* Add 3A skipping option to reduce CPU usage

* Change API to be able to configure isp 3A FPS

* Update BoarConfig with limits

* Update script node python bindings

* Update FW: Add workaround for BNO sequence number limit of 256 (sensors sends uint8)

* FW: camera sensor improvements:
- AR0234 improved AE smoothness, increased max gain to 400x (first 25.6x analog),
- OV9782 on RGB/CAM-A socket max FPS: 120 (previously was only for OV9282), also improves image quality in very bright light,
- OV9782/9282 minimum exposure time decreased: 20us -> 10us, helps in very bright light. TODO update tuning to make use of it, currently only possible to use with manual exposure

* Update stereo_depth_video.cpp

* Enable interrupt mode: Update BMI driver with fixes from: boschsensortec/BMI270_SensorAPI#16

* Update ObjectTracker with improvements from rvc3

* Add API to set trackingPerClass in ObjectTracker node

* Update FW before merge

* Update FW with IMU fix for BNO

* Add IMU versioning; firmware versioning, firmware update status callbacks

* Update FW with fix for BMI timestamp

* Update FW: IMU support for OAK-D-SR

* Fix 'default constrictible' error on some compilers

* Update FW

* Add IMU FW update RPC

* Updated yolo description

* Update examples

* Update FW with deprecation warning for enableFirmwareUpdate

* Change imu version to imu type

* Update FW before merge

* Added C++14 requirement to examples & tests

* Tweaked crash_report example

* [FW] Added missing bindings for CameraControl and ImgFrame

* Update FW with fix for calibration load example

* fix stability_stress_test fail to link on ubuntu

- fixes #769

* fix isClosed/checkClosed threading, rpcClient exceptions

- remove thread-unsafe checkClosed()
- update isClosed() doxygen + comments
- protect DataInputQueue::maxDataSize with std::atomic
- remove unused dai::DeviceBase::rpcStream
- fixes #520

* fix var hides class member, this-> in constructors

- fix few compile warn 'ex' unreferenced local variable
- rename setBusId() param to not hide class member
- refactor XLinkConnection constructors
- partial fix #247

* fix: stdexcept header added for std::runtime_error

Signed-off-by: Onuralp SEZER <thunderbirdtr@fedoraproject.org>

* [FW] Removed UTF-8 degree sign from temperature prints. Closes: #773

* Move sipp buffer size from BoardConfig to GlobalProperties

* Update style

* Partially reverted bce1444 - only kept the C++14 specified in examples, tests already had the version specified

* [Stereo] Add option to invalidate edge pixels on disparity/depth frame

* Update FW: handle disparity flipping

* Update FW: support for stereo.setOutputSize when LEFT or RIGHT alignment is set

* Update FW: support for stereo between RGB and LEFT/RIGHT

* [FW] ImageManip CSC improvements, New boards and power cycle fix

* FW: fix for UART0 / '/dev/ttyS0' init failure in Script node

* Update FW with fix for USB devices stuck after reboot

* Release v2.21.0

* updated version and changelot

* removed merge missing functions

---------

Signed-off-by: Onuralp SEZER <thunderbirdtr@fedoraproject.org>
Co-authored-by: alex-luxonis <alex@luxonis.com>
Co-authored-by: alex-luxonis <60824841+alex-luxonis@users.noreply.github.com>
Co-authored-by: TheMarpe <martin.peterlin7@gmail.com>
Co-authored-by: SzabolcsGergely <szabi@luxonis.com>
Co-authored-by: szabi-luxonis <60790666+szabi-luxonis@users.noreply.github.com>
Co-authored-by: moratom <47612463+moratom@users.noreply.github.com>
Co-authored-by: Matevz Morato <matevz.morato@gmail.com>
Co-authored-by: camblomquist <cameron@blomqu.ist>
Co-authored-by: Tommy <tomprochazka0@gmail.com>
Co-authored-by: Dale Phurrough <dale@hidale.com>
Co-authored-by: Erol444 <erol123444@gmail.com>
Co-authored-by: Cameron Blomquist <cblomquist@lsa2.com>
Co-authored-by: anonymous-1000 <124404305+anonymous-1000@users.noreply.github.com>
Co-authored-by: TheMarpe <martin@luxonis.com>
Co-authored-by: Onuralp SEZER <thunderbirdtr@fedoraproject.org>
saching13 added a commit that referenced this issue Apr 6, 2023
* Closes: #355

* Bump version to 2.18.0

* Updated FW with some Color/MonoCamera fixes

* stability test

* Update FW:
- fix for high system load crash, especially on PoE devices
- for for OV9282 as MonoCamera on RGB/CAM_A socket

* FW: OV9282 720p/800p max FPS: 60 -> 120

* stability test

* Added a convinience setTimesync function

* Added isUserBootloaderSupported to DeviceBootloader

* Updated XLink with Windows improvements when scanning for already booted USB devices

* Updated FW with device time reset on boot

* Bump to v2.19.0

* Improved wording on unavailable devices

* Fix yolo v5 decoding when there is a single class

* FW: fixes for certain OV9782 and OV9282 permutations/configs,
fix for OV9782/OV9282 alone failing on RGB/CAM_A socket

* Update CI to Node16 compatible actions

* Update FW: fix image size when decimation filter is enabled

* Stability test - limit FPS (#633)

* Print CPU usage

* Limit the FPS so POE devices aren't maxed out

* Increase FPS

* Reverse changes to the system logger example

Co-authored-by: TheMarpe <martin.peterlin7@gmail.com>
Co-authored-by: Matevz Morato <matevz.morato@gmail.com>

* Added getProductName

* Added ids to IO for trace events

* Modified pipeline schema dump to happen on trace log level as well

* Renamed to getDeviceName and added some legacy handling

* Updated FW with productName as protected field and ImageManip behavior revert

* Updated style

* Added IR driver support for new OAK-FFC 4P

* FW: bugfix for device bootup with default static IP

* OAK-FFC 4P R5M1E5 IR/Dot support

* Bump to v2.19.1

* Added EepromError exception class and improved exception handling in calibration related methods

* Increased limit on DeviceBootloader monitor timeout

* Fixed check for user-provided toolchain file when given relative path (#645)

* Fixed check for user-provided toolchain file when given relative path

* WIP: camera/socket board configuration and capability to specify name/alias for a camera instead of socket

* Updated Bootloader to v0.0.22

* Added camera naming capabilites, setting and retrieving. WIP: rest of devices

* FW/CameraControl: fix still-capture for sockets other than RGB/center

* [FW] Fixed ImageManip + Subpixel issues and added FFC camera naming

* get/set camera FrameEvent filter

* Update depthai-shared submodule

* Disable depthai-shared commit hash check

* Change github workflows ubuntu version

* Update submodule

* Rename event filter

* fix #650 missing XLinkProtocolToStr() (#657)

- add local xlinkproto -> string from
  luxonis/XLink/tree/5c61615066af6539e50a4a17b5df3466e4350b21

* Updated grammar

* Update firmware

* WIP: Camera node

* Added capability to set XLink logging level via XLINK_LEVEL env var

* Replace "_CMAKE_" variables with "_DEPTHAI_" (#662)

"_CMAKE_" variables are reserved for internal use and should not be used.
This change also makes it harder for other CMake scripts to accidentall overwrite this variable.

Co-authored-by: Cameron Blomquist <cblomquist@lsa2.com>

* Add comments

* Update FW: Add missing python bindings for boundingBoxMapping

* Updated NETWORK Bootloader with dual protocol capabilities

* [FW] Fixed a bug in board downselection. OAK-D S2/Pro camera enumeration fix.

* [FW] Added support for Mono video/preview in Camera node

* CI - Fixed style & tidy jobs

* Updated dual BL to v0.0.23 temporary build

* Added OAK-D-LR support. WIP: Orientation capability

* [FW/XLink] Explicitly limited to single connection

* ImageManip added colormap capability. TODO min/max range selection

* Add option to override baseline and/or focal length for disparity to depth conversion

* [FW] OAK-D-LR - Fixed default image orientation

* Updated brief description that affects docs of the DetectionParser node.

* Modified API of Camera a bit

* Updated FW with Camera changes and warp capabilities

* Updated FW with Camera warp capabilities

* Added dai::span

* Added undistort/warp API to Camera node

* FW - Modifed watchdog to do a graceful reset instead

* Added additional API to retrieve timestamps at various exposure points

* Fixed documentation on ObjectTracker::setMaxObjectsToTrack

* WIP: mockIsp capabilities

* [FW] Fix for CAM_C not being detected

* Device - Added non exclusive boot option

* Slight Colormap API improvements

* [FW] Added OpenVINO version 'universal'

* Added DeviceBase convinience constructors taking name or deviceid as string

* Add mode and median support to SLC

* Disabled some of the functionality for now

* Tweaked getTimestamp & exposure offset API

* FW: IMX296 support, added THE_1440x1080 resolution

* FW: IMX296 Camera node, IMX378 1080p limited to 60fps

* Bump version to 2.20.0

* Applied formatting

* Temporary revert to macos-11 for CI due to Catch2 issues

* Update FW, API

* Update FW

* Modified OpenVINO::VERSION_UNIVERSAL

* Updated Bootloader to 0.0.24

* Bump version and FW to 2.20.1 (Status LEDs improvement)

* calibration_flash example fix

* Fixed api docs for Warp HW ids

* FW: fix crash with ColorCamera at high resolution and certain ISP scaling

* FW: fix crash with ColorCamera at high resolution and certain ISP scaling

* Bump version to 2.20.2

* Added an ColorCamera isp scale example, and modified test workflow

* Implement multi stereo support

* Implement brightness filter

* FW: fix OV9282 SW-sync on devices with OV9782 RGB camera

* Update FW: Fix OOM due to too many SIPP pipelines

* Modified default device config OpenVINO version to universal

* Merge branch 'catch2_update'

* FW: handle EEPROM `boardOptions` bit 7 for separate I2C on L/R

* FW: fix for IMX378/477/577 on sockets other than RGB

* Update FW: support for stereo alignment to original left or right inputs; OOM fix for 4 stereo nodes with median filter

* Update FW: parsing optimization and improvements for Yolo v6, v6r2, v8

* Update FW w/ syncing stall fix

* Update stereo with more robust frame sync

* Update FW with optional override of spec translation for stereo algorithm calculations

* Correct type

* Update SPIOut.hpp

to address error C4458: declaration of 'id' hides class member

* Expose center alignment scale factor for debug purposes

* Expose SIPP mempool configurable sizes

* Update FW

* Fixed usage of DeviceBootloader with incomplete DeviceInfo and added a convinience constructor

* Closes: #714

* Add alpha scaling option for StereoDepth

* Update FW before merge

* Update FW with RGB alignment fix

* Update FW with performance metrics when DEPTHAI_LEVEL=info is enabled; enable brightness filter for 0 intensity pixels by default

* Improve spatial calculation X and Y accuracy; fix RGB alignment when custom output depth size is specified

* [XLink] Increased max number of links from 32 to 64

* Add crash dump functionality

* Change API to return just crash dump

* Update FW with commit hash attached to crash dump

* Update FW with fix for serialization of thread name

* Add hasCrashDump API

* Update FW

* Update FW, crash dump contains device ID

* Enable MEDAIN spatial calculation method for SpatialDetectionNetwork

* Update FW

* Update docs

* FW: HW sync (trigger mode) enabled for OAK-D-LR, for cameras with matching FPS

* Change default SIPP buffer sizes

* Add 3A skipping option to reduce CPU usage

* Change API to be able to configure isp 3A FPS

* Update BoarConfig with limits

* Update script node python bindings

* Update FW: Add workaround for BNO sequence number limit of 256 (sensors sends uint8)

* FW: camera sensor improvements:
- AR0234 improved AE smoothness, increased max gain to 400x (first 25.6x analog),
- OV9782 on RGB/CAM-A socket max FPS: 120 (previously was only for OV9282), also improves image quality in very bright light,
- OV9782/9282 minimum exposure time decreased: 20us -> 10us, helps in very bright light. TODO update tuning to make use of it, currently only possible to use with manual exposure

* Update stereo_depth_video.cpp

* Enable interrupt mode: Update BMI driver with fixes from: boschsensortec/BMI270_SensorAPI#16

* Update ObjectTracker with improvements from rvc3

* Add API to set trackingPerClass in ObjectTracker node

* Update FW before merge

* Update FW with IMU fix for BNO

* Add IMU versioning; firmware versioning, firmware update status callbacks

* Update FW with fix for BMI timestamp

* Update FW: IMU support for OAK-D-SR

* Fix 'default constrictible' error on some compilers

* Update FW

* Add IMU FW update RPC

* Updated yolo description

* Update examples

* Update FW with deprecation warning for enableFirmwareUpdate

* Change imu version to imu type

* Update FW before merge

* Added C++14 requirement to examples & tests

* Tweaked crash_report example

* [FW] Added missing bindings for CameraControl and ImgFrame

* Update FW with fix for calibration load example

* fix stability_stress_test fail to link on ubuntu

- fixes #769

* fix isClosed/checkClosed threading, rpcClient exceptions

- remove thread-unsafe checkClosed()
- update isClosed() doxygen + comments
- protect DataInputQueue::maxDataSize with std::atomic
- remove unused dai::DeviceBase::rpcStream
- fixes #520

* fix var hides class member, this-> in constructors

- fix few compile warn 'ex' unreferenced local variable
- rename setBusId() param to not hide class member
- refactor XLinkConnection constructors
- partial fix #247

* fix: stdexcept header added for std::runtime_error

Signed-off-by: Onuralp SEZER <thunderbirdtr@fedoraproject.org>

* [FW] Removed UTF-8 degree sign from temperature prints. Closes: #773

* Move sipp buffer size from BoardConfig to GlobalProperties

* Update style

* Partially reverted bce1444 - only kept the C++14 specified in examples, tests already had the version specified

* [Stereo] Add option to invalidate edge pixels on disparity/depth frame

* Update FW: handle disparity flipping

* Update FW: support for stereo.setOutputSize when LEFT or RIGHT alignment is set

* Update FW: support for stereo between RGB and LEFT/RIGHT

* [FW] ImageManip CSC improvements, New boards and power cycle fix

* FW: fix for UART0 / '/dev/ttyS0' init failure in Script node

* Update FW with fix for USB devices stuck after reboot

* Release v2.21.0

* Fix device destructor

* Update FW: fix spatial location calculator for 400p/480p resolution

* Release v2.21.1

* FW: Fix camera intrinsics when RGB alignment is used

* Release v2.21.2

* update changelog and package version

---------

Signed-off-by: Onuralp SEZER <thunderbirdtr@fedoraproject.org>
Co-authored-by: TheMarpe <martin.peterlin7@gmail.com>
Co-authored-by: SzabolcsGergely <szabi@luxonis.com>
Co-authored-by: alex-luxonis <alex@luxonis.com>
Co-authored-by: szabi-luxonis <60790666+szabi-luxonis@users.noreply.github.com>
Co-authored-by: moratom <47612463+moratom@users.noreply.github.com>
Co-authored-by: Matevz Morato <matevz.morato@gmail.com>
Co-authored-by: camblomquist <cameron@blomqu.ist>
Co-authored-by: Tommy <tomprochazka0@gmail.com>
Co-authored-by: Dale Phurrough <dale@hidale.com>
Co-authored-by: Erol444 <erol123444@gmail.com>
Co-authored-by: Cameron Blomquist <cblomquist@lsa2.com>
Co-authored-by: anonymous-1000 <124404305+anonymous-1000@users.noreply.github.com>
Co-authored-by: TheMarpe <martin@luxonis.com>
Co-authored-by: Onuralp SEZER <thunderbirdtr@fedoraproject.org>
diablodale added a commit to diablodale/depthai-core that referenced this issue Apr 24, 2023
- revert more closed locking behavior luxonis#520
diablodale added a commit to diablodale/depthai-core that referenced this issue May 10, 2023
diablodale added a commit to diablodale/depthai-core that referenced this issue May 11, 2023
diablodale added a commit to diablodale/depthai-core that referenced this issue May 16, 2023
saching13 added a commit that referenced this issue Jun 15, 2023
* WIP: Camera node

* Added capability to set XLink logging level via XLINK_LEVEL env var

* Replace "_CMAKE_" variables with "_DEPTHAI_" (#662)

"_CMAKE_" variables are reserved for internal use and should not be used.
This change also makes it harder for other CMake scripts to accidentall overwrite this variable.

Co-authored-by: Cameron Blomquist <cblomquist@lsa2.com>

* Add comments

* Update FW: Add missing python bindings for boundingBoxMapping

* Updated NETWORK Bootloader with dual protocol capabilities

* [FW] Fixed a bug in board downselection. OAK-D S2/Pro camera enumeration fix.

* [FW] Added support for Mono video/preview in Camera node

* CI - Fixed style & tidy jobs

* Updated dual BL to v0.0.23 temporary build

* Added OAK-D-LR support. WIP: Orientation capability

* [FW/XLink] Explicitly limited to single connection

* ImageManip added colormap capability. TODO min/max range selection

* Add option to override baseline and/or focal length for disparity to depth conversion

* [FW] OAK-D-LR - Fixed default image orientation

* Updated brief description that affects docs of the DetectionParser node.

* Modified API of Camera a bit

* Updated FW with Camera changes and warp capabilities

* Updated FW with Camera warp capabilities

* Added dai::span

* Added undistort/warp API to Camera node

* FW - Modifed watchdog to do a graceful reset instead

* Added additional API to retrieve timestamps at various exposure points

* Fixed documentation on ObjectTracker::setMaxObjectsToTrack

* WIP: mockIsp capabilities

* [FW] Fix for CAM_C not being detected

* Device - Added non exclusive boot option

* Slight Colormap API improvements

* [FW] Added OpenVINO version 'universal'

* Added DeviceBase convinience constructors taking name or deviceid as string

* Add mode and median support to SLC

* Disabled some of the functionality for now

* Tweaked getTimestamp & exposure offset API

* FW: IMX296 support, added THE_1440x1080 resolution

* FW: IMX296 Camera node, IMX378 1080p limited to 60fps

* Bump version to 2.20.0

* Applied formatting

* Temporary revert to macos-11 for CI due to Catch2 issues

* Update FW, API

* Update FW

* Modified OpenVINO::VERSION_UNIVERSAL

* Updated Bootloader to 0.0.24

* Bump version and FW to 2.20.1 (Status LEDs improvement)

* calibration_flash example fix

* Fixed api docs for Warp HW ids

* FW: fix crash with ColorCamera at high resolution and certain ISP scaling

* FW: fix crash with ColorCamera at high resolution and certain ISP scaling

* Bump version to 2.20.2

* Added an ColorCamera isp scale example, and modified test workflow

* Implement multi stereo support

* Implement brightness filter

* FW: fix OV9282 SW-sync on devices with OV9782 RGB camera

* Update FW: Fix OOM due to too many SIPP pipelines

* Modified default device config OpenVINO version to universal

* Merge branch 'catch2_update'

* FW: handle EEPROM `boardOptions` bit 7 for separate I2C on L/R

* FW: fix for IMX378/477/577 on sockets other than RGB

* Update FW: support for stereo alignment to original left or right inputs; OOM fix for 4 stereo nodes with median filter

* Update FW: parsing optimization and improvements for Yolo v6, v6r2, v8

* Update FW w/ syncing stall fix

* Update stereo with more robust frame sync

* Update FW with optional override of spec translation for stereo algorithm calculations

* Correct type

* Update SPIOut.hpp

to address error C4458: declaration of 'id' hides class member

* Expose center alignment scale factor for debug purposes

* Expose SIPP mempool configurable sizes

* Update FW

* Fixed usage of DeviceBootloader with incomplete DeviceInfo and added a convinience constructor

* Closes: #714

* Add alpha scaling option for StereoDepth

* Update FW before merge

* Update FW with RGB alignment fix

* Update FW with performance metrics when DEPTHAI_LEVEL=info is enabled; enable brightness filter for 0 intensity pixels by default

* Improve spatial calculation X and Y accuracy; fix RGB alignment when custom output depth size is specified

* [XLink] Increased max number of links from 32 to 64

* Add crash dump functionality

* Change API to return just crash dump

* Update FW with commit hash attached to crash dump

* Update FW with fix for serialization of thread name

* Add hasCrashDump API

* Update FW

* Update FW, crash dump contains device ID

* Enable MEDAIN spatial calculation method for SpatialDetectionNetwork

* Update FW

* Update docs

* FW: HW sync (trigger mode) enabled for OAK-D-LR, for cameras with matching FPS

* Change default SIPP buffer sizes

* Add 3A skipping option to reduce CPU usage

* Change API to be able to configure isp 3A FPS

* Update BoarConfig with limits

* Update script node python bindings

* Update FW: Add workaround for BNO sequence number limit of 256 (sensors sends uint8)

* FW: camera sensor improvements:
- AR0234 improved AE smoothness, increased max gain to 400x (first 25.6x analog),
- OV9782 on RGB/CAM-A socket max FPS: 120 (previously was only for OV9282), also improves image quality in very bright light,
- OV9782/9282 minimum exposure time decreased: 20us -> 10us, helps in very bright light. TODO update tuning to make use of it, currently only possible to use with manual exposure

* Update stereo_depth_video.cpp

* Enable interrupt mode: Update BMI driver with fixes from: boschsensortec/BMI270_SensorAPI#16

* Update ObjectTracker with improvements from rvc3

* Add API to set trackingPerClass in ObjectTracker node

* Update FW before merge

* Update FW with IMU fix for BNO

* Add IMU versioning; firmware versioning, firmware update status callbacks

* Update FW with fix for BMI timestamp

* Update FW: IMU support for OAK-D-SR

* Fix 'default constrictible' error on some compilers

* Update FW

* Add IMU FW update RPC

* Updated yolo description

* Update examples

* Update FW with deprecation warning for enableFirmwareUpdate

* Change imu version to imu type

* Update FW before merge

* Added C++14 requirement to examples & tests

* Tweaked crash_report example

* [FW] Added missing bindings for CameraControl and ImgFrame

* Update FW with fix for calibration load example

* fix stability_stress_test fail to link on ubuntu

- fixes #769

* fix isClosed/checkClosed threading, rpcClient exceptions

- remove thread-unsafe checkClosed()
- update isClosed() doxygen + comments
- protect DataInputQueue::maxDataSize with std::atomic
- remove unused dai::DeviceBase::rpcStream
- fixes #520

* fix var hides class member, this-> in constructors

- fix few compile warn 'ex' unreferenced local variable
- rename setBusId() param to not hide class member
- refactor XLinkConnection constructors
- partial fix #247

* fix: stdexcept header added for std::runtime_error

Signed-off-by: Onuralp SEZER <thunderbirdtr@fedoraproject.org>

* [FW] Removed UTF-8 degree sign from temperature prints. Closes: #773

* Move sipp buffer size from BoardConfig to GlobalProperties

* Update style

* Partially reverted bce1444 - only kept the C++14 specified in examples, tests already had the version specified

* [Stereo] Add option to invalidate edge pixels on disparity/depth frame

* Update FW: handle disparity flipping

* Update FW: support for stereo.setOutputSize when LEFT or RIGHT alignment is set

* Update FW: support for stereo between RGB and LEFT/RIGHT

* [FW] ImageManip CSC improvements, New boards and power cycle fix

* FW: fix for UART0 / '/dev/ttyS0' init failure in Script node

* Update FW with fix for USB devices stuck after reboot

* Release v2.21.0

* Fix device destructor

* Update FW: fix spatial location calculator for 400p/480p resolution

* Release v2.21.1

* FW: Fix camera intrinsics when RGB alignment is used

* Release v2.21.2

* FW: fix running 4 cameras with Ethernet,
4th cam enabled didn't stream due to device memory allocation

* prevent duplicate xlink stream names

- fixes #469
- add test case

* [FW] Fix for OAK-D-SR camera enumeration

* [FW] OAK-D-LR R1 preparation

* [FW / BL] Updated both FW & BL for OAK-D-LR R1. ETH fixes and moved to BNO086 IMU.

* [BL] Updated to 0.0.25 release

* Deprecated misleading board socket aliases

* [FW] Match shared

* Tweaked naming a bit more

* WIP: Refactoring constructors

* Added 2 additional board socket enums

* Removed ;

* Updated FW and fixed Device constructors

* Added more checks when parsing message and a test

* Add get/set to all config messages

* Refactored logging to use device logger and capability to modify log levels for a specific device

* Added custom spdlog logger library usage and exposed profiling data globally and per device

* Updated XLink with new functionality and increased PoE search time

* Added means of grabbing global profiling data as well

* Updated XLink with 255.255.255.255 discovery added

* Applied formatting

* [Stereo] Fix auto distortion correction for 400p

* [Stereo] Fix temporal filter crash on startup

* Add missing info log level

* Logging: fixed `DEPTHAI_DEBUG=1` causing a crash at init,
`__gnu_cxx::recursive_init_error` exception due to `logger::get_level()` call

* CrashDump: add optional clear of crash dump, enabled by default

* Color/Mono/Camera: add `setRawOutputPacked` config
-- cherry-picked, FW and shared updated in upcoming commit

* ImgFrame: handle RAW10/12/14 (unpacked) like RAW16

* ToF node with ToFConfig
-- cherry-picked and squashed

* `make clangformat`

* FW: UVC: H.264 with `ImgFrame::Type::BITSTREAM`, few more config checks

* Device: fix some constructors to forward pipeline DeviceConfig

* Modified XLink to a temporary branch

* Updated XLink with fixed winusb mxid retrieval

* FW: Stereo: handle queue blocking settings

* [FW] Updated for some devices and ToF

* Added filter by device name

* [FW] WIP for S2 PoE boards

* [FW] WIP for new SoMs

* Fixed build

* [FW] Fixed camera orientation

* Bump version to v2.22.0

* FW: update IMX296 tuning

* [FW] Fixed OAK-D-SR and OV9782 issues

* updated the version in package.xml

* updated the changelog

* merge bugs fix

---------

Signed-off-by: Onuralp SEZER <thunderbirdtr@fedoraproject.org>
Co-authored-by: moratom <47612463+moratom@users.noreply.github.com>
Co-authored-by: Martin Peterlin <martin.peterlin7@gmail.com>
Co-authored-by: camblomquist <cameron@blomqu.ist>
Co-authored-by: Cameron Blomquist <cblomquist@lsa2.com>
Co-authored-by: Tommy <tomprochazka0@gmail.com>
Co-authored-by: SzabolcsGergely <szabi@luxonis.com>
Co-authored-by: Erol444 <erol123444@gmail.com>
Co-authored-by: szabi-luxonis <60790666+szabi-luxonis@users.noreply.github.com>
Co-authored-by: alex-luxonis <alex@luxonis.com>
Co-authored-by: anonymous-1000 <124404305+anonymous-1000@users.noreply.github.com>
Co-authored-by: TheMarpe <martin@luxonis.com>
Co-authored-by: Dale Phurrough <dale@hidale.com>
Co-authored-by: Onuralp SEZER <thunderbirdtr@fedoraproject.org>
Co-authored-by: Florin Buica <florin.buica@luxonis.com>
Co-authored-by: alex-luxonis <60824841+alex-luxonis@users.noreply.github.com>
saching13 added a commit that referenced this issue Nov 15, 2023
* Update FW w/ syncing stall fix

* Update stereo with more robust frame sync

* Update FW with optional override of spec translation for stereo algorithm calculations

* Correct type

* Update SPIOut.hpp

to address error C4458: declaration of 'id' hides class member

* Expose center alignment scale factor for debug purposes

* Expose SIPP mempool configurable sizes

* Update FW

* Fixed usage of DeviceBootloader with incomplete DeviceInfo and added a convinience constructor

* Closes: #714

* Add alpha scaling option for StereoDepth

* Update FW before merge

* Update FW with RGB alignment fix

* Update FW with performance metrics when DEPTHAI_LEVEL=info is enabled; enable brightness filter for 0 intensity pixels by default

* Improve spatial calculation X and Y accuracy; fix RGB alignment when custom output depth size is specified

* [XLink] Increased max number of links from 32 to 64

* Add crash dump functionality

* Change API to return just crash dump

* Update FW with commit hash attached to crash dump

* Update FW with fix for serialization of thread name

* Add hasCrashDump API

* Update FW

* Update FW, crash dump contains device ID

* Enable MEDAIN spatial calculation method for SpatialDetectionNetwork

* Update FW

* Update docs

* FW: HW sync (trigger mode) enabled for OAK-D-LR, for cameras with matching FPS

* Change default SIPP buffer sizes

* Add 3A skipping option to reduce CPU usage

* Change API to be able to configure isp 3A FPS

* Update BoarConfig with limits

* Update script node python bindings

* Update FW: Add workaround for BNO sequence number limit of 256 (sensors sends uint8)

* FW: camera sensor improvements:
- AR0234 improved AE smoothness, increased max gain to 400x (first 25.6x analog),
- OV9782 on RGB/CAM-A socket max FPS: 120 (previously was only for OV9282), also improves image quality in very bright light,
- OV9782/9282 minimum exposure time decreased: 20us -> 10us, helps in very bright light. TODO update tuning to make use of it, currently only possible to use with manual exposure

* Update stereo_depth_video.cpp

* Enable interrupt mode: Update BMI driver with fixes from: boschsensortec/BMI270_SensorAPI#16

* Update ObjectTracker with improvements from rvc3

* Add API to set trackingPerClass in ObjectTracker node

* Update FW before merge

* Update FW with IMU fix for BNO

* Add IMU versioning; firmware versioning, firmware update status callbacks

* Update FW with fix for BMI timestamp

* Update FW: IMU support for OAK-D-SR

* Fix 'default constrictible' error on some compilers

* Update FW

* Add IMU FW update RPC

* Updated yolo description

* Update examples

* Update FW with deprecation warning for enableFirmwareUpdate

* Change imu version to imu type

* Update FW before merge

* Added C++14 requirement to examples & tests

* Tweaked crash_report example

* [FW] Added missing bindings for CameraControl and ImgFrame

* Update FW with fix for calibration load example

* fix stability_stress_test fail to link on ubuntu

- fixes #769

* fix isClosed/checkClosed threading, rpcClient exceptions

- remove thread-unsafe checkClosed()
- update isClosed() doxygen + comments
- protect DataInputQueue::maxDataSize with std::atomic
- remove unused dai::DeviceBase::rpcStream
- fixes #520

* fix var hides class member, this-> in constructors

- fix few compile warn 'ex' unreferenced local variable
- rename setBusId() param to not hide class member
- refactor XLinkConnection constructors
- partial fix #247

* fix: stdexcept header added for std::runtime_error

Signed-off-by: Onuralp SEZER <thunderbirdtr@fedoraproject.org>

* [FW] Removed UTF-8 degree sign from temperature prints. Closes: #773

* Move sipp buffer size from BoardConfig to GlobalProperties

* Update style

* Partially reverted bce1444 - only kept the C++14 specified in examples, tests already had the version specified

* [Stereo] Add option to invalidate edge pixels on disparity/depth frame

* Update FW: handle disparity flipping

* Update FW: support for stereo.setOutputSize when LEFT or RIGHT alignment is set

* Update FW: support for stereo between RGB and LEFT/RIGHT

* [FW] ImageManip CSC improvements, New boards and power cycle fix

* Update FW: support for configurable ImageManip interpolation type

* FW: fix for UART0 / '/dev/ttyS0' init failure in Script node

* Update API to use dai::Interpolation

* Update FW with latest develop fixes

* Update FW with fix for USB devices stuck after reboot

* Update shared

* Release v2.21.0

* Fix device destructor

* Update FW: fix spatial location calculator for 400p/480p resolution

* Release v2.21.1

* FW: Fix camera intrinsics when RGB alignment is used

* Release v2.21.2

* FW: fix running 4 cameras with Ethernet,
4th cam enabled didn't stream due to device memory allocation

* prevent duplicate xlink stream names

- fixes #469
- add test case

* [FW] Fix for OAK-D-SR camera enumeration

* [FW] OAK-D-LR R1 preparation

* [FW / BL] Updated both FW & BL for OAK-D-LR R1. ETH fixes and moved to BNO086 IMU.

* [BL] Updated to 0.0.25 release

* Deprecated misleading board socket aliases

* [FW] Match shared

* Tweaked naming a bit more

* WIP: Refactoring constructors

* Added 2 additional board socket enums

* Removed ;

* Updated FW and fixed Device constructors

* Added more checks when parsing message and a test

* Add get/set to all config messages

* Refactored logging to use device logger and capability to modify log levels for a specific device

* Added custom spdlog logger library usage and exposed profiling data globally and per device

* Updated XLink with new functionality and increased PoE search time

* Added means of grabbing global profiling data as well

* Updated XLink with 255.255.255.255 discovery added

* Applied formatting

* [Stereo] Fix auto distortion correction for 400p

* [Stereo] Fix temporal filter crash on startup

* Add missing info log level

* Logging: fixed `DEPTHAI_DEBUG=1` causing a crash at init,
`__gnu_cxx::recursive_init_error` exception due to `logger::get_level()` call

* CrashDump: add optional clear of crash dump, enabled by default

* Color/Mono/Camera: add `setRawOutputPacked` config
-- cherry-picked, FW and shared updated in upcoming commit

* ImgFrame: handle RAW10/12/14 (unpacked) like RAW16

* ToF node with ToFConfig
-- cherry-picked and squashed

* `make clangformat`

* FW: UVC: H.264 with `ImgFrame::Type::BITSTREAM`, few more config checks

* Device: fix some constructors to forward pipeline DeviceConfig

* Modified XLink to a temporary branch

* Updated XLink with fixed winusb mxid retrieval

* FW: Stereo: handle queue blocking settings

* [FW] Updated for some devices and ToF

* Added filter by device name

* [FW] WIP for S2 PoE boards

* [FW] WIP for new SoMs

* Fixed build

* [FW] Fixed camera orientation

* Add example for read calibration in script node

* Bump version to v2.22.0

* Add to cmake and fix errors

* FW: update IMX296 tuning

* [FW] Fixed OAK-D-SR and OV9782 issues

* Change printf to node.info in script node read calibration example

* ToF: Add median filter support

* Update FW to latest develop

* FW: Stereo: Apply alpha scaling parameter to RGB intrinsics when RGB alignment is enabled

* FW: fix CAM_D enumeration on OAK-FFC-4P R7

* Camera: move alpha parameter as optional to be consistent with stereo

* Update FW

* BMI: Fix accumulating latency due to slow xlink read

* Fix constructors overriding maxUsbSpeed

* hasAutofocus fix based on device name/lensPosition

* WIP: Device name improvements

* Added improvements to device naming

* Fixed device related logging

* Moved ts, tsDevice, and sequenceNum from descendants to RawBuffer

* Added getters and setters

* z_map for tof

* ts to tsDevice fix

* Updated ColorCamera's setSensorCrop comment for documentation

* Removed redundant getters and setters

* FW: add support for OAK-D-SR-PoE R1M1E1

* Fixed mistake in ImgFrame

* Ran ClangFormat

* Added DEPTHAI_ENABLE_LIBUSB option, to enable/disable USB protocol in build time

* Applied style

* Updated XLink library with some fixes

* FW: fix default fsync on OAK-D-SR-PoE. GPIO46 input by default

* hasautofocusIC

* FW: fix 4 cams crash on PoE due to memory allocation

* Update FW / shared

* FW: fix OAK-D-SR camera enum. IMX296 updates:
- support for RPi GS Cam paired with Luxonis SL6996 RPi camera adapter
- support for external trigger on XTR/XTRIG pin: active low, pulse width determines exposure time. Limitation:
needs an initial trigger shortly after start to avoid a crash, or `DEPTHAI_WATCHDOG=0` can be a workaround

* Attempt to fix serialization error on windows compiler

* Update FW

* Implemented timesync optimization

* Fixed new timesync bugs

* Moved treceive back to XLink

* Changes according to PR issue

* Clangformat

* Bump FW

* WIP: Device name improvements

* Added improvements to device naming

* FIXME: does not work on rpi

* Updated FW with changes

* Bump shared

* Fixed compiler error

* Changed struct timespec to custom struct to fix RPI size issues

* Bump shared

* FW, ColorCamera: add new almost-full-FOV resolutions for IMX378/477, scaled:
1352x1012, 4lane-only, 1/3 scaling
2024x1520, 1/2 binning

* Fixed incorrect warp in issue #882

* [FW] OAK-D SR PoE and ToF improvements

* [FW] Improved OV9782 fps handling

* Updated FW & XLink with backward compatible timestamping

* FW: fixes for AR0234 fsync, AR0234 AE max exposure: 16->33 ms,
more robust camera handling (especially in sync modes)

* fixed the order of translation multiplication

* clang update

* [FW] deviceName fixes and updated for EepromData changes

* Increased num XLink connections to 64

* Bumped num XLink connections to 64

* Update README.md

* Update changelog and package xml

* removed merge dubpicate

---------

Signed-off-by: Onuralp SEZER <thunderbirdtr@fedoraproject.org>
Co-authored-by: SzabolcsGergely <szabi@luxonis.com>
Co-authored-by: anonymous-1000 <124404305+anonymous-1000@users.noreply.github.com>
Co-authored-by: TheMarpe <martin@luxonis.com>
Co-authored-by: TheMarpe <martin.peterlin7@gmail.com>
Co-authored-by: alex-luxonis <alex@luxonis.com>
Co-authored-by: Erol444 <erol123444@gmail.com>
Co-authored-by: szabi-luxonis <60790666+szabi-luxonis@users.noreply.github.com>
Co-authored-by: Dale Phurrough <dale@hidale.com>
Co-authored-by: Onuralp SEZER <thunderbirdtr@fedoraproject.org>
Co-authored-by: Florin Buica <florin.buica@luxonis.com>
Co-authored-by: alex-luxonis <60824841+alex-luxonis@users.noreply.github.com>
Co-authored-by: Andrej Susnik <andrej.susnik@luxonis.com>
Co-authored-by: Aniel Alexa <aniel.alexa@luxonis.com>
Co-authored-by: AnielAlexa <139551403+AnielAlexa@users.noreply.github.com>
Co-authored-by: asahtik <asahtik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants