libcamera: BCM2835_ISP_BASE different between 5.10.y and libcamera vs 5.12.y and 5.13.y

Open
#4,440 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, linux

Research direction

Compare the BCM2835_ISP_BASE definitions in the kernel and libcamera v4l2-controls.h files, then trace the reported ISP control failure in raspberrypi.cpp. Run cam -c 1 -C 1 with kernel 5.12.y or 5.13.y and confirm the camera configures without the missing-control error.

Written by the indexing model from the issue text.

Description

Describe the bug
Due to a mismatch in the BCM2835_ISP_BASE between libcamera and kernel 5.12.y and kernel 5.13.y, libcamera will not work with rpi unless its v4l2-controls.h is also modified to match the kernel v4l2-controls.h

kernel 5.12.y and 5.13.y v4l2-controls.h
#define V4L2_CID_USER_BCM2835_ISP_BASE (V4L2_CID_USER_BASE + 0x10f0)

kernel 5.10.y and libcamera v4l2-controls.h
#define V4L2_CID_USER_BCM2835_ISP_BASE (V4L2_CID_USER_BASE + 0x10e0)

To reproduce
Use kernel 5.12.y or 5.13.y with current libcamera HEAD
cam -c 1 -C 1

Expected behaviour
root@raspberrypi4-64:~# cam -c 1 -C 1
[1:54:10.449586656] [622] INFO Camera camera_manager.cpp:296 libcamera v0.0.0+2747-fb970d9c-dirty (2021-07-08T15:00:29+00:00)
[1:54:10.479843682] [623] WARN CameraSensor camera_sensor.cpp:197 'ov5647 10-0036': Recommended V4L2 control 0x009a0922 not supported
[1:54:10.479959532] [623] WARN CameraSensor camera_sensor.cpp:249 'ov5647 10-0036': The sensor kernel driver needs to be fixed
[1:54:10.480060234] [623] WARN CameraSensor camera_sensor.cpp:251 'ov5647 10-0036': See Documentation/sensor_driver_requirements.rst in the libcamera sources for more information
[1:54:10.481761242] [623] WARN CameraSensor camera_sensor.cpp:403 'ov5647 10-0036': Failed to retrieve the camera location
Using camera /base/soc/i2c0mux/i2c@1/ov5647@36
[1:54:10.757968853] [622] WARN V4L2 v4l2_pixelformat.cpp:181 Unsupported V4L2 pixel format XB24
[1:54:10.759028946] [622] INFO Camera camera.cpp:912 configuring streams: (0) 800x600-NV12
[1:54:10.759326886] [623] INFO RPI raspberrypi.cpp:122 Mode: 2592x1944 fmt BG10 Score: 2284 (best 2284)
[1:54:10.759443328] [623] INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt BG10 Score: 2066.67 (best 2066.67)
[1:54:10.759524012] [623] INFO RPI raspberrypi.cpp:122 Mode: 1296x972 fmt BG10 Score: 1717 (best 1717)
[1:54:10.759600048] [623] INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt BG10 Score: 2060 (best 1717)
[1:54:10.759678250] [623] INFO RPI raspberrypi.cpp:122 Mode: 2592x1944 fmt pBAA Score: 1784 (best 1717)
[1:54:10.759753527] [623] INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt pBAA Score: 1566.67 (best 1566.67)
[1:54:10.759829507] [623] INFO RPI raspberrypi.cpp:122 Mode: 1296x972 fmt pBAA Score: 1217 (best 1217)
[1:54:10.759904172] [623] INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt pBAA Score: 1560 (best 1217)
[1:54:10.760168797] [623] INFO RPI raspberrypi.cpp:619 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected mode: 1296x972-pBAA
[1:54:10.792911540] [623] INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[1:54:10.793035223] [623] INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[1:54:10.793097574] [623] INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[1:54:10.793153203] [623] INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
Capture until user interrupts by SIGINT
[1:54:10.896572493] [623] INFO RPI raspberrypi.cpp:1597 Dropping frame at the request of the IPA (7 left)
[1:54:10.941121203] [623] INFO RPI raspberrypi.cpp:1597 Dropping frame at the request of the IPA (6 left)
[1:54:10.975176128] [623] INFO RPI raspberrypi.cpp:1597 Dropping frame at the request of the IPA (5 left)
[1:54:11.011654716] [623] INFO RPI raspberrypi.cpp:1597 Dropping frame at the request of the IPA (4 left)
[1:54:11.041434583] [623] INFO RPI raspberrypi.cpp:1597 Dropping frame at the request of the IPA (3 left)
[1:54:11.074707577] [623] INFO RPI raspberrypi.cpp:1597 Dropping frame at the request of the IPA (2 left)
[1:54:11.141787814] [623] INFO RPI raspberrypi.cpp:1597 Dropping frame at the request of the IPA (1 left)
[1:54:11.208628796] [623] INFO RPI raspberrypi.cpp:1597 Dropping frame at the request of the IPA (0 left)
6851.241004 (0.00 fps) stream0 seq: 000008 bytesused: 720000
6851.301087 (16.64 fps) stream0 seq: 000009 bytesused: 720000
6851.361170 (16.64 fps) stream0 seq: 000010 bytesused: 720000
6851.421255 (16.64 fps) stream0 seq: 000011 bytesused: 720000
6851.481339 (16.64 fps) stream0 seq: 000012 bytesused: 720000

