Score:1

Webcam works as root but not as normal user: what permissions do I need to change?

kw flag

When I run cheeseas root, I can see the video stream from my webcam just fine. However, when I run it as a normal user, I get "No device found". The normal user in question is in a group (video) that has read and write permission on the relevant device file /dev/video0. How do I get webcam access as a normal user, please?

Output from cheese run as root is:

(cheese:5512): GLib-GObject-CRITICAL **: 14:43:01.263:
g_value_dup_string: assertion 'G_VALUE_HOLDS_STRING (value)' failed
(cheese:5512): GLib-GObject-CRITICAL **: 14:43:03.915:
g_value_dup_string: assertion 'G_VALUE_HOLDS_STRING (value)' failed
root@verderer:~# cheese
(cheese:5786): GLib-GObject-CRITICAL **: 14:58:42.863:
g_value_dup_string: assertion 'G_VALUE_HOLDS_STRING (value)' failed
(cheese:5786): GLib-GObject-CRITICAL **: 14:58:45.498:
g_value_dup_string: assertion 'G_VALUE_HOLDS_STRING (value)' failed

Output from cheese run as normal user is:

(cheese:5650): Gdk-WARNING **: 14:47:18.091: Native Windows taller
than 65535 pixels are not supported
** Message: 14:47:18.151: cheese-application.vala:222: Error during camera setup: No device found
(cheese:5650): cheese-CRITICAL **: 14:47:18.185:
cheese_camera_device_get_name: assertion 'CHEESE_IS_CAMERA_DEVICE
(device)' failed
(cheese:5650): GLib-CRITICAL **: 14:47:18.185: g_variant_new_string:
assertion 'string != NULL' failed
(cheese:5650): GLib-CRITICAL **: 14:47:18.185: g_variant_ref_sink:
assertion 'value != NULL' failed
(cheese:5650): GLib-GIO-CRITICAL **: 14:47:18.185:
g_settings_schema_key_type_check: assertion 'value != NULL' failed
(cheese:5650): GLib-CRITICAL **: 14:47:18.185:
g_variant_get_type_string: assertion 'value != NULL' failed
(cheese:5650): GLib-GIO-CRITICAL **: 14:47:18.185:
> g_settings_set_value: key 'camera' in 'org.gnome.Cheese' expects type's', but a GVariant of type '(null)' was given
(cheese:5650): GLib-CRITICAL **: 14:47:18.185: g_variant_unref:
assertion 'value != NULL' failed
** (cheese:5650): CRITICAL **: 14:47:18.185: cheese_preferences_dialog_setup_resolutions_for_device: assertion
'device != NULL' failed
Daniel Hatton avatar
kw flag
Would the downvoter care to provide reasoning? Have I missed an easily-Googlable solution again?
Daniel Hatton avatar
kw flag
Potentially relevant extra datum: linphone run as the same normal user _does_ detect that a camera is present; when I click linphone's "video preview" button, linphone manages to turn on a green LED on the camera, but then crashes and coredumps, with no image ever shown.
Daniel Hatton avatar
kw flag
More data: uvccapture run as the same normal user fails to capture an image, with the error message "ioctl querycontrol error 22"; however, guvcview run as the same normal user can successfully display, record, and capture stills from the video stream (although even guvcview repeatedly complains about "V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Inappropriate ioctl for device").
Score:-3
it flag

Look at the ownership and permissions of your camera: ls -l /dev/video*. Notice that it allows rw access to members of the video group.

Add yourself to the video group, with this command:

sudo adduser $USER video 

Then fully logout and login. Group membership is applied by login (and the newgrp command).

Daniel Hatton avatar
kw flag
Already done that. I thought I mentioned that n the question, didn't I?
waltinator avatar
it flag
Already done what? [Edit] your Question and show us (as "normal user ") `id;ls -l /dev/video*` on your system.
Daniel Hatton avatar
kw flag
Already added the relevant normal user to group "video" and logged out and back in. Output of the command you suggest is uid=1000(dan) gid=1000(dan) groups=1000(dan),4(adm),24(cdrom),27(sudo),30(dip),44(video),46(plugdev),110(render),122(lpadmin),135(lxd),136(sambashare),138(docker),1002(compilers) crw-rw----+ 1 root video 81, 0 Jun 7 10:59 /dev/video0
waltinator avatar
it flag
Comments are designed for US to ask YOU questions about your Question. You should [Edit] your question to add information. By updating your Question, and using the formatting buttons, you make all the information available to new readers. People shouldn't have to read a long series of comments to get the whole story. AskUbuntu is a Question and Answer site, not a conversation site. If you have an update, [edit] your Question. If you have a new question, see [Ask].
Daniel Hatton avatar
kw flag
The information is already in the question.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.