Page 1 of 1

ArchlinuxARM Need to Use sudo to Access Camera

Posted: Mon Aug 05, 2019 9:16 am
by geekinthesticks
I have a pizero w which was running Arch and I could access the camera as a user. However, I hadn't used it for about a year, so did a fresh install of ArchLinux. Now the camera works OK id I run raspistill as sudo, but as a normal user I get:

Code: Select all

picam ~ »  raspistill --nopreview --output 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
After looking at the wiki I made the following changes:

/boot/config.txt

Code: Select all

gpu_mem=128
start_file=start_x.elf 
fixup_file=fixup_x.dat 
initramfs initramfs-linux.img followkernel
cma_lwm= cma_hwm= cma_offline_start=

In /etc/modprobe.d/blacklist.conf I blacklisted :

Code: Select all

blacklist i2c_bcm2708
I have added my user to the video, scanner, storage groups.

Any ideas about what I have missed?

Re: ArchlinuxARM Need to Use sudo to Access Camera

Posted: Mon Aug 05, 2019 12:09 pm
by 6by9
Check the permissions on /dev/vcsm (or /dev/vcsm-cma if they've enabled it - it's the rewrite that is in progress).

Re: ArchlinuxARM Need to Use sudo to Access Camera

Posted: Mon Aug 05, 2019 3:42 pm
by geekinthesticks
Thanks. Permissions were:

Code: Select all

picam ~ » ls -la /dev/vcsm
crw------- 1 root root 244, 0 Jul 22 13:53 /dev/vcsm
picam ~ » ls -la /dev/vcsm-cma
crw-rw-rw- 1 root root 10, 61 Jul 22 13:53 /dev/vcsm-cma

Changing to:

Code: Select all

picam ~ » ls -la /dev/vcsm                         
crw-rw-rw- 1 root root 244, 0 Jul 22 13:53 /dev/vcsm
Has fixed the problem.

Re: ArchlinuxARM Need to Use sudo to Access Camera

Posted: Mon Aug 05, 2019 3:58 pm
by 6by9
The Raspbian default for /dev/vcsm is

Code: Select all

crw-rw---- 1 root video 244, 0 Aug  5 16:55 /dev/vcsm

Re: ArchlinuxARM Need to Use sudo to Access Camera

Posted: Tue Aug 06, 2019 8:26 am
by geekinthesticks
Thanks. Will adjust permissions accordingly.

Re: ArchlinuxARM Need to Use sudo to Access Camera

Posted: Tue Aug 06, 2019 2:16 pm
by geekinthesticks
Bit more information. If I don't give everyone rw permissions, I still get the error. Also if I reboot permissions get set back to:

Code: Select all


picam ~ » ls -la /dev/vcsm
crw------- 1 root root 244, 0 Jul 22 13:53 /dev/vcsm

Re: ArchlinuxARM Need to Use sudo to Access Camera

Posted: Tue Aug 06, 2019 2:32 pm
by 6by9
Look at your udev rules. Raspbian has a file /lib/udev/rules.d/10-local-rpi.rules

Code: Select all

pi@raspberrypi:/ $ cat /lib/udev/rules.d/10-local-rpi.rules 
SUBSYSTEM=="vchiq", GROUP="video", MODE="0660"
SUBSYSTEM=="vc-sm", GROUP="video", MODE="0660"
SUBSYSTEM=="bcm2708_vcio", GROUP="video", MODE="0660"