cnaslain
Posts: 3
Joined: Mon Jan 13, 2020 7:15 pm

Blank image from Pi V2 Camera on a raspberry Pi 4

Mon Jan 13, 2020 10:54 pm

Hi all,

I'm a long time domoticz user on a Pi 1 B+ and just bought a new Pi 4 B (4Gb RAM) and a V2.1 camera to upgrade my home automation Pi.
Before migrating domoticz, I have wanted to test the new V2 camera module on the pi 4.

Code: Select all

uname -a
Linux raspberrypi4.johndoe.com 4.19.93-v7l+ #1290 SMP Fri Jan 10 16:45:11 GMT 2020 armv7l GNU/Linux
 cat /etc/*-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
I've done these basic steps:
- Shutdown the pi
- Connecting the V2 pi Camera and remove the lens protecting strap
- Start the pi
- sudo raspi-config + 5 Interfacing Options > P1 Camera > Enable: Yes
- update the system to be up-to date: sudo apt update && sudo apt full-upgrade && sudo apt-get install rpi-update && sudo rpi-update
- reboot
- vcgencmd get_camera command returns supported=1 detected=1
- take a picture: raspistill -w 1024 -h 760 -o ~/Camera/image.jpg -q 100 returns the flowing image (white background with black horizontal lines and oblique stripped lines):
image.jpg
image.jpg (240.82 KiB) Viewed 241 times
I really don't know why the camera output render like this. Any idea?

2nd test was to install motion (4.1.1-1.1+b2), gpac (0.5.2-426-gc5ad4e4+dfsg5-5) and and see what the video looks like:
- sudo apt-get install motion gpac
- Configure /etc/motion/motion.conf with default settings and just update this: daemon on, stream_localhost off
- start motion: sudo motion

Code: Select all

cat /var/log/motion/motion.log
[19236488:motion] [NTC] [ALL] [Jan 13 23:35:36] motion_startup: Using log type (ALL) log level (NTC)
[19236488:motion] [NTC] [ALL] [Jan 13 23:35:36] become_daemon: Motion going to daemon mode
[19236488:motion] [NTC] [ALL] [Jan 13 23:35:36] create_path: creating directory /var/run/motion
[19236488:motion] [NTC] [ALL] [Jan 13 23:35:36] become_daemon: Created process id file /var/run/motion/motion.pid. Process ID is 4254
[19236488:motion] [NTC] [ALL] [Jan 13 23:35:36] motion_startup: Motion running as daemon process
[19236488:motion] [NTC] [ENC] [Jan 13 23:35:36] ffmpeg_global_init: ffmpeg libavcodec version 58.35.100 libavformat version 58.20.100
[0:motion] [NTC] [ALL] [Jan 13 23:35:36] main: Camera ID: 0 is from /etc/motion/motion.conf
[0:motion] [NTC] [ALL] [Jan 13 23:35:36] main: Camera ID: 0 Camera Name: (null) Device: /dev/video0
[0:motion] [NTC] [ALL] [Jan 13 23:35:36] main: Waiting for threads to finish, pid: 4254
[1:ml1] [NTC] [ALL] [Jan 13 23:35:36] motion_init: Camera 0 started: motion detection Enabled
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] vid_start: Opening V4L2 device
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_start: Using videodevice /dev/video0 and input -1
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_get_capability:
------------------------
cap.driver: "bm2835 mmal"
cap.card: "mmal service 16.1"
cap.bus_info: "platform:bcm2835-v4l2"
cap.capabilities=0x85200005
------------------------
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_get_capability: - VIDEO_CAPTURE
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_get_capability: - VIDEO_OVERLAY
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_get_capability: - READWRITE
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_get_capability: - STREAMING
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_select_input: name = "Camera 0", type 0x00000002, status 00000000
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_select_input: - CAMERA
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_select_input: Device does not support specifying PAL/NTSC norm
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_do_set_pix_format: Testing palette YU12 (320x240)
[0:wc0] [NTC] [STR] [Jan 13 23:35:36] http_bindsock: listening on 127.0.0.1 port 8080
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_do_set_pix_format: Using palette YU12 (320x240) bytesperlines 320 sizeimage 115200 colorspace 00000001
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_scan_controls: found control 0x00980900, "Brightness", range 0,100
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_scan_controls:       "Brightness", default 50, current 50
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_scan_controls: found control 0x00980901, "Contrast", range -100,100
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_scan_controls:       "Contrast", default 0, current 0
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_scan_controls: found control 0x00980902, "Saturation", range -100,100
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_scan_controls:       "Saturation", default 0, current 0
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_scan_controls: found control 0x00980918, "Power Line Frequency", range 0,3
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_scan_controls:       "Power Line Frequency", default 1, current 1
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_scan_controls: found control 0x0098090e, "Red Balance", range 1,7999
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_scan_controls:       "Red Balance", default 1000, current 1000
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_scan_controls: found control 0x0098090f, "Blue Balance", range 1,7999
[1:ml1] [NTC] [VID] [Jan 13 23:35:36] v4l2_scan_controls:       "Blue Balance", default 1000, current 1000
[0:wc0] [NTC] [STR] [Jan 13 23:35:36] httpd_run: Started motion-httpd server on port 8080 (auth Disabled)
[1:ml1] [NTC] [ALL] [Jan 13 23:35:37] image_ring_resize: Resizing pre_capture buffer to 1 items
[1:ml1] [NTC] [STR] [Jan 13 23:35:37] http_bindsock: listening on any IPv4 address port 8081
[1:ml1] [NTC] [ALL] [Jan 13 23:35:37] motion_init: Started motion-stream server on port 8081 (auth Disabled)
When accessing to http://<pi4 LAN IP>:8081/ the following image is shown:
image_motion.PNG
image_motion.PNG (13.64 KiB) Viewed 241 times
3rd test I've stopped motion and installed the https://elinux.org/RPi-Cam-Web-Interface application I wanted to access quickly to the camera settings to see if some tuning may display something else than a white image. The video display was completely blank. I have set the 720p preset and the ISO to 250. Here is the rendered video:
image_RPiCamWebInterf.jpg
image_RPiCamWebInterf.jpg (84.62 KiB) Viewed 241 times
I was wondering if the V2 Pi Camera was OK; is there any diagnostic I can do to know if there is something wrong with the softwares, or if this is a hardware issue?

Thanks for your feedback,

Chris

cnaslain
Posts: 3
Joined: Mon Jan 13, 2020 7:15 pm

Re: Blank image from Pi V2 Camera on a raspberry Pi 4

Tue Jan 14, 2020 9:00 pm

Additional info: The linux drive is loaded and it responds:

Code: Select all

[email protected]:~ $ sudo lsmod | grep bcm2835
snd_bcm2835            24576  1
bcm2835_codec          36864  0
snd_pcm               102400  4 vc4,snd_pcm_dmaengine,snd_bcm2835,snd_soc_core
v4l2_mem2mem           24576  1 bcm2835_codec
videobuf2_dma_contig    20480  1 bcm2835_codec
bcm2835_v4l2           45056  0
snd                    73728  7 snd_compress,snd_timer,snd_bcm2835,snd_soc_core,snd_pcm
bcm2835_mmal_vchiq     32768  2 bcm2835_codec,bcm2835_v4l2
v4l2_common            16384  1 bcm2835_v4l2
videobuf2_vmalloc      16384  1 bcm2835_v4l2
videobuf2_v4l2         24576  3 bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem
videobuf2_common       45056  4 bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
videodev              200704  6 bcm2835_codec,v4l2_common,videobuf2_common,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
media                  36864  3 bcm2835_codec,videodev,v4l2_mem2mem
vc_sm_cma              36864  1 bcm2835_mmal_vchiq

Code: Select all

[email protected]:~ $ v4l2-ctl --list-formats-ext -d /dev/video0
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'YU12' (Planar YUV 4:2:0)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [1]: 'YUYV' (YUYV 4:2:2)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [2]: 'RGB3' (24-bit RGB 8-8-8)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [3]: 'JPEG' (JFIF JPEG, compressed)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [4]: 'H264' (H.264, compressed)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [5]: 'MJPG' (Motion-JPEG, compressed)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [6]: 'YVYU' (YVYU 4:2:2)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [7]: 'VYUY' (VYUY 4:2:2)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [8]: 'UYVY' (UYVY 4:2:2)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [9]: 'NV12' (Y/CbCr 4:2:0)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [10]: 'BGR3' (24-bit BGR 8-8-8)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [11]: 'YV12' (Planar YVU 4:2:0)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [12]: 'NV21' (Y/CrCb 4:2:0)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [13]: 'BGR4' (32-bit BGRA/X 8-8-8-8)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2

cnaslain
Posts: 3
Joined: Mon Jan 13, 2020 7:15 pm

Re: Blank image from Pi V2 Camera on a raspberry Pi 4

Fri Jan 17, 2020 8:40 pm

I returned the camera module and ordered a new one.
Just receive it today, mounted, tested: Everything works fine :-)

It was a camera module hardware issue!!!

Return to “Camera board”