WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Raspberry Pi Zero W Camera not working  (Read 3790 times)

Offline imaad

  • Jr. Member
  • **
  • Posts: 70
  • stii ... nu intodeauna stii
Raspberry Pi Zero W Camera not working
« on: October 02, 2022, 01:18:32 PM »
Hello,

I try to enable the camera on a raspberry pi zero W but it doesn't work. The version that I use is piCore 13.1.0
Code: [Select]
Linux box 5.10.77-piCore #1 Sun Nov 7 08:58:38 UTC 2021 armv6l GNU/Linux
I follow the steps from here http://forum.tinycorelinux.net/index.php?topic=22504.0 but still got error
Code: [Select]
tc@box:~$ sudo raspistill -w 720 -h 540 -o image.jpg
mmal: mmal_vc_shm_init: could not initialize vc shared memory service
mmal: mmal_vc_component_create: failed to initialise shm for 'vc.camera_info' (7:EIO)
mmal: mmal_component_create_core: could not create component 'vc.camera_info' (7)
mmal: Failed to create camera_info component

Any help ?
Best regards,
imaad

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Raspberry Pi Zero W Camera not working
« Reply #1 on: October 03, 2022, 05:05:45 AM »

Offline imaad

  • Jr. Member
  • **
  • Posts: 70
  • stii ... nu intodeauna stii
Re: Raspberry Pi Zero W Camera not working
« Reply #2 on: October 03, 2022, 01:30:34 PM »
Yes but v4l-dvb-5.10.77-piCore.tcz is not present.

Code: [Select]
tc@box:~$ tce-load -wi v4l2-utils
v4l2-utils.tcz.dep OK
libv4l2.tcz.dep OK
Downloading: v4l-dvb-5.10.77-piCore.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
wget: server returned error: HTTP/1.1 404 Not Found
md5sum: v4l-dvb-5.10.77-piCore.tcz.md5.txt: No such file or directory
Error on v4l-dvb-5.10.77-piCore.tcz
Best regards,
imaad

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Raspberry Pi Zero W Camera not working
« Reply #3 on: October 04, 2022, 05:06:15 AM »
v4l-dvb-5.10.77-piCore (and v4l-dvb-5.10.77-piCore-v7l) posted - thanks for reporting this.

Offline imaad

  • Jr. Member
  • **
  • Posts: 70
  • stii ... nu intodeauna stii
Re: Raspberry Pi Zero W Camera not working
« Reply #4 on: October 04, 2022, 03:22:19 PM »
Hello Juanito,

Just tested and it's working. Thanks for your help !
Best regards,
imaad

Offline zharr

  • Newbie
  • *
  • Posts: 24
Re: Raspberry Pi Zero W Camera not working
« Reply #5 on: November 06, 2022, 05:17:05 PM »
I have similar problems, v4l2 does not work properly on the Pi Zero 1.3 and Pi Zero W, but works fine on Zero 2 (same image with armv6 packages).
Camera V2 works with raspistill on all boards, but "v4l2-ctl --list-devices" outputs that it cannot open /dev/video0 - because it does not exist.
Any ideas why that could be?

(Also version piCore 13.1.0, Kernel 5.10.77-piCore)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Raspberry Pi Zero W Camera not working
« Reply #6 on: November 07, 2022, 12:26:28 AM »
Do you have "dtoverlay=vc4-kms-v3d" and graphics-KERNEL loaded on the RPi0/RPi0W as well as v4l-dvb-KERNEL?
« Last Edit: November 07, 2022, 12:30:47 AM by Juanito »

Online patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 662
Re: Raspberry Pi Zero W Camera not working
« Reply #7 on: November 07, 2022, 03:54:35 AM »
@Juanito
Do you have access to the wiki ?

You doing a lot to the community and answer so many questions that my suggestion to you would be that:
Isn't it better you could answer some questions to the wiki instead, because some of the questions is always the same.

So you could easily answer back to the questions with a link to the correct wiki page with the answer.
Do not reinvent the wheel every time :)

   

