LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   TVTime works for main user, but not for 2nd user... (https://www.linuxquestions.org/questions/ubuntu-63/tvtime-works-for-main-user-but-not-for-2nd-user-564043/)

el amigo* 06-23-2007 06:03 PM

TVTime works for main user, but not for 2nd user...
 
Hi all,

I am using Ubuntu Feisty, i386. I successfully watch TV with TVTime, from my tv-card. That is from my own user account.

Now I created a user account for my wife, with all the user's privileges enables (audio, video etc...), but whenever I open TVTime from her account, it's a blue screen with this message : "Permission denied, cannot open capture device /dev/video0"

Just a precision, I also multiboot Ubuntu on that box with Fedora 7 & PCLinuxOS 2007, and don't have any such problem in those other systems.

I am very curious to know how to solve that problem, and learn a new trick.

Don't hesitate to give me an idea...

Thank you all in advance for your time and for your help.

blackhole54 06-24-2007 02:19 AM

Quote:

Originally Posted by el amigo*
but whenever I open TVTime from her account, it's a blue screen with this message : "Permission denied, cannot open capture device /dev/video0"

From the error message, it sounds like it is an issue with the ownership and/or permissions on /dev/video0.

Use the command ls -l /dev/video0 to examine these. You might find the solution is as easy as making your wife a member of another group (remember she has to log out and log back in for the change to take effect), or you might actually have to change the ownership/permissions on that device. I don't know if I can help with the last since I am not yet very familiar with udev

el amigo* 06-24-2007 06:09 AM

Here is what it gives me :
PHP Code:

martin@spc1:~$ sudo ls -/dev/video0
Password
:
crw-rw---- 1 root video 810 2007-06-24 06:15 /dev/video0
martin
@spc1:~$ 


el amigo* 06-24-2007 06:29 AM

Thank you, Blackhole54, as I experimented what you suggested, and it works now.

What I did was simply in terminal to "sudo nautilus", then i went to /dev/video0, right-clicked, opened "Properties", and on "Permissions", I chose "read & write", and enabled "open as a program".

It works !

el amigo* 06-24-2007 06:30 AM

Now that it works, here's what it gives me :
PHP Code:

martin@spc1:~$ sudo ls -/dev/video0
crwxrwxrwx 1 root video 81
0 2007-06-24 06:15 /dev/video0 

I hope this thread might help other users with the same issue.

blackhole54 06-24-2007 08:14 PM

I'm glad you got it working.

Just for information, what you did was give everybody read, write, and execute permissions to this device. Since this is pretty much a private computer that is OK. On a more public computer, if you were concerned about security you could turn off the permissions for "other", and then only users who were members of the video group could use it. Also, since you were able to use it from your account before you changed things, I suspect you do not need the execute bit set. Finally, I wonder if your wife really was a member of the video group. When you are logged into an account, you can check the groups thatr user is in by typing groups.

There is a saying "if it ain't broke, don't fix it" -- so perhaps you just want to leave things as they are. Or to "learn so new tricks" you could play a bit more with permissions as I have suggested.

el amigo* 06-26-2007 06:54 AM

Good morning Blackhole54,

Strange thing... Yesterday my wife uses her account, and tells me : "tv doesn't work !"

That is a day or two after our discussion here... It seems the system has reseted to its default config, as of /dev/video0 's permissions...

So this is my morning's coffee time, and I check it :

PHP Code:

martin@spc1:~$ sudo ls -/dev/video0
Password
:
crw-rw---- 1 root video 810 2007-06-26 06:30 /dev/video0
martin
@spc1:~$ groups
martin adm dialout fax cdrom floppy tape audio dip video plugdev scanner netdev lpadmin powerdev admin fuse 

I am looking for a way to make the permissions permanent...

-Do you have an idea ?

Thanks in advance...

tredegar 06-26-2007 07:36 AM

Quote:

I am looking for a way to make the permissions permanent...
The change is permissions for the device /dev/video0 is probably managed by some wretched HAL or hotplug or udev or similar daemon that runs at boot and creates /dev/video with those permissions. Rather than mess with all that, do the "proper" thing, and just add wife to the group video like this:

sudo useradd -g video wifesusername Edit Nope, I got this wrong, the command should be:
sudo usermod -aG video wifesusername see below./Edit

Then the TV should work. Even after a reboot!

Edit blackhole54 suggested this at the start of this thread - just do it!

blackhole54 06-26-2007 11:03 PM

Quote:

Originally Posted by el amigo*
Code:

martin@spc1:~$ groups
martin adm dialout fax cdrom floppy tape audio dip video plugdev scanner netdev lpadmin powerdev admin fuse


Am I correct that you are user martin? If so, run the groups command from your wife's account and verify that she is a member of the video group. Remember, if you add your wife to this group as tredegar explained, then you (she) must log out of the account and back in before the changed takes effect.

Quote:

I am looking for a way to make the permissions permanent...
I believe that those permissions are controlled by udev. There are configuration files that control this (perhaps under /etc/udev?), but as I have indicated earlier, I have not yet climbed that learning curve. You should be able to find info on the Internet about how to do it. You can probably find something by searching Linux Questions.

el amigo* 06-27-2007 06:21 PM

that's what it gives me :
[HTML]martin@spc1:~$ sudo useradd -g video francis
Password:
useradd: user francis exists[/HTML]

el amigo* 06-27-2007 06:36 PM

Of course, your guys were right :

PHP Code:

francis@spc1:~$ groups
francis adm dialout fax cdrom floppy tape audio dip plugdev scanner powerdev fuse 

Now I just have to find the right way to add her in the video group...

Thank you both for your input !

blackhole54 06-27-2007 09:53 PM

Quote:

Originally Posted by el amigo*
Now I just have to find the right way to add her in the video group...

According to usermod's man page:

sudo usermod -aG video francis

Make sure to include the "a" or else you will delete all of the existing groups she is in. I gave you the man page reference because I have never done it this way -- I have always directly edited the /etc/group file. If you decide to directly edit the file, make sure you first make a backup copy of the existing file so you can go back if you make a mistake. (It is always a good idea to make a backup copy of any configuration file before you edit it. Particularly while you are still learning what you are doing.)

I should have read tredegar's post a little more carefully. The command he gave you adds a new user account rather than modifying an existing user's account.

el amigo* 06-29-2007 02:30 PM

sudo usermod -aG video francis

That seems to work great ! Thank you very much !

PHP Code:

francis@spc1:~$ groups
francis adm dialout fax cdrom floppy tape audio dip video plugdev scanner powerdev fuse 


tredegar 06-30-2007 04:26 AM

Quote:

I should have read tredegar's post a little more carefully. The command he gave you adds a new user account rather than modifying an existing user's account.
Oops. Sorry. Pleased the problem is fixed at last! I've edited my post above to point out my error.

blackhole54 06-30-2007 04:59 AM

Quote:

Originally Posted by tredegar
I've edited my post above to point out my error.

tredegar,

we've all had days like this! :) You changed from -g to -G (which I eventually spotted, but for brevity I didn't mention earlier), but you still show the command to add a user account rather than the command to modify an exisiting account. (I am not trying to be picky here. I am just trying to look out for the future lost souls who are trying to solve their problems using this thread. :) Yeah, I've been that confused, lost soul too!)

EDIT: And now everything about this thread seems to have be wrapped up and squared away nicely!:p


All times are GMT -5. The time now is 10:37 PM.