geekinthesticks
Posts: 97
Joined: Fri Feb 08, 2013 7:22 pm

ArchlinuxARM Need to Use sudo to Access Camera

Mon Aug 05, 2019 9:16 am

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?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7456
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: ArchlinuxARM Need to Use sudo to Access Camera

Mon Aug 05, 2019 12:09 pm

Check the permissions on /dev/vcsm (or /dev/vcsm-cma if they've enabled it - it's the rewrite that is in progress).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

geekinthesticks
Posts: 97
Joined: Fri Feb 08, 2013 7:22 pm

Re: ArchlinuxARM Need to Use sudo to Access Camera

Mon Aug 05, 2019 3:42 pm

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.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7456
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: ArchlinuxARM Need to Use sudo to Access Camera

Mon Aug 05, 2019 3:58 pm

The Raspbian default for /dev/vcsm is

Code: Select all

crw-rw---- 1 root video 244, 0 Aug  5 16:55 /dev/vcsm
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

geekinthesticks
Posts: 97
Joined: Fri Feb 08, 2013 7:22 pm

Re: ArchlinuxARM Need to Use sudo to Access Camera

Tue Aug 06, 2019 8:26 am

Thanks. Will adjust permissions accordingly.

geekinthesticks
Posts: 97
Joined: Fri Feb 08, 2013 7:22 pm

Re: ArchlinuxARM Need to Use sudo to Access Camera

Tue Aug 06, 2019 2:16 pm

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

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7456
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: ArchlinuxARM Need to Use sudo to Access Camera

Tue Aug 06, 2019 2:32 pm

Look at your udev rules. Raspbian has a file /lib/udev/rules.d/10-local-rpi.rules

Code: Select all

[email protected]:/ $ 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"
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Arch”