Open christianrauch opened 2 years ago
@naushir We have tested cameras on Zero 2 W, haven't we?
@davidplowman i beloved your test plan covers this?
Pi02 does not have a GPIO controlling the LED, so it won't ever come on (nor does Pi4).
[ 20.954883] vc4-drm soc:gpu: [drm] Cannot find any crtc or sizes
Implies you're running headless (intentionally or not), but you haven't told libcamera-hello not to try displaying the preview. (-n
option).
There was an early issue with Pi02 with a DT mismatch in the firmware not defining the camera shutdown line correctly due to the change to using cam1_reg, but that was fixed a fair while back.
[ 10.948369] ov5647 10-0036: Consider updating driver ov5647 to match on endpoints
implies that the module is getting at least loaded. Does /dev/video0
exist?
but you haven't told libcamera-hello not to try displaying the preview
I am running via an ssh session without X forwarding. Using -n
will have the same effect. If I enable X forwarding (ssh -X
) then it will show a windows with black content, but it will get stuck too.
Does /dev/video0 exist?
Yes, the device list looks the same as on the Zero (1):
$ v4l2-ctl --list-devices
unicam (platform:3f801000.csi):
/dev/video0
/dev/media3
bcm2835-codec-decode (platform:bcm2835-codec):
/dev/video10
/dev/video11
/dev/video12
/dev/video18
/dev/media2
bcm2835-isp (platform:bcm2835-isp):
/dev/video13
/dev/video14
/dev/video15
/dev/video16
/dev/video20
/dev/video21
/dev/video22
/dev/video23
/dev/media0
/dev/media1
Have you tried more than one Zero 2 W (asking, not expecting)?
Have you tried more than one Zero 2 W (asking, not expecting)?
No. I only got the Zero 2 W recently, so I expect that it has no hardware faults.
The Zero 2 W and the OV5647 are the stock hardware pieces that I use with the latest stock raspi os. I was hoping someone can reproduce this with this hardware. If this fault occurs for all Zero 2 W + OV5647, it should be straight forward to test this.
Tested on a standard Pi OS install. Works fine. Added the -v
option to get more debug
pi@raspberrypi:~ $ libcamera-still -o img.jpg -v
Options:
verbose: 1
info_text:#%frame (%fps fps) exp %exp ag %ag dg %dg
timeout: 5000
width: 0
height: 0
output: img.jpg
post_process_file:
rawfull: 0
preview: default
qt-preview: 0
transform: identity
roi: all
metering: centre
exposure: normal
ev: 0
awb: auto
flush: false
wrap: 0
brightness: 0
contrast: 1
saturation: 1
sharpness: 1
framerate: 30
denoise: auto
viewfinder-width: 0
viewfinder-height: 0
tuning-file: (libcamera)
lores-width: 0
lores-height: 0
mode: unspecified
viewfinder-mode: unspecified
encoding: jpg
quality: 93
raw: 0
restart: 0
timelapse: 0
framestart: 0
datetime: 0
timestamp: 0
keypress: 0
signal: 0
thumbnail width: 320
thumbnail height: 240
thumbnail quality: 70
latest:
immediate 0
Preview window unavailable
Running without preview window
Opening camera...
[0:03:59.878997507] [1183] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3384-44d59841
[0:03:59.906707461] [1184] ERROR CameraSensor camera_sensor.cpp:535 'ov5647 10-0036': Camera sensor does not support test pattern modes.
[0:03:59.959928514] [1184] INFO RPI raspberrypi.cpp:1313 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media3 and ISP device /dev/media0
Acquired camera /base/soc/i2c0mux/i2c@1/ov5647@36
Configuring viewfinder...
Viewfinder size chosen is 1296x972
[0:03:59.963037005] [1183] INFO Camera camera.cpp:1028 configuring streams: (0) 1296x972-YUV420
[0:03:59.964218151] [1184] INFO RPI raspberrypi.cpp:738 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 1296x972-SGBRG10_1X10 - Selected unicam format: 1296x972-pGAA
Camera streams configured
Buffers allocated and mapped
Viewfinder setup complete
Requests created
[0:03:59.992237063] [1189] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:03:59.992525397] [1189] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:03:59.992641803] [1189] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:03:59.992745605] [1189] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:03:59.992852115] [1189] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:03:59.992971543] [1189] INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:03:59.993093365] [1189] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:03:59.993204199] [1189] INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:03:59.993413574] [1189] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:03:59.993527480] [1189] INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 3
[0:03:59.995882324] [1184] INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
[0:03:59.995959095] [1184] INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
[0:03:59.996009981] [1184] INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
[0:03:59.996056595] [1184] INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
[0:03:59.996102272] [1184] INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
[0:03:59.996150293] [1184] INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
[0:03:59.996198574] [1184] INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
Camera started!
Viewfinder frame 0
Viewfinder frame 1
Viewfinder frame 2
Viewfinder frame 3
Viewfinder frame 4
Viewfinder frame 5
Viewfinder frame 6
Viewfinder frame 7
Viewfinder frame 8
Viewfinder frame 9
Viewfinder frame 10
Viewfinder frame 11
Viewfinder frame 12
Viewfinder frame 13
Viewfinder frame 14
Viewfinder frame 15
Viewfinder frame 16
Viewfinder frame 17
Viewfinder frame 18
Viewfinder frame 19
Viewfinder frame 20
Viewfinder frame 21
Viewfinder frame 22
Viewfinder frame 23
Viewfinder frame 24
Viewfinder frame 25
Viewfinder frame 26
Viewfinder frame 27
Viewfinder frame 28
Viewfinder frame 29
Viewfinder frame 30
Viewfinder frame 31
Viewfinder frame 32
Viewfinder frame 33
Viewfinder frame 34
Viewfinder frame 35
Viewfinder frame 36
Viewfinder frame 37
Viewfinder frame 38
Viewfinder frame 39
Viewfinder frame 40
Viewfinder frame 41
Viewfinder frame 42
Viewfinder frame 43
Viewfinder frame 44
Viewfinder frame 45
Viewfinder frame 46
Viewfinder frame 47
Viewfinder frame 48
Viewfinder frame 49
Viewfinder frame 50
Viewfinder frame 51
Viewfinder frame 52
Viewfinder frame 53
Viewfinder frame 54
Viewfinder frame 55
Viewfinder frame 56
Viewfinder frame 57
Viewfinder frame 58
Viewfinder frame 59
Viewfinder frame 60
Viewfinder frame 61
Viewfinder frame 62
Viewfinder frame 63
Viewfinder frame 64
Viewfinder frame 65
Viewfinder frame 66
Viewfinder frame 67
Viewfinder frame 68
Viewfinder frame 69
Viewfinder frame 70
Viewfinder frame 71
Viewfinder frame 72
Viewfinder frame 73
Viewfinder frame 74
Viewfinder frame 75
Viewfinder frame 76
Viewfinder frame 77
Viewfinder frame 78
Viewfinder frame 79
Viewfinder frame 80
Viewfinder frame 81
Viewfinder frame 82
Viewfinder frame 83
Viewfinder frame 84
Viewfinder frame 85
Viewfinder frame 86
Viewfinder frame 87
Viewfinder frame 88
Viewfinder frame 89
Viewfinder frame 90
Viewfinder frame 91
Viewfinder frame 92
Viewfinder frame 93
Viewfinder frame 94
Viewfinder frame 95
Viewfinder frame 96
Viewfinder frame 97
Viewfinder frame 98
Viewfinder frame 99
Viewfinder frame 100
Viewfinder frame 101
Viewfinder frame 102
Viewfinder frame 103
Viewfinder frame 104
Viewfinder frame 105
Viewfinder frame 106
Viewfinder frame 107
Viewfinder frame 108
Viewfinder frame 109
Viewfinder frame 110
Viewfinder frame 111
Viewfinder frame 112
Viewfinder frame 113
Viewfinder frame 114
Viewfinder frame 115
Viewfinder frame 116
Viewfinder frame 117
Viewfinder frame 118
Viewfinder frame 119
Viewfinder frame 120
Viewfinder frame 121
Viewfinder frame 122
Viewfinder frame 123
Viewfinder frame 124
Viewfinder frame 125
Viewfinder frame 126
Viewfinder frame 127
Viewfinder frame 128
Viewfinder frame 129
Viewfinder frame 130
Viewfinder frame 131
Viewfinder frame 132
Viewfinder frame 133
Viewfinder frame 134
Viewfinder frame 135
Viewfinder frame 136
Viewfinder frame 137
Viewfinder frame 138
Viewfinder frame 139
Viewfinder frame 140
Viewfinder frame 141
Viewfinder frame 142
Camera stopped!
Tearing down requests, buffers and configuration
Configuring still capture...
[0:04:05.112949788] [1183] INFO Camera camera.cpp:1028 configuring streams: (0) 2592x1944-YUV420 (1) 2592x1944-SGBRG10_CSI2P
[0:04:05.114423486] [1184] INFO RPI raspberrypi.cpp:738 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 2592x1944-SGBRG10_1X10 - Selected unicam format: 2592x1944-pGAA
Camera streams configured
Buffers allocated and mapped
Still capture setup complete
Requests created
[0:04:05.182088813] [1192] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:04:05.182264803] [1192] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:04:05.182349282] [1192] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:04:05.182427147] [1192] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:04:05.182501626] [1192] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:04:05.182580688] [1192] INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:04:05.182663344] [1192] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:04:05.182733813] [1192] INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 100, 1000000000 ]
[0:04:05.182817667] [1192] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:04:05.182890949] [1192] INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 2
[0:04:05.184902043] [1184] INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
Camera started!
Camera stopped!
Still capture image received
Exposure time: 29967
Ag 2.8125 Dg 1.01317 Total 2.84953
Thumbnail dimensions are 320 x 240
Thumbnail size 10764
JPEG size is 909271
EXIF data len 266
Saved image 2592 x 1944 to file img.jpg
Closing Libcamera application(frames displayed 142, dropped 0)
Camera stopped!
Tearing down requests, buffers and configuration
Camera closed
Memory says that lite installs a slightly different set of binaries due to X being absent, but it shouldn't make any functional difference in this case.
Tested on a standard Pi OS install. Works fine.
Is this via ssh without a display and without X forwarding?
For me, this is:
$ libcamera-still -o img.jpg -v
Options:
verbose: 1
info_text:#%frame (%fps fps) exp %exp ag %ag dg %dg
timeout: 5000
width: 0
height: 0
output: img.jpg
post_process_file:
rawfull: 0
preview: default
qt-preview: 0
transform: identity
roi: all
metering: centre
exposure: normal
ev: 0
awb: auto
flush: false
wrap: 0
brightness: 0
contrast: 1
saturation: 1
sharpness: 1
framerate: 30
denoise: auto
viewfinder-width: 0
viewfinder-height: 0
tuning-file: (libcamera)
lores-width: 0
lores-height: 0
mode: unspecified
viewfinder-mode: unspecified
encoding: jpg
quality: 93
raw: 0
restart: 0
timelapse: 0
framestart: 0
datetime: 0
timestamp: 0
keypress: 0
signal: 0
thumbnail width: 320
thumbnail height: 240
thumbnail quality: 70
latest:
immediate 0
No connector ID specified. Choosing default from list:
Connector 32 (crtc 0): type 11, 0x0
Preview window unavailable
Running without preview window
Opening camera...
[0:01:50.736928943] [725] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3406-e96d0201
[0:01:50.786056790] [726] ERROR CameraSensor camera_sensor.cpp:551 'ov5647 10-0036': Camera sensor does not support test pattern modes.
[0:01:50.869734456] [726] INFO RPI raspberrypi.cpp:1326 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media3 and ISP device /dev/media0
Acquired camera /base/soc/i2c0mux/i2c@1/ov5647@36
Configuring viewfinder...
Viewfinder size chosen is 1296x972
[0:01:50.872306130] [725] INFO Camera camera.cpp:1028 configuring streams: (0) 1296x972-YUV420
[0:01:50.872992941] [726] INFO RPI raspberrypi.cpp:747 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 1296x972-SGBRG10_1X10 - Selected unicam format: 1296x972-pGAA
Camera streams configured
Buffers allocated and mapped
Viewfinder setup complete
Requests created
[0:01:50.926737635] [731] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:01:50.932406495] [731] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:01:50.932501285] [731] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:01:50.932576544] [731] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:01:50.932649512] [731] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:01:50.932725552] [731] INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:01:50.932799509] [731] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:01:50.932869821] [731] INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:01:50.932950600] [731] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:01:50.933021224] [731] INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 3
Camera started!
and form there it is stuck.
According to gdb, it is stuck waiting for some condition to become true:
Thread 1 "libcamera-still" received signal SIGINT, Interrupt.
futex_wait_cancelable (private=0, expected=0, futex_word=0x7efff190) at ../sysdeps/nptl/futex-internal.h:186
186 ../sysdeps/nptl/futex-internal.h: No such file or directory.
(gdb) bt
#0 futex_wait_cancelable (private=0, expected=0, futex_word=0x7efff190) at ../sysdeps/nptl/futex-internal.h:186
#1 __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x0, cond=0x7efff168) at pthread_cond_wait.c:508
#2 __pthread_cond_wait (cond=0x7efff168, mutex=0x0) at pthread_cond_wait.c:638
#3 0x76dd5430 in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /lib/arm-linux-gnueabihf/libstdc++.so.6
#4 0x76f5fbc4 in LibcameraApp::Wait() () from /lib/arm-linux-gnueabihf/libcamera_app.so
#5 0x0001bc2c in ?? ()
#6 0x76bcbbe0 in __libc_start_main (main=0x7efff574, argc=1993347072, argv=0x76bcbbe0 <__libc_start_main+276>, init=<optimized out>, fini=0x29bb4, rtld_fini=0x76fdd510 <_dl_fini>, stack_end=0x7efff574)
at libc-start.c:308
#7 0x0001c630 in ?? ()
I noticed that my verbose log additionally shows:
No connector ID specified. Choosing default from list:
Connector 32 (crtc 0): type 11, 0x0
SSH, display connected, no X forwarding.
SSH, display connected, no X forwarding.
Tested with no display connected, and again it produces 142 preview frames and captures a JPEG.
So... I actually have a second OV5647 that I just tried... and it worked.
Looking at the boards, they are not identical. Both say "P5V04A SUNNY" and "Rev 1.3" but the not-working one has a white "connector" and the working one has a brown connector.
Still, the "white connector OV5647" that does not work with the Zero 2 " does work with the other Raspberry Pis.
does work with the other Raspberry Pis.
Is that with moving cards between the Pis, thereby ruling out configuration differences?
Is that with moving cards between the Pis, thereby ruling out configuration differences?
Yes, the same SD card with the armhf-lite
installation and exactly the same camera. Only the cable and the Pi itself change.
And I presume the same cable has been used with Zero W and Zero 2 W? And the Zero 2 W has been tried repeatedly, meaning that we can rule out a bad cable and poor cable seating for the failing OV5647/Zero 2 W combination?
Raspberry Pi haven't sold the V1.3 camera board since around 2016 when the V2 IMX219 module was released. Omnivision had declared the sensor End Of Life.
There are numerous 3rd parties that have copied the design with varying degrees of accuracy. Some of the original clones required the LED line to be connected, which isn't present on the Pi02. I'm slightly surprised that the sensor responds at all over I2C if that is the case, but it's not something that is worth investigating from our side.
And I presume the same cable has been used with Zero W and Zero 2 W? And the Zero 2 W has been tried repeatedly, meaning that we can rule out a bad cable and poor cable seating for the failing OV5647/Zero 2 W combination?
I always used the same cable on the same Pi. I only disconnected the camera. But this also means that the cable is ok, since one of the two OV5647 works.
There are numerous 3rd parties that have copied the design with varying degrees of accuracy. Some of the original clones required the LED line to be connected, which isn't present on the Pi02.
Thanks for this information. Is this a hardware limitation or can this be fixed by an software update?
It's impossible for me to tell apart the original and a potential copy. My faulty version that does not work with the Zero 2 W looks very similar this one https://www.arducam.com/product/arducam-ov5647-standard-raspberry-pi-camera-b0033/. The "P5V04A SUNNY" is right beneath the camera sensor and the cable connector is white. My PCB additionally has the "Rev 1.3" printed on it.
My working OV5647 is different to this. It has the "P5V04A SUNNY" and "A1508" written on top of the sensor connector and a brown cable connector.
This image shows both OV5647:
How do I know which one is the original and which one is the copy?
The one which is visibly sloppy ("P5V04A..." not printed on the connector, missing dot on the "i", Courier font, inelegant routing) looks like a copy.
They may well both be copies. The V1 camera module was made in the early days and the silkscreen for the official modules didn't get the Raspberry Pi logo on them. Therefore there is no copyright or trademark infringement from copying the silkscreen, and it's hard to tell.
1 Hardware. There is no electrical connection on the Pi02 to pin 18 of the 22pin camera connector, which becomes pin 12 on the 15 way connector. You could short pins 17&18 together on the 22pin connector so that the one signal drove both lines.
2 No. There are no serial numbers or otherwise unique identifiers in the sensor. Anyway it's a function of the board rather than the sensor - swap the sensor itself between the two boards and I suspect that the issue will stay with the board, not the sensor module.
Support is provided for the Raspberry Pi camera modules. As this appears to be a third party module, support is going to be limited. As it works with one of your modules the Pi obviously works. Your main option would be to complain to your camera module supplier.
Having just found what is most likely a genuine Raspberry Pi v1.3 camera module, I can confirm that it matches your second image. The trace round to the LED runs around the outside (rather than under) of the sensor itself, the font matches, and there are 12 vias at the top, all with a small copper ring around them.
Describe the bug
I am unable to use the OV5647 with libcamera on a Zero 2 W with and up-to-date
bullseye
.Steps to reproduce the behaviour
2022-01-28-raspios-bullseye-armhf-lite
libcamera-still -o img.jpg
The program will get stuck and never return an image.
Device (s)
Raspberry Pi Zero 2 W
System
Logs
Additional context
This issue does not appear on a Raspberry Pi 2 and Zero (1) W. I've noticed that on those devices the camera LED turns red immediately after booting and I can consecutively use all the libcamera apps. The LED does not turn on on the Zero 2 W.