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

opencv_mertens_merge example hangs when using v1 camera #18

Closed
tvoverbeek opened this issue Feb 24, 2022 · 8 comments
Closed

opencv_mertens_merge example hangs when using v1 camera #18

tvoverbeek opened this issue Feb 24, 2022 · 8 comments

Comments

@tvoverbeek
Copy link
Contributor

For details see the (closed) PR #15

@davidplowman
Copy link
Collaborator

Just to say that we haven't forgotten about this, we think there is a genuine problem underneath picamera2 somewhere.

@tvoverbeek
Copy link
Contributor Author

@davidplowman I ran the opencv_mertens_merge example with LIBCAMERA_LOG_LEVEL defines as *:DEBUG.
Produced tons of output. One thing I noticed at the point where it goes off the rails with the V1 camera is the 4 buffer ids got completely bogus (something in the 18000 range).
Does that help or give you a clue?
If you want I can run it again and post the debug output. Maybe you can suggest a more reasonable set of debug options instead of brute force everything..

@davidplowman
Copy link
Collaborator

Thanks for the update. Actually I think we're OK for now with this one. Unlike some other bugs it's easy to reproduce so we should be able to get a handle on it!

@davidplowman
Copy link
Collaborator

davidplowman commented Mar 7, 2022

I think we've fixed this one, though the problems were rather deeper and more far-reaching than we had expected. I've pushed some updates to the picamera2 branch in our raspberrypi/libcamera repository.

Unfortunately you'll also need a kernel fix for this to work properly, so I'll let you know once that's available via rpi-update.

@tvoverbeek
Copy link
Contributor Author

@davidplowman I rebuilt libcamera to include your fixes. I noticed the need for a kernel fix just now.
Most examples work, but the opencv-mertens-merge still fails with an error:
[1:08:14.234956117] [11296] ERROR V4L2 v4l2_videodevice.cpp:998 /dev/video14[14:cap]: Unable to set format: Invalid argument
After this all examples fail when trying to configure for preview with the same v4l2 error.
No way to recover except reboot.
So I am waiting for rpi-update (both 32-bit and 64-bit?) before trying again.

@tvoverbeek
Copy link
Contributor Author

@davidplowman I assume the needed kernel fix is the one in raspberrypi/linux#4921.
This is now in the 5.15.26 kernel commit raspberrypi/rpi-firmware@25147f6.
So I took a chance and ran rpi-update.
Kernel is now Linux picam2-32 5.15.26-v7l+ #1528 SMP Fri Mar 4 15:42:30 GMT 2022 armv7l
Result: opencv_mertens_merge runs without probems with the V1 camera.
Thanks for all the bug hunting and fix.
Closing the issue.

@davidplowman
Copy link
Collaborator

Ah great, I didn't realise that was already available. Thanks for letting us know!

@tvoverbeek
Copy link
Contributor Author

Additional info:
Previous was on Bullseye 32-bit.Also tried on 64-bit.
This time did the rpi-update to 5.15.26 first.
The mertens example still showed the same hang (as expected).
After rebuilding libcamera the mertens example worked fine.
So both 32-bit and 64-bit work now.

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

2 participants