Offline zharr

  • Newbie
  • *
  • Posts: 24
Re: Raspberry Pi Zero W Camera not working
« Reply #8 on: November 07, 2022, 05:00:23 AM »
Do you have "dtoverlay=vc4-kms-v3d" and graphics-KERNEL loaded on the RPi0/RPi0W as well as v4l-dvb-KERNEL?
I did not have the graphics module, nor the dtoverlay, but I did have v4l-dvb-5.10.44-piCore.tcz.
I could not find the correct graphics package for my kernel (graphics-5.10.77-piCore.tcz is missing for all architectures), so I manually installed the 5.10.16 version and added the dtoverlay under an [ALL] section.
Verified that the graphics package was loaded on next boot and dtoverlay got saved.
Unfortunately, the camera was still not recognised by v4l2-ctl --list-devices (again complaining about no /dev/video0, which I assume should be set up by libv4l2 itself), but it still worked with raspistill (and vcgencmd get_camera also reports a supported and detected camera).

I should also note that on the Pi Zero 1.3 (not the Pi Zero 2), extensions load very slow and a variable amount of paths pop up after udevadm settle - timeout of 5 seconds reached, the event queue contains:.
Could range from only /sys/devices/virtual/block/loop99 and /sys/devices/virtual/block/ram0, to the full screen full of paths (including camera related stuff).

I also attempted to load the armv6 kernel on the Zero 2 to see if that would expose an incompability, but unfortunately that didn't even boot.

Thanks for your help.
« Last Edit: November 07, 2022, 05:08:27 AM by zharr »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Raspberry Pi Zero W Camera not working
« Reply #9 on: November 07, 2022, 05:39:00 AM »
Hi zharr
... I could not find the correct graphics package for my kernel (graphics-5.10.77-piCore.tcz is missing for all architectures), so I manually installed the 5.10.16 version ...
You can't mix kernel versions like that. If you're running 5.10.77-piCore kernel, you need 5.10.77-piCore modules.

Offline zharr

  • Newbie
  • *
  • Posts: 24
Re: Raspberry Pi Zero W Camera not working
« Reply #10 on: November 07, 2022, 06:12:12 AM »
Fair enough. I unfortunately cannot reflash with the older kernel right now to test (lost my SD card reader).
Any chance I can compile it myself or should I wait for them to be added?

