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

AeExposureMode=2 - AeExposureMode=2' was failed to find. #67

Open
webgps opened this issue Jun 2, 2023 · 10 comments
Open

AeExposureMode=2 - AeExposureMode=2' was failed to find. #67

webgps opened this issue Jun 2, 2023 · 10 comments

Comments

@webgps
Copy link

webgps commented Jun 2, 2023

Getting this error and service restart when try to set various options (not all, but too few)

Jun 02 13:21:17 wgrpinlcam01 camera-streamer[44004]: device/v4l2/device_options.c: RESCALLER:STREAM: The 'AeExposureMode=2' was failed to find.
Jun 02 13:21:17 wgrpinlcam01 camera-streamer[44004]: device/v4l2/device_options.c: RESCALLER:VIDEO: The 'AeExposureMode=2' was failed to find.
Jun 02 13:21:17 wgrpinlcam01 camera-streamer[44004]: device/v4l2/device_options.c: SNAPSHOT: The 'AeExposureMode=2' was failed to find.
Jun 02 13:21:17 wgrpinlcam01 camera-streamer[44004]: device/v4l2/device_options.c: STREAM: The 'AeExposureMode=2' was failed to find.
Jun 02 13:21:17 wgrpinlcam01 camera-streamer[44004]: device/v4l2/device_options.c: VIDEO: The 'AeExposureMode=2' was failed to find.
Jun 02 13:21:17 wgrpinlcam01 camera-streamer[44004]: util/http/http.c: HTTP8080/6: Client disconnected 192.168.2.6.
Jun 02 13:21:17 wgrpinlcam01 camera-streamer[44004]: [518:41:50.377648261] [44019] FATAL RPiAgc agc.cpp:540 No exposure profile long
Jun 02 13:21:17 wgrpinlcam01 camera-streamer[44004]: Backtrace:
Jun 02 13:21:17 wgrpinlcam01 systemd[1]: camera-streamer-raspi-v3-12MP.service: Main process exited, code=killed, status=6/ABRT
Jun 02 13:21:17 wgrpinlcam01 systemd[1]: camera-streamer-raspi-v3-12MP.service: Failed with result 'signal'.
Jun 02 13:21:17 wgrpinlcam01 systemd[1]: camera-streamer-raspi-v3-12MP.service: Consumed 1min 32.532s CPU time.
Jun 02 13:21:27 wgrpinlcam01 systemd[1]: camera-streamer-raspi-v3-12MP.service: Scheduled restart job, restart counter is at 5.

@ayufan
Copy link
Owner

ayufan commented Jun 2, 2023

Unfortunately, libcamera (upstream) fails when setting some of the options. Not all are exposed. In this case it is long exposure. So it fails, and crashes the whole process.

@webgps
Copy link
Author

webgps commented Jun 4, 2023

Yes, i can use bunch of the options without error, unfortunatelly i need thoose which are failing :)
Should i use libcamera-dev? Or....?

@kbingham
Copy link

kbingham commented Jun 5, 2023

"Crashes the whole process" shouldn't happen. Only controls exposed by the Camera->controls() are valid to be set. Is there a specific control you are setting that is crashing on the RPi ?

@ayufan
Copy link
Owner

ayufan commented Jun 5, 2023

@kbingham Thanks for looking into this :) Let me find one.

@ayufan
Copy link
Owner

ayufan commented Jun 5, 2023

@kbingham If I recall correctly:

libcamera-dev is already the newest version (0~git20230302+923f5d70-1).
libcamera0 is already the newest version (0~git20230302+923f5d70-1).
device/libcamera/options.cc: CAMERA: Configuring option 'AfMode' (0000001c, type=3) = 1
util/http/http.c: HTTP8080/5: Client disconnected 192.168.4.1.
[51:25:20.179121287] [4991]  WARN IPARPI raspberrypi.cpp:801 Could not set AF_MODE - no AF algorithm

