PDA

View Full Version : /dev/video0


alongwor
8th February 2006, 09:00 PM
Hi all,

I am running a Logitech webcam (STX) on my FC4 box. I have built and installed the spca5xx drivers for it and it appears to work fine other than one issue.
After each reboot the permissions for the device /dev/video0 are set as follows

lrwxrwxrwx 1 root root 6 Feb 8 20:50 /dev/video -> video0
crw------- 1 root root 81, 0 Feb 8 20:50 /dev/video0


So only root can access the device. If I manually change the permissions its fine until a reboot.
Does anyone know how to change this so that the permissions are correct for all users?

thanks,

Andy.

tashirosgt
9th February 2006, 03:26 AM
This is just a guess, since I don't know if udev mounts the devices at bootup but perhaps editiing whaterver file is in
the directory /etc/udev/permissions.d would work. I don't know if hald is also involved in your device - as in:
http://forums.fedoraforum.org/showthread.php?t=52143&highlight=hal-device-manager

simonn
9th February 2006, 03:48 AM
Edit /etc/udev/rules.d/50-udev.rules and search on "video"

You should find:


KERNEL=="video*", MODE="0660"


Change it to:


KERNEL=="video*", MODE="0666"


Although, what I would do is create a group called webcam and make any user you want to have access to the webcam a member of it. Then change to above to:


KERNEL=="video*", MODE="0660", GROUP="webcam"

alongwor
9th February 2006, 08:33 PM
Thanks for the sugestions guys.
I tried what you said and it has changed the permissions on the dev and I added myself to a group called webcam (also added the group to the rules file :) ) but I am still getting the message
open /dev/video: Permission denied
when trying to start camE as any user other than root. It isnt creating any messages in /var/log/messages.
Does anyone have any more ideas on how to trouble shoot this?

thanks in advance,

Andy.

tashirosgt
10th February 2006, 03:37 AM
Hmm... what about /etc/security/console.perms

alongwor
10th February 2006, 04:17 PM
Hi,
I took another look at what is what and discovered two things.

1) If the device is plugged in after the machine boots, then it works fine and a non root user can access the device.
2) If the device is present when the machine boots - the permissions are not set on the device even with following line in /etc/udev/rules.d/50-udev.rules
KERNEL=="video*", GROUP="webcam", MODE="0666"
The video devices look exactly as they did before
lrwxrwxrwx 1 root root 6 Feb 8 20:50 /dev/video -> video0
crw------- 1 root root 81, 0 Feb 8 20:50 /dev/video0
If I manually (as root) update the device to 666 and try to access again as a normal user, all is fine. I have tried to explicitly specify video0 in the udev.rules file but that didnt seem to work.
Does anyone have any idea how to permanently set the permissions on this?

Cheers,
Andy

tashirosgt
10th February 2006, 08:07 PM
Actually doing something useful with a computer cuts into the time one can spend configuring it. If you are trying to make the computer useful, the kludgy thing to do is to put a script in /etc/rc.d/rc.local that sets the permissions. If (like me) you are more interested in knowing the right way to configure it, don't do that.

simonn
13th February 2006, 12:26 AM
Even kludgier is just to create /dev/video0 with mknod and copy it do /etc/udev/devices :D


pam does sound like a likely culprit.

Assuming you have a webcam group like my previous post, create a file in /etc/security/console.perms.d called e.g. 99-user.perms

And put:


<v4l>=/dev/video* /dev/radio* /dev/winradio* /dev/vtx* /dev/vbi* \
/dev/video/*

<console> 0660 <v4l> 0660 root.webcam


This should make be self explanatory(?), so if you do not have a webcam group you should be able to figure it out.

kmberry
4th March 2006, 12:22 AM
I had not used my Logitech Express webcam with cvs qc-usb driver on FC5-devel for awhile and had to delete and comment out alot of code in qc-driver.c to get it into the kernel but it worked. Next, I tried ekiga since it replaced gnomemeeting and it only worked as root. Then I googled around and found "tldp.org/HOWTO/Webcam-HOWTO/dev-intro.html" last seen March 3, 2006. I had "KERNEL=="video/*", MODE="0660" " in /etc/udev/rules.d/50-udev.rules and my permissions were "lrwxrwxrwx 1 root root 6 Mar 3 17:07 /dev/video -> video0" and "crw------- 1 root root 81, 0 Mar 3 17:07 /dev/video0" I think, but now I have "crw------- 1 root video 81, 0 Mar 3 17:07 /dev/video0" so it changed after I made a group video, added kmberry to it and did a "chown root:video /dev/video*" followed by "chmod g+rw /dev/video0" which is supposed to be the safe way to allow nonroot access to video. When I did "grep -e video /etc/group" I got "video:x:505:kmberry". I am now on vmlinuz-2.6.15-1.2008_FC5. When I decided to reboot to see if ekiga still worked my computer died on udev first(failed instead of OK), then it got a little further to whatever was next and died again(just blank space after udev OK) and finally booted 3rd time. I was scared I had messed up by changing permissions of video but it looks like udev had to change something. You might not have this problem and I don't know why I did. I rebooted a few times to make sure everything was ok and noticed that something changed the permissions of /dev/video0 to "crw------- 1 kmberry root 81, 0 Mar 3 20:21 /dev/video0". If I change the permissions back to "crw------- 1 root video 81, 0 Mar 3 17:07 /dev/video0" rebooting changes it back again. I don't know whether this is a security risk or not. Now ekiga runs ok as nonroot across boots but permission is not "crw------- 1 root video 81, 0 Mar 3 17:07 /dev/video0". I saw that chgrp could only be done by owner of file so I chgrp to video for /dev/video0 and added root to video and rebooted dying 3 times and this time it died at rc.local too. Now ekiga works again and something changed /dev/video permissions back again. I now have "grep -e video /etc/group video:x:505:kmberry,root" which is probably worse than it was before but everything works. On "www.mythtv.org/wiki/index.php/IVTV_Install" ownership of devices changes automatically when the user logs in.

Peacepunk
12th February 2009, 09:38 AM
http://forums.fedoraforum.org/showpost.php?p=1165063&postcount=2

Worked for me.

Penguins007
13th February 2009, 02:47 AM
Edit /etc/udev/rules.d/50-udev.rules and search on "video"

You should find:


KERNEL=="video*", MODE="0660"


Change it to:


KERNEL=="video*", MODE="0666"


Although, what I would do is create a group called webcam and make any user you want to have access to the webcam a member of it. Then change to above to:


KERNEL=="video*", MODE="0660", GROUP="webcam"


Hope if you can help me?? When I attempt to find " /etc/udev/rules.d/50-udev.rules and search on "video" But my output result:


40-multipath.rules 85-pcscd_ccid.rules
51-packagekit-firmware.rules 85-pcscd_egate.rules
60-libmtp.rules 90-alsa.rules
60-pcmcia.rules 90-hal.rules
60-wacom.rules 91-drm-modeset.rules
70-mdadm.rules 97-bluetooth-serial.rules
70-persistent-cd.rules 99-fuse.rules
70-persistent-net.rules


Which is why my vx-3000 is not working on cheese or ekiga (no video).. I tested window vista and it works... :rolleyes: I am using FC 10....

I checked output of my usb:


Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 046d:c00c Logitech, Inc. Optical Wheel Mouse
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 004: ID 045e:00f5 Microsoft Corp. LifeCam VX-3000
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

:confused::confused::confused:

Peacepunk
13th February 2009, 04:58 AM
Penguins007, did you check the link? I posted that _because_ there is no 50 udev rule anymore.

?? What's the use of trying to help ??

I stumbled on that for two weeks, found a way out by myself, share it & only to find people asking questions answered in the post right above theirs.

Peace. Love, and ZEN computing to you all.