Actual behaviour
root@raspberrypi4-64:~# cam -c 1 -C 1
[0:00:50.949234727] [290] INFO Camera camera_manager.cpp:294 libcamera v0.0.0+2582-2a103ba1-dirty (2021-07-04T00:48:24+00:00)
[0:00:50.980585042] [291] WARN CameraSensor camera_sensor.cpp:307 'ov5647 10-0036': Recommended V4L2 control 0x009a0922 not supported
[0:00:50.981056579] [291] WARN CameraSensor camera_sensor.cpp:359 'ov5647 10-0036': The sensor kernel driver needs to be fixed
[0:00:50.981136653] [291] WARN CameraSensor camera_sensor.cpp:361 'ov5647 10-0036': See Documentation/sensor_driver_requirements.rst in the libcamera sources for more information
[0:00:50.983345857] [291] WARN CameraSensorProperties camera_sensor_properties.cpp:61 No static properties available for 'ov5647'
[0:00:50.983423968] [291] WARN CameraSensorProperties camera_sensor_properties.cpp:63 Please consider updating the camera sensor properties database
[0:00:50.983959857] [291] WARN CameraSensor camera_sensor.cpp:487 'ov5647 10-0036': Failed to retrieve the camera location
Using camera /base/soc/i2c0mux/i2c@1/ov5647@36
[0:00:51.030133450] [290] WARN V4L2 v4l2_pixelformat.cpp:180 Unsupported V4L2 pixel format XB24
[0:00:51.031235820] [290] INFO Camera camera.cpp:905 configuring streams: (0) 800x600-NV12
[0:00:51.031607542] [291] INFO RPI raspberrypi.cpp:122 Mode: 2592x1944 fmt BG10 Score: 2284 (best 2284)
[0:00:51.031724042] [291] INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt BG10 Score: 2066.67 (best 2066.67)
[0:00:51.031807802] [291] INFO RPI raspberrypi.cpp:122 Mode: 1296x972 fmt BG10 Score: 1717 (best 1717)
[0:00:51.031886098] [291] INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt BG10 Score: 2060 (best 1717)
[0:00:51.031995487] [291] INFO RPI raspberrypi.cpp:122 Mode: 2592x1944 fmt pBAA Score: 1784 (best 1717)
[0:00:51.032133227] [291] INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt pBAA Score: 1566.67 (best 1566.67)
[0:00:51.032242042] [291] INFO RPI raspberrypi.cpp:122 Mode: 1296x972 fmt pBAA Score: 1217 (best 1217)
[0:00:51.032346283] [291] INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt pBAA Score: 1560 (best 1217)
[0:00:51.032645968] [291] INFO RPI raspberrypi.cpp:619 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected mode: 1296x972-pBAA
[0:00:51.034692653] [291] ERROR IPARPI raspberrypi.cpp:549 Unable to find ISP control 0x009819e1
[0:00:51.034778598] [291] ERROR IPARPI raspberrypi.cpp:347 ISP control validation failed.
[0:00:51.034837042] [291] ERROR RPI raspberrypi.cpp:1291 IPA configuration failed!
[0:00:51.034904802] [291] ERROR RPI raspberrypi.cpp:756 Failed to configure the IPA: -32
Failed to configure camera

Dominant language
C
Stars
13.2k
Forks
5.5k
Avg merge
2d 21h
Merged PRs (30d)
21

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/linux

All issues in raspberrypi/linux

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.