Closed GuiyinLi closed 1 year ago
Why are you trying to downgrade your libcamera installation? Is there a reason you can't use the latest libcamera ?
We are currently using the 5.13 version of the kernel system (Linux raspberrypi 5.13.19-v8+ #7 SMP PREEMPT IRQPIPE Wed May 24 16:59:45 CST 2023 aarch64 GNU/Linux
). The camera driver in this system requires the use of V4L2 and does not support the media controller. Additionally, higher versions of libcamera rely on a higher version of unicam, but the version of unicam we are using in our system is lower. Therefore, we need to downgrade the libcamera version to 0.0.0. However, due to the large number of commits in your project, we have not found a suitable version yet.
We have already ported our own RTOS system on this system. When using the libcamera provided by the 5.13 kernel, we are unable to access the camera. We have identified that the issue is related to the higher versions of libcamera using the media controller to control the camera. Hence, we need to downgrade to a specific commit of version 0.0.0.
We require a version of libcamera
that does not rely on the media controller
to install in our 5.13 kernel system. If we were to introduce themedia controller
into our system to support higher versions of libcamera, it would involve incorporating over 100 commits from the Raspberry Pi community and the Linux community. This would create further complications. Therefore, we need to downgrade libcamera
to a suitable version in order to use the camera.
I'm really concerned that this sounds like the wrong approach. libcamera is incredibly tied to using media-controller devices to identify what camera to use.
libcamera v0.0.0 - is really old, and represents a much earlier development point, which is sort of what we try to express by the number '0' there.
You also mention you're running your own RTOS ... are you trying to use libcamera in a non-linux OS ?
To be clear, I would recommend that you go the other way - use the latest kernel from Raspberry Pi - and the latest libcamera.
I'm really concerned that this sounds like the wrong approach. libcamera is incredibly tied to using media-controller devices to identify what camera to use.
We find that in the earlier version(<0.0.0) libcamera is not tied to media-controller APIs and wonder whether it's possible to compile and run it.
libcamera v0.0.0 - is really old, and represents a much earlier development point, which is sort of what we try to express by the number '0' there.
You also mention you're running your own RTOS ... are you trying to use libcamera in a non-linux OS ?
Our kernel is RT-Linux and we have multi-release of different Linux kernel versions, like 5.13.19 and 5.15. The kernel versions need to be fixed due to release requirements. The Linux kernel 5.15 has the media-control API while the 5.13.19 version does not.
It works fine if we run libcamera v0.0.3 with the Linux kernel 5.15. But if we want to use libcamera in the 5.13.19 Linux kernel release, it fails with Unicam driver does not use the MediaController, please update your kernel!
. So we have to downgrade the libcamera version to some version before 0.0.0 to avoid using MediaController. Then the above error Unable to find ISP control 0x009819e1
comes.
As we understand, before the libcamera uses the media-controller APIs, there must be a way to compile and test it in Linux. If you could give us any clue on how to run the libcamera without media-controller APIs we would be very grateful.
It was possible to run on the early kernels while the development was being added - but it is not feature complete, and crucially - those earlier versions are not supported. There is no continuation of development on any prior version of libcamera. Only the latest version is supportable and under development.
If you have a commercial requirement to get libcamera running on the older kernels, please contact me via e-mail and we can help support you with the backporting of kernel drivers where necessary to be able to run the latest libcamera.
Thanks for your help! We will try to backport the libcamera and contact you for your help when necessary.
Running v4l2-ctl -d 13 --list-ctrls # bcm2835-isp
on our system, the output is as follows
User Controls
red_balance 0x0098090e (int) : min=1 max=65535 step=1 default=1000 value=1482 flags=slider
blue_balance 0x0098090f (int) : min=1 max=65535 step=1 default=1000 value=1378 flags=slider
colour_correction_matrix 0x009819f1 (u8) : min=0 max=255 step=1 default=0 [88] flags=has-payload
lens_shading 0x009819f2 (u8) : min=0 max=255 step=1 default=0 [36] flags=has-payload, execute-on-write
black_level 0x009819f3 (u8) : min=0 max=255 step=1 default=0 [12] flags=has-payload
green_equalisation 0x009819f4 (u8) : min=0 max=255 step=1 default=0 [16] flags=has-payload
gamma 0x009819f5 (u8) : min=0 max=255 step=1 default=0 [136] flags=has-payload
denoise 0x009819f6 (u8) : min=0 max=255 step=1 default=0 [24] flags=has-payload
sharpen 0x009819f7 (u8) : min=0 max=255 step=1 default=0 [28] flags=has-payload
defective_pixel_correction 0x009819f8 (u8) : min=0 max=255 step=1 default=0 [8] flags=has-payload
colour_denoise 0x009819f9 (u8) : min=0 max=255 step=1 default=0 [8] flags=has-payload
Image Processing Controls
digital_gain 0x009f0905 (int) : min=1 max=65535 step=1 default=1000 value=1000
But the output on the 2021-10-30-raspios-bullseye-arm64-lite
system is
User Controls
red_balance 0x0098090e (int) : min=1 max=65535 step=1 default=1000 value=1000 flags=slider
blue_balance 0x0098090f (int) : min=1 max=65535 step=1 default=1000 value=1000 flags=slider
colour_correction_matrix 0x009819e1 (u8) : min=0 max=255 step=1 default=0 [88] flags=has-payload
lens_shading 0x009819e2 (u8) : min=0 max=255 step=1 default=0 [36] flags=has-payload, execute-on-write
black_level 0x009819e3 (u8) : min=0 max=255 step=1 default=0 [12] flags=has-payload
green_equalisation 0x009819e4 (u8) : min=0 max=255 step=1 default=0 [16] flags=has-payload
gamma 0x009819e5 (u8) : min=0 max=255 step=1 default=0 [136] flags=has-payload
denoise 0x009819e6 (u8) : min=0 max=255 step=1 default=0 [24] flags=has-payload
sharpen 0x009819e7 (u8) : min=0 max=255 step=1 default=0 [28] flags=has-payload
defective_pixel_correction 0x009819e8 (u8) : min=0 max=255 step=1 default=0 [8] flags=has-payload
colour_denoise 0x009819e9 (u8) : min=0 max=255 step=1 default=0 [8] flags=has-payload
Image Processing Controls
digital_gain 0x009f0905 (int) : min=1 max=65535 step=1 default=1000 value=1000
The reason why Unable to find ISP control 0x009819e1
is because it is 0x009819f1
on our system. So change 0x10e0
to 0x10f0
in line 215 of v4l2-controls.h((https://github.com/raspberrypi/libcamera/blob/5acc21fd04fa8568eea9a0bc59e0e614acfbaf7c/include/linux/v4l2-controls.h#L215), and then run libcamera-hello
and the output is as followsso
[0:34:43.162964315] [27917] INFO IPARPI raspberrypi.cpp:633 Request ctrl: Saturation = 1.000000
[0:34:43.163062853] [27917] INFO IPARPI raspberrypi.cpp:633 Request ctrl: Contrast = 1.000000
[0:34:43.163094007] [27917] INFO IPARPI raspberrypi.cpp:633 Request ctrl: Brightness = 0.000000
[0:34:43.163123161] [27917] INFO IPARPI raspberrypi.cpp:633 Request ctrl: AwbMode = 0
[0:34:43.163151686] [27917] INFO IPARPI raspberrypi.cpp:633 Request ctrl: Sharpness = 1.000000
[0:34:43.163204418] [27917] INFO IPARPI raspberrypi.cpp:633 Request ctrl: ExposureValue = 0.000000
[0:34:43.163260504] [27917] INFO IPARPI raspberrypi.cpp:633 Request ctrl: AeExposureMode = 0
[0:34:43.163289343] [27917] INFO IPARPI raspberrypi.cpp:633 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:34:43.163324331] [27917] INFO IPARPI raspberrypi.cpp:633 Request ctrl: AeMeteringMode = 0
[0:34:43.163351541] [27917] INFO IPARPI raspberrypi.cpp:633 Request ctrl: NoiseReductionMode = 3
[0:34:43.164066888] [27913] INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:34:43.164153442] [27913] INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:34:43.164202674] [27913] INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:34:43.164249369] [27913] INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:34:43.266818054] [27913] INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (7 left)
[0:34:43.311877230] [27913] INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (6 left)
[0:34:43.345672145] [27913] INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (5 left)
[0:34:43.379652504] [27913] INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (4 left)
[0:34:43.411950044] [27913] INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (3 left)
[0:34:43.448440074] [27913] INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (2 left)
[0:34:43.478996865] [27913] INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (1 left)
[0:34:43.513571205] [27913] INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (0 left)
This seems to have some problems, but captures pictures and videos properly
Ah yes - because the controls weren't upstreamed, the linux kernel added a new control in the meanwhile so the underlying values had to change.
I'm happy to hear you've resolved the issue.
In my system, when I downgraded
libcamera
to version 0.0.0 and ranlibcamera-hello
, it returned the error messagefailed to configure streams.
version: libcamera: 0.0.0(commit: 5acc21f), libacmera-apps: 1.0.0(commit:commit: f4070274)I have enabled the camera in
raspi-config
, as shown in the screenshot below./boot/config.txt:
My camera is a first-generation OV5647 model, and I'm not sure why this error is occurring.