Thread 15 "camera-streamer" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fe329b600 (LWP 4991)]
0x0000007fe980fb24 in libcamera::ipa::RPi::IPARPi::queueRequest(libcamera::ControlList const&) () from /usr/lib/aarch64-linux-gnu/libcamera/ipa_rpi.so
(gdb) backtrace
#0  0x0000007fe980fb24 in libcamera::ipa::RPi::IPARPi::queueRequest(libcamera::ControlList const&) () at /usr/lib/aarch64-linux-gnu/libcamera/ipa_rpi.so
#1  0x0000007ff6346028 in libcamera::Object::message(libcamera::Message*) () at /lib/aarch64-linux-gnu/libcamera-base.so.0.0.4
#2  0x0000007ff6348430 in libcamera::Thread::dispatchMessages(libcamera::Message::Type) () at /lib/aarch64-linux-gnu/libcamera-base.so.0.0.4
#3  0x0000007ff633f804 in libcamera::EventDispatcherPoll::processEvents() () at /lib/aarch64-linux-gnu/libcamera-base.so.0.0.4
#4  0x0000007ff6348158 in libcamera::Thread::exec() () at /lib/aarch64-linux-gnu/libcamera-base.so.0.0.4
#5  0x0000007ff7e7ccac in  () at /lib/aarch64-linux-gnu/libstdc++.so.6
#6  0x0000007ff7f92648 in start_thread (arg=0x7fe329af00) at pthread_create.c:477
#7  0x0000007ff5cf2c1c in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78

It appears to crash in here: https://github.com/raspberrypi/libcamera/blob/main/src/ipa/raspberrypi/raspberrypi.cpp#LL811C4-L811C6, since the af is NULL.

@ayufan
Copy link
Owner

ayufan commented Jun 5, 2023

Or.:

device/libcamera/options.cc: CAMERA: Configuring option 'AeExposureMode' (00000005, type=3) = 2
util/http/http.c: HTTP8080/0: Client disconnected 192.168.4.1.
[51:27:05.507557502] [5477] FATAL RPiAgc agc.cpp:540 No exposure profile long
Backtrace:

Aborted

This fetches the available control, but in this case it seems to crash on the lack of the given enum value.

@kbingham
Copy link

kbingham commented Jun 7, 2023

Just as an update - we're looking into this on the libcamera/rpi side. There's a couple of issues. The IMX519 got missed from an IPA tuning data file update, so that needs fixing (you could do this locally yourself to get past this if you look at the differences between imx477.json and imx519.json in the exposure_modes section), and maybe in that event we shouldn't be calling a fatal assertion, just disallowing that exposure profile.

@webgps Can you confirm what sensor module you are using please?

@kbingham
Copy link

kbingham commented Jun 7, 2023

Oh I posted here 'minutes' too soon, as just after I sent this Naush has posted relevant patches.

Could you test the patches from https://patchwork.libcamera.org/project/libcamera/list/?series=3912 please?

@ayufan
Copy link
Owner

ayufan commented Jun 8, 2023

Thank you @kbingham. I will be able to test it next week.

Would it be possible for you folks to also fix the #67 (comment)? It seems to be NULL pointer access violation.

naushir added a commit to naushir/libcamera that referenced this issue Jun 8, 2023
If a metering/exposure/constraint mode is not listed in the sensor
tuning file, and a control for the missing mode is set on the agc, we
terminate the application with a fatal log message.

Instead of this fatal termination, log a warning message and switch to
the appropriate default mode so that the application continues running.

Reported-on: raspberrypi/libcamera#59
Reported-on: ayufan/camera-streamer#67
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
kbingham pushed a commit to kbingham/libcamera that referenced this issue Jun 8, 2023
If a metering/exposure/constraint mode is not listed in the sensor
tuning file, and a control for the missing mode is set on the agc, we
terminate the application with a fatal log message.

Instead of this fatal termination, log a warning message and switch to
the appropriate default mode so that the application continues running.

Bug: raspberrypi/libcamera#59
Bug: ayufan/camera-streamer#67
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
@kbingham
Copy link

kbingham commented Jun 8, 2023

Thank you @kbingham. I will be able to test it next week.

Patches for this issue now merged to libcamera to https://git.libcamera.org/libcamera/libcamera.git/commit/?id=0ee9339331c648232e87d2de2ccd5a92cc61cab2

Would it be possible for you folks to also fix the #67 (comment)? It seems to be NULL pointer access violation.

Could this be broken out to a separate issue please?

Gabrielle-George pushed a commit to Gabrielle-George/libcamera that referenced this issue Jun 30, 2023
If a metering/exposure/constraint mode is not listed in the sensor
tuning file, and a control for the missing mode is set on the agc, we
terminate the application with a fatal log message.

Instead of this fatal termination, log a warning message and switch to
the appropriate default mode so that the application continues running.

Bug: raspberrypi/libcamera#59
Bug: ayufan/camera-streamer#67
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.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