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

[BUG] Warnings appear when the camera is activated on Raspberry Pi #102

Closed
JGB-lab opened this issue Jan 16, 2024 · 2 comments
Closed

[BUG] Warnings appear when the camera is activated on Raspberry Pi #102

JGB-lab opened this issue Jan 16, 2024 · 2 comments

Comments

@JGB-lab
Copy link

JGB-lab commented Jan 16, 2024

Bug (or misconfiguration) description:
The hardware system I'm using (RPi4B, V2.1 camera and connection cable) has been working properly for a long time with Raspbian Buster OS and Python 3.7.
A couple of weeks ago, I updated the system to Raspberry OS BookWorm and Python 3.11 (the latest system image downloaded from the official website).
When starting to update the old applications, mainly replacing picamera with picamera2 (that uses libcamera), the following warnings appear, which seem to indicate an incompatibility issue between the OS configuration and the picamera2/libcamera library.
I found quite a bit of information about some of these warnings, but not the solution.

I have previously posted this issue in "picamera2", but there I was recommended to post it in "libcamera": «Hi, thanks for raising this. Really this is a libcamera issue, nothing that Picamera2 can do anything about. Maybe you could post it here https://github.com/raspberrypi/libcamera? Thanks!»

Inputs and outputs:

- In terminal:

:~ $ rpicam-hello
[23:39:46.897521042] [18422]  INFO Camera camera_manager.cpp:284 libcamera v0.1.0+118-563cd78e
[23:39:46.973316013] [18425]  WARN RPiSdn sdn.cpp:39 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[23:39:46.976202702] [18425]  WARN RPI vc4.cpp:390 Mismatch between Unicam and CamHelper for embedded data usage!
[23:39:46.977105432] [18425]  INFO RPI vc4.cpp:444 Registered camera /base/soc/i2c0mux/i2c@1/imx219@10 to Unicam device /dev/media4 and ISP device /dev/media0
[23:39:46.977164784] [18425]  INFO RPI pipeline_base.cpp:1142 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
Made X/EGL preview window
Mode selection for 1640:1232:12:P
    SRGGB10_CSI2P,640x480/0 - Score: 4504.81
    SRGGB10_CSI2P,1640x1232/0 - Score: 1000
    SRGGB10_CSI2P,1920x1080/0 - Score: 1541.48
    SRGGB10_CSI2P,3280x2464/0 - Score: 1718
    SRGGB8,640x480/0 - Score: 5504.81
    SRGGB8,1640x1232/0 - Score: 2000
    SRGGB8,1920x1080/0 - Score: 2541.48
    SRGGB8,3280x2464/0 - Score: 2718
Stream configuration adjusted
[23:39:47.536555044] [18422]  INFO Camera camera.cpp:1183 configuring streams: (0) 1640x1232-YUV420 (1) 1640x1232-SBGGR10_CSI2P
[23:39:47.537185871] [18425]  INFO RPI vc4.cpp:608 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 1640x1232-SBGGR10_1X10 - Selected unicam format: 1640x1232-pBAA

-----------------> But image windows appears as expected

- In Thonny IDE, running Phyton:
Program:

#!/usr/bin/python3

from picamera2 import Picamera2, Preview 

input('Press ENTER to begin')

picam2 = Picamera2()
picam2.start_preview(True)
preview_config = picam2.create_preview_configuration()
picam2.configure(preview_config)
picam2.start()

input('Press ENTER to finish')
picam2.stop_preview()

Output:

>>> %Run Prova.py
Press ENTER to begin
[24:00:32.592111269] [19268]  INFO Camera camera_manager.cpp:284 libcamera v0.1.0+118-563cd78e
[24:00:32.695629281] [19363]  WARN RPiSdn sdn.cpp:39 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[24:00:32.702006641] [19363]  WARN RPI vc4.cpp:390 Mismatch between Unicam and CamHelper for embedded data usage!
[24:00:32.703922090] [19363]  INFO RPI vc4.cpp:444 Registered camera /base/soc/i2c0mux/i2c@1/imx219@10 to Unicam device /dev/media4 and ISP device /dev/media0
[24:00:32.704036607] [19363]  INFO RPI pipeline_base.cpp:1142 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
[24:00:32.716635477] [19268]  INFO Camera camera_manager.cpp:284 libcamera v0.1.0+118-563cd78e
[24:00:32.771724495] [19366]  WARN RPiSdn sdn.cpp:39 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[24:00:32.774247384] [19366]  WARN RPI vc4.cpp:390 Mismatch between Unicam and CamHelper for embedded data usage!
[24:00:32.775664522] [19366]  INFO RPI vc4.cpp:444 Registered camera /base/soc/i2c0mux/i2c@1/imx219@10 to Unicam device /dev/media4 and ISP device /dev/media0
[24:00:32.775963557] [19366]  INFO RPI pipeline_base.cpp:1142 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
[24:00:34.851178386] [19268]  INFO Camera camera.cpp:1183 configuring streams: (0) 640x480-XBGR8888 (1) 640x480-SBGGR10_CSI2P
[24:00:34.852573691] [19366]  INFO RPI vc4.cpp:608 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 640x480-SBGGR10_1X10 - Selected unicam format: 640x480-pBAA
Press ENTER to finish
>>>

--------------------> Also, image windows is shown as expected

To Reproduce
Run the command and application mentioned above in the same context

Expected behaviour
There shouldn't be any information or warning because it should be properly preconfigured, especially regarding warnings. Infos should be able to be suppressed (no-verbose mode).

Console Output, Screenshots
N/A

Hardware :
Raspberry Pi 4B, 4 GB
Two Rasperry V2 cameras where tested, normal and NoIR.
Connection cable test is OK.
SSD Disk mounted, USB connetion.
Additional SD card to backup system.

Additional context
Newly installed OS from scratch. Last image (2024-01-015) download from official Raspberry Pi site.
Debian BookWorm 64 bits and Python 3.11
The only action taken before the libcamera/picamera2 test was an upgrade.

@naushir
Copy link
Collaborator

naushir commented Jan 16, 2024

WARN RPI vc4.cpp:390 Mismatch between Unicam and CamHelper for embedded data usage!

The source of this warning line comes from here:

* We have observed that the imx219 embedded data stream randomly returns junk

In summary, we seem to have invalid embedded data returned by the sensor at random, so cannot trust it. Using embedded data is disabled for now, and as a fallback, we use the local list of parameters from DelayedControls. So this warning is inconsequential, and you can either ignore it or supress the warning by setting LIBCAMERA_LOG_LEVELS=RPI:3 as an environment variable.

When I get a chance, I would like to investigate this problem further to see if the HW can be fixed to return the correct metadata.

@naushir
Copy link
Collaborator

naushir commented Jan 16, 2024

WARN RPiSdn sdn.cpp:39 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise

Again, this is inconsequential, we need to update the sensor tuning files to support a new SDN config format. However, the code is backward compatible so the old format still works. Same as above, you can supress these warnings with the LIBCAMERA_LOG_LEVELS=RPI:3 environment variable.

Eventually we will get round to updating the tuning files to the new format.

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