No permission to access webcam on linux

2

I am using a raspberry pi with raspbian to capture webcam shots and upload them to a web server. However, when I rebooted just now I no longer have access to the webcam. I have no idea why this suddenly happened, I didn't change anything as far as I know before I rebooted. I just chowned and chmoded an unrelated file (bash script), and added a cron job. Even logged in as root I cannot access the webcam. These are error messages I get when I try to utilize the webcam in various ways:

libv4l2: error turning on stream: Operation not permitted
v4l2: ioctl(fildes = 3 "/dev/video0", request = VIDIOC_STREAMON, int *data = {       V4L2_BUF_TYPE_VIDEO_CAPTURE }) failed, Operation not permitted (1, EPERM) because the process does not have the appropriate privileges to use the ioctl VIDIOC_STREAMON system call

Fatal Python error: (pygame parachute) Segmentation Fault

error: ioctl(VIDIOC_STREAMON) failure : 1, Operation not permitted

Does anyone know what could be wrong?

GrixM

Posted 2012-12-23T11:08:03.833

Reputation: 121

Show us your code, please. – ymn – 2012-12-25T08:33:40.190

Answers

3

I know this question has been around for a while but I hate to see unanswered questions so to satisfy my ocd.....

Had a similar problem and after some googling I found this solution worked for me, you need to remove and recreate the /dev/video0 driver.

sudo rmmod bcm2835-v4l2
sudo modprobe bcm2835-v4l2

After this it came back to life for me.

Status420

Posted 2012-12-23T11:08:03.833

Reputation: 31