FedoraForum.org - Fedora Support Forums and Community
Results 1 to 12 of 12
  1. #1
    Join Date
    May 2005
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    /dev/video0

    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.

  2. #2
    Join Date
    Aug 2004
    Posts
    4,256
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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/showth...device-manager
    "Never let the task you are trying to accomplish distract you from the study of computers."

  3. #3
    simonn Guest
    Edit /etc/udev/rules.d/50-udev.rules and search on "video"

    You should find:

    Code:
    KERNEL=="video*",		MODE="0660"
    Change it to:

    Code:
    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:

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

  4. #4
    Join Date
    May 2005
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    Code:
    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.

  5. #5
    Join Date
    Aug 2004
    Posts
    4,256
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hmm... what about /etc/security/console.perms
    "Never let the task you are trying to accomplish distract you from the study of computers."

  6. #6
    Join Date
    May 2005
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    Code:
    KERNEL=="video*",		GROUP="webcam", MODE="0666"
    The video devices look exactly as they did before
    Code:
    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

  7. #7
    Join Date
    Aug 2004
    Posts
    4,256
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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.
    "Never let the task you are trying to accomplish distract you from the study of computers."

  8. #8
    simonn Guest
    Even kludgier is just to create /dev/video0 with mknod and copy it do /etc/udev/devices


    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:

    Code:
    <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.

  9. #9
    kmberry Guest
    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.
    Last edited by kmberry; 4th March 2006 at 04:03 AM.

  10. #10
    Join Date
    Sep 2007
    Location
    Cambodia
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hamlet - O, from this time forth, my thoughts be bloody, or be nothing worth !
    Shakespeare "Halmet" Act IV, Scene 4
    Registered Linux user number 418565

  11. #11
    Join Date
    May 2008
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by simonn
    Edit /etc/udev/rules.d/50-udev.rules and search on "video"

    You should find:

    Code:
    KERNEL=="video*",		MODE="0660"
    Change it to:

    Code:
    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:

    Code:
    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:

    Code:
    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... I am using FC 10....

    I checked output of my usb:

    Code:
    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

  12. #12
    Join Date
    Sep 2007
    Location
    Cambodia
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    Last edited by Peacepunk; 13th February 2009 at 05:14 AM.
    Hamlet - O, from this time forth, my thoughts be bloody, or be nothing worth !
    Shakespeare "Halmet" Act IV, Scene 4
    Registered Linux user number 418565

Similar Threads

  1. Missing /dev/video0
    By dscott in forum Hardware
    Replies: 1
    Last Post: 22nd July 2009, 07:59 PM
  2. mplayer with /dev/video0
    By uativan in forum Hardware
    Replies: 9
    Last Post: 7th April 2009, 05:13 PM
  3. /dev/video0 lost
    By Gallan in forum Hardware
    Replies: 0
    Last Post: 6th January 2007, 10:32 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •