The officially official Devuan Forum!

You are not logged in.

#1 2020-12-31 21:35:07

alphalpha
Member
From: Germany
Registered: 2018-01-23
Posts: 137  

Raspberry Camera raspistill/raspivid

Anyone has the raspistill/raspivid commands working?
I keep getting this error: * failed to open vchiq instance

tried chmod 777 /dev/vchiq
error does not show, but still dont get any picture

Offline

#2 2021-01-01 16:00:52

tuxd3v
Member
Registered: 2019-11-14
Posts: 183  

Re: Raspberry Camera raspistill/raspivid

hello alphalpha,
You sure you connected the camera do CSI interface( closer to hdmi output )?

You need in the config.txt, gpu memory at least:

gpu_mem=128

Then restart..

You can see more about it in camera

Are you using libcamera?

What is the sensor you are using?
imx214    - will be built in next release
imx219    - will be built in next release
ov5647    - built in the kernel
imx477    - This one is not present in the kernel 5.10.x sad
OV7640  - built in the kernel
MT9V011- built in the kernel

Last edited by tuxd3v (2021-01-02 23:06:10)


Best Regards,
tux

Offline

#3 2021-01-02 21:01:36

alphalpha
Member
From: Germany
Registered: 2018-01-23
Posts: 137  

Re: Raspberry Camera raspistill/raspivid

yes i used the right connector and had that gpu_mem=128 and also start_x=1 in /boot/config.txt
not sure what sensor i have, cant find any information on this

i was trying to get this working https://elinux.org/RPi-Cam-Web-Interface , it uses mjpeg

i guess i'll give up on this and just use raspbian for this

Offline

#4 2021-01-02 22:53:20

tuxd3v
Member
Registered: 2019-11-14
Posts: 183  

Re: Raspberry Camera raspistill/raspivid

alphalpha wrote:

yes i used the right connector and had that gpu_mem=128 and also start_x=1 in /boot/config.txt
not sure what sensor i have, cant find any information on this

i was trying to get this working https://elinux.org/RPi-Cam-Web-Interface , it uses mjpeg

hello alphalpha,
you need to load the kernel module for your camera to work.. smile

Just try first with the V1, to test wink
It can be that you have yet another sensor.. its important to know, what sensor you have so that we can load the respective kernel module..
imx -Sony sensors
ov  - OmniVision Sensors

Do this, to load 3 different sensors, you will see errors on kernel modules it doesn't have, but no problem..it will load what it have..

modprobe ov5647;modprobe imx219;modprobe imx477

Raspberry Pi delivered 3 different cameras.
v1 - with 5Mpix CMOS ov5647 sensor
v2 - with 8Mpix CMOS imx219 sensor
v3 - with 12.3Mpix CMOS imx477( there are not yet support for this high Quality camera in mainline kernel..)

I am about to release a version with the kernel module imx219( V2 camera.. )

to use raspistill, you just need to do a basic test:

raspistill -o test.jpg

I have also ordered a camera, its a v1 version, and its s clone with  ov5647 sensor, but its in the mail, I am still waiting for it.. sad

can you share your dmesg, ( maybe we could sort that out from there..) ? smile

EDIT:
I forgot to tell you that you also need the raspberrypi userland:

cd /root
apt-get install g++ cmake
git clone https://github.com/raspberrypi/userland.git
cd userland
./buildme --native
cd /root
rm -rf userland

the code will land in '/opt/vc',
You need to update your path and also the Dynamic linker..

# Update PATH
echo "export PATH="/opt/vc/bin":${PATH}" /root/.bashrc
# Update Dynamic Linker paths
echo "/opt/vc/lib" >> /etc/ld.so.conf
ldconfig -vv

then logout of root, and login again..
done smile

Last edited by tuxd3v (2021-01-04 10:03:49)


Best Regards,
tux

Offline

#5 2021-01-04 23:14:32

alphalpha
Member
From: Germany
Registered: 2018-01-23
Posts: 137  

Re: Raspberry Camera raspistill/raspivid

sudo modprobe ov5647; sudo modprobe imx219; sudo modprobe imx477
modprobe: FATAL: Module imx219 not found in directory /lib/modules/5.3.13
modprobe: FATAL: Module imx477 not found in directory /lib/modules/5.3.13

i guess the ov5647 worked

I have also ordered a camera, its a v1 version, and its s clone with  ov5647 sensor

that might be what i have here too, but im not 100 percent shure
all i can say it that it says 5MP Camera on the box and it does not look like an original

raspistill -o test.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

not shure what thas means

can you share your dmesg

dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.3.13 (root@RPi1) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 Sun Nov 24 23:52:20 UTC 2019
[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] OF: fdt: Machine model: Raspberry Pi Model B
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 8 MiB at 0x17800000
[    0.000000] On node 0 totalpages: 98304
[    0.000000]   Normal zone: 864 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 98304 pages, LIFO batch:31
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 97440
[    0.000000] Kernel command line: earlyprintk=serial,ttyAMA0,115200n8 console=ttyAMA0,115200n8 console=tty0 root=/dev/mmcblk0p2 rw rootfstype=ext4 elevator=noop fsck.repair=yes rootwait smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 selinux=0 noinitrd
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 369980K/393216K available (6941K kernel code, 666K rwdata, 2188K rodata, 472K init, 783K bss, 15044K reserved, 8192K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] ftrace: allocating 24904 entries in 49 pages
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x2f0/0x520 with crng_init=0
[    0.000024] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 2147483647500ns
[    0.000085] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns
[    0.000195] bcm2835: system timer (irq = 27)
[    0.000764] Console: colour dummy device 80x30
[    0.001250] printk: console [tty0] enabled
[    0.001355] Calibrating delay loop... 697.95 BogoMIPS (lpj=3489792)
[    0.050389] pid_max: default: 32768 minimum: 301
[    0.051038] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.051118] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.053102] CPU: Testing write buffer coherency: ok
[    0.055073] Setting up static identity map for 0x8200 - 0x8238
[    0.056333] devtmpfs: initialized
[    0.064536] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
[    0.065117] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.065210] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.066803] pinctrl core: initialized pinctrl subsystem
[    0.068922] NET: Registered protocol family 16
[    0.073107] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.078265] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[    0.078353] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.078574] Serial: AMBA PL011 UART driver
[    0.123743] SCSI subsystem initialized
[    0.124119] usbcore: registered new interface driver usbfs
[    0.124290] usbcore: registered new interface driver hub
[    0.124603] usbcore: registered new device driver usb
[    0.127298] clocksource: Switched to clocksource timer
[    1.370853] VFS: Disk quotas dquot_6.6.0
[    1.371084] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.371568] FS-Cache: Loaded
[    1.371972] CacheFiles: Loaded
[    1.372509] simple-framebuffer 1e513000.framebuffer: framebuffer at 0x1e513000, 0x6d8c00 bytes, mapped to 0x(ptrval)
[    1.372585] simple-framebuffer 1e513000.framebuffer: format=a8r8g8b8, mode=1824x984x32, linelength=7296
[    1.435411] Console: switching to colour frame buffer device 228x61
[    1.492195] simple-framebuffer 1e513000.framebuffer: fb0: simplefb registered!
[    1.514385] thermal_sys: Registered thermal governor 'step_wise'
[    1.515303] NET: Registered protocol family 2
[    1.517674] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    1.518271] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    1.518833] TCP bind hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    1.519365] TCP: Hash tables configured (established 4096 bind 4096)
[    1.519963] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    1.520409] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    1.521371] NET: Registered protocol family 1
[    1.523060] RPC: Registered named UNIX socket transport module.
[    1.523466] RPC: Registered udp transport module.
[    1.523763] RPC: Registered tcp transport module.
[    1.524055] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.525876] hw perfevents: no irqs for PMU, sampling events not supported
[    1.526387] hw perfevents: enabled with armv6_1176 PMU driver, 3 counters available
[    1.531262] Initialise system trusted keyrings
[    1.532173] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    1.551626] FS-Cache: Netfs 'nfs' registered for caching
[    1.553892] NFS: Registering the id_resolver key type
[    1.554312] Key type id_resolver registered
[    1.554589] Key type id_legacy registered
[    1.554870] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.558023] Key type asymmetric registered
[    1.558339] Asymmetric key parser 'x509' registered
[    1.558747] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    1.574987] io scheduler mq-deadline registered
[    1.590572] io scheduler kyber registered
[    1.621174] bcm2835-rng 20104000.rng: hwrng registered
[    1.662070] brd: module loaded
[    1.694251] loop: module loaded
[    1.710761] Loading iSCSI transport class v2.0-870.
[    1.727189] usbcore: registered new interface driver smsc95xx
[    1.742572] usbcore: registered new interface driver usb-storage
[    1.757912] mousedev: PS/2 mouse device common for all mice
[    1.774854] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    1.790531] sdhci: Secure Digital Host Controller Interface driver
[    1.805380] sdhci: Copyright(c) Pierre Ossman
[    1.923402] sdhost-bcm2835 20202000.mmc: loaded - DMA enabled (>1)
[    1.938731] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.954875] ledtrig-cpu: registered to indicate activity on CPUs
[    1.970411] hidraw: raw HID events driver (C) Jiri Kosina
[    1.985625] usbcore: registered new interface driver usbhid
[    2.000411] usbhid: USB HID core driver
[    2.016927] bcm2835-mbox 2000b880.mailbox: mailbox enabled
[    2.034475] Initializing XFRM netlink socket
[    2.049945] NET: Registered protocol family 17
[    2.065172] Key type dns_resolver registered
[    2.083151] random: fast init done
[    2.101168] registered taskstats version 1
[    2.116120] Loading compiled-in X.509 certificates
[    2.141526] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
[    2.437028] mmc0: host does not support reading read-only switch, assuming write-enable
[    2.460221] mmc0: new high speed SDHC card at address b368
[    2.493112] mmcblk0: mmc0:b368 SDC   7.51 GiB 
[    4.570418] printk: console [ttyAMA0] enabled
[    4.591116] raspberrypi-firmware soc:firmware: Attached to firmware from 2019-09-24 17:39
[    4.616684]  mmcblk0: p1 p2
[    4.637638] vchiq: vchiq_init_state: slot_zero = (ptrval)
[    4.742394] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    4.765542] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    4.787992] devtmpfs: mounted
[    4.811907] Freeing unused kernel memory: 472K
[    4.830951] This architecture does not have kernel memory protection.
[    4.851895] Run /sbin/init as init process
[    7.570166] udevd[205]: starting version 3.2.7
[    7.670825] random: udevd: uninitialized urandom read (16 bytes read)
[    7.701941] random: udevd: uninitialized urandom read (16 bytes read)
[    7.738178] random: udevd: uninitialized urandom read (16 bytes read)
[    7.804852] udevd[205]: specified group 'kvm' unknown
[    8.010308] udevd[205]: starting eudev-3.2.7
[    9.034724] mc: Linux media interface: v0.10
[    9.257569] i2c-bcm2835 20805000.i2c: Could not read clock-frequency property
[    9.292548] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[    9.478112] videodev: Linux video capture interface: v2.00
[    9.614450] bcm2835_audio bcm2835_audio: card created with 8 channels
[    9.639307] dwc2 20980000.usb: 20980000.usb supply vusb_d not found, using dummy regulator
[    9.773847] dwc2 20980000.usb: 20980000.usb supply vusb_a not found, using dummy regulator
[    9.974168] dwc2 20980000.usb: DWC OTG Controller
[   10.069472] dwc2 20980000.usb: new USB bus registered, assigned bus number 1
[   10.166631] dwc2 20980000.usb: irq 33, io mem 0x20980000
[   10.261776] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.03
[   10.286091] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   10.309098] usb usb1: Product: DWC OTG Controller
[   10.329644] usb usb1: Manufacturer: Linux 5.3.13 dwc2_hsotg
[   10.351052] usb usb1: SerialNumber: 20980000.usb
[   10.678838] hub 1-0:1.0: USB hub found
[   10.698465] hub 1-0:1.0: 1 port detected
[   11.157455] usb 1-1: new high-speed USB device number 2 using dwc2
[   11.427821] usb 1-1: New USB device found, idVendor=0424, idProduct=9512, bcdDevice= 2.00
[   11.451801] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   11.478445] hub 1-1:1.0: USB hub found
[   11.498028] hub 1-1:1.0: 3 ports detected
[   11.837517] usb 1-1.1: new high-speed USB device number 3 using dwc2
[   11.911700] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[   12.008723] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00, bcdDevice= 2.00
[   12.033294] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   12.100916] smsc95xx v1.0.6
[   12.252788] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-20980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:ee:c6:79
[   12.365753] smsc95xx 1-1.1:1.0 enxb827ebeec679: renamed from eth0
[   12.417512] usb 1-1.3: new full-speed USB device number 4 using dwc2
[   12.600837] usb 1-1.3: New USB device found, idVendor=24ae, idProduct=1000, bcdDevice= 1.10
[   12.626232] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   12.650203] usb 1-1.3: Product: Rapoo 2.4G Wireless Touch Desktop 
[   12.672918] usb 1-1.3: Manufacturer: MOSART Semi.
[   12.696387] vc4_v3d 20c00000.v3d: ignoring dependency for device, assuming no driver
[   12.781133] bcm2835-v4l2: scene mode selected 0, was 0
[   12.789366] bcm2835-v4l2: V4L2 device registered as video0 - stills mode > 1280x720
[   12.832787] input: MOSART Semi. Rapoo 2.4G Wireless Touch Desktop  as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:24AE:1000.0001/input/input0
[   12.969408] hid-generic 0003:24AE:1000.0001: input,hidraw0: USB HID v1.10 Keyboard [MOSART Semi. Rapoo 2.4G Wireless Touch Desktop ] on usb-20980000.usb-1.3/input0
[   13.023467] bcm2835-v4l2: Broadcom 2835 MMAL video capture ver 0.0.2 loaded.
[   13.074898] input: MOSART Semi. Rapoo 2.4G Wireless Touch Desktop  Mouse as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.1/0003:24AE:1000.0002/input/input1
[   13.158739] input: MOSART Semi. Rapoo 2.4G Wireless Touch Desktop  Consumer Control as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.1/0003:24AE:1000.0002/input/input2
[   13.277997] input: MOSART Semi. Rapoo 2.4G Wireless Touch Desktop  System Control as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.1/0003:24AE:1000.0002/input/input3
[   13.316001] input: MOSART Semi. Rapoo 2.4G Wireless Touch Desktop  as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.1/0003:24AE:1000.0002/input/input4
[   13.355588] hid-generic 0003:24AE:1000.0002: input,hiddev96,hidraw1: USB HID v1.10 Mouse [MOSART Semi. Rapoo 2.4G Wireless Touch Desktop ] on usb-20980000.usb-1.3/input1
[   13.563077] random: crng init done
[   13.586268] random: 1 urandom warning(s) missed due to ratelimiting
[   17.546818] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   18.368828] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   22.048121] zram: Added device: zram0
[   22.468323] zram0: detected capacity change from 0 to 104857600
[   23.116812] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[   23.681788] Adding 102396k swap on /dev/zram0.  Priority:1 extents:1 across:102396k SSFS
[   31.742396] NET: Registered protocol family 10
[   31.806014] Segment Routing with IPv6
[  228.374853] smsc95xx 1-1.1:1.0 enxb827ebeec679: hardware isn't capable of remote wakeup
[  229.998161] smsc95xx 1-1.1:1.0 enxb827ebeec679: link up, 100Mbps, full-duplex, lpa 0xC5E1

Offline

#6 2021-01-05 17:01:46

tuxd3v
Member
Registered: 2019-11-14
Posts: 183  

Re: Raspberry Camera raspistill/raspivid

alphalpha wrote:

i guess the ov5647 worked

that might be what i have here too, but im not 100 percent shure
all i can say it that it says 5MP Camera on the box and it does not look like an original

yeah, if it says 5Mpix, should be a OmniVision ov5647 sensor..

alphalpha wrote:
raspistill -o test.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

not shure what thas means

that is the current problem..
if you have loaded the kernel module, and have 128mb for gpu_mem, it should work..

C0rnelious has a optimization:

echo 'SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"' > /etc/udev/rules.d/10-vchiq-permissions.rules
echo 'SUBSYSTEM=="vcio",GROUP="video",MODE="0660"' >> /etc/udev/rules.d/10-vchiq-permissions.rules
echo 'SUBSYSTEM=="vc-mem",GROUP="video",MODE="0660"' >> /etc/udev/rules.d/10-vchiq-permissions.rules

then reboot, and load the module ov5647 again, and test with root user..

the userland code also has test functionalities..
for example:

vcgencmd measure_volts
vcgencmd measure_temp
vcgencmd pm_get_status
mmal_vc_diag stats
mmal_vc_diag camerainfo -- this one is very relevant..
mmal_vc_diag mmal-stats
vchiq_test -p 1
vchiq_test -f 1
vchiq_test -b 10
etc

You can find those commands, and others in '/opt/vc/bin', check if the camera cable if attached in the correct way..
also you can find in '/opt/vc/src/hello_pi', a full set of examples and testing apps.. to build them all you just need to issue:

apt-get install libfreetype6-dev
chmod +x /opt/vc/src/hello_pi/rebuild.sh
cd /opt/vc/src/hello_pi
./rebuild.sh

from those , I was only able to run:
/opt/vc/src/hello_pi/hello_world/hello_world.bin

but I am also waiting for the camera sad


Best Regards,
tux

Offline

#7 2021-03-21 00:04:07

tuxd3v
Member
Registered: 2019-11-14
Posts: 183  

Re: Raspberry Camera raspistill/raspivid

Hello alphalpha,
How are you?

Just to tell you that my Pi Camera arrived, its a V1 version.. smile

I just downloaded the latest version of Devuan for RPi v1 here,
And everything seems to work out of the box... yeah very very nice, no tricks smile

You just need to make sure, in '/boot/config.txt' that you enable:

gpu_mem=128
start_x=1
# then reboot

And that's it, don't need any more tweaks smile

Some commands to test wink

vcgencmd version
vcgencmd measure_volts
vcgencmd measure_temp
vcgencmd pm_get_status
mmal_vc_diag stats
mmal_vc_diag camerainfo
mmal_vc_diag mmal-stats
vchiq_test -p 1
vchiq_test -f 1
vchiq_test -b 10

Commands to take pictures and videos:

# basic command for pictures..see list of options..
raspistill -o test.jpg
# basic command for video 1280*720( 720p ) 60 fps, of 10 seconds h264..see list of options..
raspivid -w 1280 -h 720 -fps 60 -t 10000 -o video.h264

For me it is working nicely smile

Last edited by tuxd3v (2021-03-21 00:04:53)


Best Regards,
tux

Offline

Board footer