On another note, was comparing dmesg on the Zero 1.3 (v4l2 doesn't work, raspicam does) to the Zero 2 (v4l2 works, raspicam works), the Zero 2 has this whole block that the Zero 1.3 dmesg log misses right after random: crng init done:
Code: [Select]
vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[vc_sm_connected_init]: start
mc: Linux media interface: v0.10
vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
[vc_sm_connected_init]: installed successfully
vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
videodev: Linux video capture interface: v2.00
bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned.
bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video13
bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video14
bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video15
bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video16
bcm2835-isp bcm2835-isp: Register output node 0 with media controller
bcm2835-isp bcm2835-isp: Register capture node 1 with media controller
bcm2835-isp bcm2835-isp: Register capture node 2 with media controller
bcm2835-isp bcm2835-isp: Register capture node 3 with media controller
bcm2835-isp bcm2835-isp: Loaded V4L2 bcm2835-isp
vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
cfg80211: Loading compiled-in X.509 certificates for regulatory database
vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
------------[ cut here ]------------
WARNING: CPU: 1 PID: 1193 at crypto/rsa-pkcs1pad.c:540 pkcs1pad_verify+0x14c/0x174
Modules linked in: bcm2835_codec(C+) v4l2_mem2mem bcm2835_v4l2(C+) videobuf2_vmalloc bcm2835_isp(C) videobuf2_v4l2 cfg80211(+) bcm2835_mmal_vchiq(C) videobuf2_common rfkill videodev mc vc_sm_cma(C) videobuf2_dma_contig videobuf2_memops fixed squashfs i2c_mux_pinctrl i2c_mux raspberrypi_hwmon i2c_bcm2835 zram zsmalloc
CPU: 1 PID: 1193 Comm: modprobe Tainted: G         C        5.10.77-piCore-v7 #1
Hardware name: BCM2835
Backtrace:
[<80a0b580>] (dump_backtrace) from [<80a0b8f0>] (show_stack+0x20/0x24)
 r7:ffffffff r6:00000000 r5:60000013 r4:80fe5e70
[<80a0b8d0>] (show_stack) from [<80a0fcfc>] (dump_stack+0xb8/0xec)
[<80a0fc44>] (dump_stack) from [<8011f308>] (__warn+0xe8/0x154)
 r9:82359000 r8:00000009 r7:0000021c r6:00000009 r5:805e444c r4:80d37f94
[<8011f220>] (__warn) from [<80a0bf7c>] (warn_slowpath_fmt+0x6c/0xe0)
 r7:805e444c r6:0000021c r5:80d37f94 r4:00000000
[<80a0bf14>] (warn_slowpath_fmt) from [<805e444c>] (pkcs1pad_verify+0x14c/0x174)
 r8:8669a500 r7:84b8f840 r6:00000000 r5:97d27700 r4:84b8f840
[<805e4300>] (pkcs1pad_verify) from [<805edfa4>] (public_key_verify_signature+0x228/0x358)
 r9:82359000 r8:8669a500 r7:84b8f840 r6:00000000 r5:97d27700 r4:97c79b10
[<805edd7c>] (public_key_verify_signature) from [<805ef6dc>] (x509_check_for_self_signed+0xcc/0x128)
 r9:86394800 r8:000002a8 r7:97d276c0 r6:00000000 r5:97d27700 r4:8669a980
[<805ef610>] (x509_check_for_self_signed) from [<805eea18>] (x509_cert_parse+0x16c/0x1c8)
 r7:7f1aafa4 r6:8669a880 r5:97c64e00 r4:8669a980
[<805ee8ac>] (x509_cert_parse) from [<805ef354>] (x509_key_preparse+0x20/0x1a0)
 r9:86394800 r8:7f1aafa4 r7:80fe3280 r6:97c79cb0 r5:97c79cb0 r4:80fe3214
[<805ef334>] (x509_key_preparse) from [<805ecc74>] (asymmetric_key_preparse+0x5c/0x90)
 r9:86394800 r8:7f1aafa4 r7:80fe3280 r6:97c79cb0 r5:80fe32a8 r4:80fe3214
[<805ecc18>] (asymmetric_key_preparse) from [<805a5bb4>] (key_create_or_update+0x178/0x480)
 r7:86fd73c1 r6:80fdf7e0 r5:86fd73c0 r4:80fe3214
[<805a5a3c>] (key_create_or_update) from [<7f20524c>] (regulatory_init+0x17c/0x2b4 [cfg80211])
 r10:7f1ac388 r9:7f1ac3d4 r8:7f1aafa4 r7:7f1b50e0 r6:7f1ab24c r5:000002a8
 r4:7f1c8614
[<7f2050d0>] (regulatory_init [cfg80211]) from [<7f205064>] (cfg80211_init+0x64/0xd0 [cfg80211])
 r10:00000124 r9:00000028 r8:00000002 r7:97d27440 r6:00000000 r5:7f1c8600
 r4:00000000
[<7f205000>] (cfg80211_init [cfg80211]) from [<80102244>] (do_one_initcall+0x50/0x27c)
 r5:97d27500 r4:7f205000
[<801021f4>] (do_one_initcall) from [<801c77e8>] (do_init_module+0x6c/0x2a0)
 r7:97d27440 r6:00000002 r5:97d27500 r4:7f1c83c0
[<801c777c>] (do_init_module) from [<801ca2a0>] (load_module+0x2760/0x2b84)
 r6:00000002 r5:97d27400 r4:97c79f30
[<801c7b40>] (load_module) from [<801ca950>] (sys_finit_module+0xc4/0x104)
 r10:0000017b r9:97c78000 r8:80100204 r7:0000017b r6:00000003 r5:00087e7e
 r4:00000000
[<801ca88c>] (sys_finit_module) from [<80100040>] (ret_fast_syscall+0x0/0x28)
Exception stack(0x97c79fa8 to 0x97c79ff0)
9fa0:                   00000000 464c457f 00000003 00087e7e 00000000 00000000
9fc0: 00000000 464c457f 00010101 0000017b 00000001 0009fc24 0009f6cc 00f0cf38
9fe0: 7ef3fa58 7ef3fa48 0001ab88 76e005a0
 r6:00010101 r5:464c457f r4:00000000
---[ end trace fa92486144e01a5e ]---
cfg80211: Problem loading in-kernel X.509 certificate (-22)
platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
cfg80211: failed to load regulatory.db
brcmfmac: F1 signature read @0x18000000=0x1541a9a6
brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436s-sdio for chip BCM43430/1
usbcore: registered new interface driver brcmfmac
brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436s-sdio for chip BCM43430/1
brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436s-sdio for chip BCM43430/1
brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Feb  5 2021 12:49:07 version 7.45.96 (r745790) FWID 01-71817851 es7
bcm2835-codec bcm2835-codec: Device registered as /dev/video10
bcm2835-codec bcm2835-codec: Loaded V4L2 decode
bcm2835-codec bcm2835-codec: Device registered as /dev/video11
bcm2835-codec bcm2835-codec: Loaded V4L2 encode
bcm2835-codec bcm2835-codec: Device registered as /dev/video12
bcm2835-codec bcm2835-codec: Loaded V4L2 isp
bcm2835-v4l2-0: scene mode selected 0, was 0
bcm2835-v4l2-0: V4L2 device registered as video0 - stills mode > 1280x720
bcm2835-codec bcm2835-codec: Device registered as /dev/video18
bcm2835-codec bcm2835-codec: Loaded V4L2 image_fx
bcm2835-v4l2-0: Broadcom 2835 MMAL video capture ver 0.0.2 loaded.
So maybe these kernel modules are not loaded on the Zero 1.3? I've seen that referenced in other threads, that I might have to load them manually from http://tinycorelinux.net/13.x/armv6/releases/RPi/src/kernel/5.10.77-piCore_modules.tar.xz
Since these were loaded on the Zero 2 but not the Zero 1.3, I assume these are supposed to be in the kernel itself, not necessarily the graphics package?
I found some of these files in /drivers/staging/vc04_services/ in the kernel sources. Is there any guide how to compile them to be included in the kernel (or add them as a tcz?)
« Last Edit: November 07, 2022, 06:15:46 AM by zharr »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Raspberry Pi Zero W Camera not working
« Reply #11 on: November 07, 2022, 09:28:46 AM »
The graphics-KERNEL extension is missing in the piCore-13.x armv6 repo - I’ll try to add it in the next couple of days.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Raspberry Pi Zero W Camera not working
« Reply #12 on: November 07, 2022, 09:32:00 AM »
/dev/video* and /dev/media* are created when the v4l-dvb-KERNEL extension is loaded (after graphics-KERNEL).

Offline zharr

  • Newbie
  • *
  • Posts: 24
Re: Raspberry Pi Zero W Camera not working
« Reply #13 on: November 07, 2022, 11:23:51 AM »
The graphics-KERNEL extension is missing in the piCore-13.x armv6 repo - I’ll try to add it in the next couple of days.
Thanks!
/dev/video* and /dev/media* are created when the v4l-dvb-KERNEL extension is loaded (after graphics-KERNEL).
Interesting is that graphics-KERNEL was NOT loaded when v4l2 DID work on the Zero 2. Hence I didn't know it was needed. Maybe it should be a dependency?
« Last Edit: November 07, 2022, 11:34:02 AM by zharr »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Raspberry Pi Zero W Camera not working
« Reply #14 on: November 08, 2022, 07:32:42 AM »
graphics-5.10.77-piCore posted