Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: imaad on October 02, 2022, 04: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 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
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 ?
-
Did you try libv4l2 rather than rpi-vc?
http://forum.tinycorelinux.net/index.php/topic,24153.msg152673.html#msg152673
-
Yes but v4l-dvb-5.10.77-piCore.tcz is not present.
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
-
v4l-dvb-5.10.77-piCore (and v4l-dvb-5.10.77-piCore-v7l) posted - thanks for reporting this.
-
Hello Juanito,
Just tested and it's working. Thanks for your help !
-
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)
-
Do you have "dtoverlay=vc4-kms-v3d" and graphics-KERNEL loaded on the RPi0/RPi0W as well as v4l-dvb-KERNEL?
-
@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 :)
-
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.
-
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.
-
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:
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?)
-
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.
-
/dev/video* and /dev/media* are created when the v4l-dvb-KERNEL extension is loaded (after graphics-KERNEL).
-
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?
-
graphics-5.10.77-piCore posted
-
Do you have access to the wiki?
Presumably yes, but there are only so many hours in a day...
-
This is from piCore64, but you should see something similar when v4l-dvb-KERNEL loads:
$ lsmod
Module Size Used by Tainted: G
bcm2835_isp 32768 0
bcm2835_codec 49152 0
bcm2835_v4l2 45056 0
bcm2835_mmal_vchiq 40960 3 bcm2835_codec,bcm2835_isp,bcm2835_v4l2
videobuf2_vmalloc 20480 1 bcm2835_v4l2
rpivid_hevc 49152 0
v4l2_mem2mem 40960 2 bcm2835_codec,rpivid_hevc
videobuf2_v4l2 32768 5 bcm2835_codec,bcm2835_isp,bcm2835_v4l2,rpivid_hevc,v4l2_mem2mem
videobuf2_common 61440 6 bcm2835_codec,bcm2835_isp,bcm2835_v4l2,rpivid_hevc,v4l2_mem2mem,videobuf2_v4l2
videodev 311296 7 bcm2835_codec,bcm2835_isp,bcm2835_v4l2,rpivid_hevc,v4l2_mem2mem,videobuf2_v4l2,videobuf2_common
mc 61440 7 bcm2835_codec,bcm2835_isp,rpivid_hevc,v4l2_mem2mem,videobuf2_v4l2,videobuf2_common,videodev
videobuf2_dma_contig 24576 3 bcm2835_codec,bcm2835_isp,rpivid_hevc
videobuf2_memops 20480 2 videobuf2_vmalloc,videobuf2_dma_contig
snd_soc_hdmi_codec 20480 2
snd_bcm2835 28672 0
vc_sm_cma 36864 2 bcm2835_isp,bcm2835_mmal_vchiq
v3d 81920 4
gpu_sched 45056 1 v3d
vc4 282624 10
cec 53248 1 vc4
...
-
Thanks for uploading, will try later.
One question, if I want to support both Pi Zero 1 and Pi Zero 2, do I need the KERNEL-specific packages twice, for both piCore and piCore-v7?
From my understanding, the normal packages are either the same, or the v6 packages also work for v7. But that might not be true for KERNEL specific ones.
Reason I'm asking is I use a custom tce-loader to create the image and load tce before even starting up and that might be part of the problem.
Also I just bricked my installation trying to manually update extensions so I'll have to test once a new SD Card reader arrives.
-
Hi zharr
The piCore-VERSION.img file contains kernels for V6, V7, and V7l.
The V6 software should run on all 3 processor types.
Yes, you do need the KERNEL specific packages twice. They can be
in the same directory. The dependency files list them as:
graphics-KERNEL.tcz
When tce-load sees that KERNEL in the name it looks for a filename
that matches the kernel you are running and loads that.
-
Yes, you need both kernel specific extensions, the other extensions are common to armv6, armv7 and armv7l.
-
Hi zharr
The piCore-VERSION.img file contains kernels for V6, V7, and V7l.
The V6 software should run on all 3 processor types.
Yes, you do need the KERNEL specific packages twice. They can be
in the same directory. The dependency files list them as:
graphics-KERNEL.tcz
When tce-load sees that KERNEL in the name it looks for a filename
that matches the kernel you are running and loads that.
Yes, you need both kernel specific extensions, the other extensions are common to armv6, armv7 and armv7l.
Thanks, updated my code to load KERNEL-specific tczs from both repositories. That might also have been the problem, initially I only loaded v4l-dvb-5.10.77-piCore.tcz or v4l-dvb-5.10.77-piCore-v7.tcz, never both at the same time.
I'll have to confirm that everything works tomorrow once I have a SD card reader.
-
Hi zharr
If you look through /usr/bin/tce-load you will find this:
KERNELVER=$(uname -r)
$KERNELVER now contains the kernel version that is currently running.
It then replaces KERNEL in the extension name with the value contained
in $KERNELVER so it loads the matching extension.
You will also see that it runs depmod when it detects kernel modules are
being installed.
-
When kernel modules loaded from the repo in .tcz format depmod is executed by the system, no need manually. WWell, it doesn't hurt
-
It took me a while to update my RPi0W to piCore-13.1, but I can confirm that that the video devices are created after the following:
Set dtoverlay=vc4-kms-v3d, reboot and then: tce-load -i graphics-KERNEL
alsa-modules-5.10.77-piCore.tcz: OK
graphics-5.10.77-piCore.tcz: OK
tce-load -i v4l-dvb-KERNEL
v4l-dvb-5.10.77-piCore.tcz: OK
ls /dev/video*
/dev/video10 /dev/video12 /dev/video14 /dev/video16
/dev/video11 /dev/video13 /dev/video15 /dev/video18
ls /dev/media*
/dev/media0 /dev/media1