I’m on Linux (Ubuntu) and I’m using the latest beta OrbbecSDK 1.1.6 and working with an Astra+ camera. My app is written in C++.
TL;DR : I get a lot of warnings and errors while using 2 or more streams (Depth + [IR/RGB]), those are written on disks and take a lot of space. I’m looking for a kind-of-clean way to not have them written on disk (or fix whatever if triggering them ideally).
I noticed that the SDK spits out a lot of warnings and errors when I try to use multiple stream types. If I only use the depth stream I only get low logging activity, which is fine. But if I run a Pipeline with Depth AND IR streams I get a ton of warning and error logs (see below for a sample output).
W20220225 12:21:27.224937 1962276 Pipeline.cpp:284] Pipeline::Depth Frame is nullptr E20220225 12:21:27.229285 1962276 Pipeline.cpp:301] ir Frame is nullptr W20220225 12:21:27.258239 1962276 Pipeline.cpp:284] Pipeline::Depth Frame is nullptr E20220225 12:21:27.262522 1962276 Pipeline.cpp:301] ir Frame is nullptr W20220225 12:21:27.291586 1962276 Pipeline.cpp:284] Pipeline::Depth Frame is nullptr E20220225 12:21:27.296144 1962276 Pipeline.cpp:301] ir Frame is nullptr W20220225 12:21:27.324906 1962276 Pipeline.cpp:284] Pipeline::Depth Frame is nullptr E20220225 12:21:27.329535 1962276 Pipeline.cpp:301] ir Frame is nullptr
Despite all those logs, it seems that my application is working fine, I get the expected framerate and I can use both stream’s data. But all this logging is taking up a lot of space if the app is left running, which is needed in my case.
Ideally I would like to fix whatever is triggering those warnings and errors. If any developer that has access to the .cpp sources can give me a clue about what could be triggering those logs it would be great.
Other options I explored:
A quick and dirty solution is to create a “Log” symlink next to the app’s binary pointing to /dev/null, so that the app will no be able to write to any file in it. The sdk says that it is not able to write to the file/folder, but it is continually logging this error, I’m a bit afraid of the performance hit of getting this type of error all the time. And its also pretty ugly to do it this way IMO.
I tried to put a copy of the “CameraSDKConfig.xml” next to the app binary and also next to the libOrbbecSDK.so shared library but it does not look like the file is checked. I tried to send the logs somewhere else by editing the Config.Log.OutPutDir value but the SDK does not seem to use this value.
Finally, while diving a bit in the documentation and headers I found that all this logging behavior is handle by the Context object. This seems to be an acceptable solution, at least for now if I cannot fix the root cause off those logs.
It looks like I could disable the logging with something like this:
Context::setLoggerServerity(OBLogServerity::OB_LOG_SEVERITY_NONE); // C++ ob_set_logger_serverity(myContext, OB_LOG_SEVERITY_NONE, myErrObj); // C
But to be able to use those function, I would need to get access to the Context object. I could not find where to access the instance of the context object at runtime. It looks like to me that in C++ the Pipeline object’s constructor should be instantiating it in some way, since we are querying the device list from it (which must be handled by the context).
So here’s where I’m stuck with this solution: How to access the Context object in C++ ?
Thanks for reading this long post and for any help I get !
Edit after running some more tests:
when the Pipeline starts, I get a warning: “Default config file is not loaded !”, even if I copy the default config file from the OrbbecSDK Linux Package in the binary directory of my app.
Just after, when inspecting my Pipeline object I can see a bit of the data contained in it:
Pipeline::ctx::configPath_ is empty, should it contain the filename ?
Pipeline::ctx::xmlConfig_::defaultConfig_ point to the folder where my app’s binary is (/home/myUsr/myProj/bin), maybe this should also have the config file name (/home/myUsr/myProj/bin/CameraSDKConfig.xml) ?