diddlesnaps / fakecam

Virtual Backgrounds for your video conferences and streaming presentations
Other
47 stars 10 forks source link

Fakecam installed as Snap Application not opens the Webcam - Fails the open #24

Closed luisaureliocasoni closed 3 years ago

luisaureliocasoni commented 3 years ago

Hello,

I have installed the Fakecam on Snap Store, both the stable and beta versions. The versions are sucessful installed on the snap command, but when I execute the fakecam command, the output says when the file /dev/video0 is failed to open. But, when I open the webcam using mpv, the webcam (on /dev/video0, not in /dev/video1) opens normally.

Output when I execute the fakecam command on stable version (2.2.0):

➜  ~ fakecam
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
No background specified. will blur your background instead.
Starting capture using device: /dev/video0
Failed to open /dev/video0

Output when I execute the fakecam command on beta version (3.0.0):

➜  ~ fakecam
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
Warning: Schema “org.gnome.system.locale” has path “/system/locale/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy” has path “/system/proxy/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.http” has path “/system/proxy/http/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.https” has path “/system/proxy/https/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.ftp” has path “/system/proxy/ftp/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.socks” has path “/system/proxy/socks/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
/snap/fakecam/112/gnome-platform/usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0: /snap/fakecam/112/gnome-platform/usr/lib/x86_64-linux-gnu/libffi.so.7: no version information available (required by /snap/fakecam/112/usr/lib/x86_64-linux-gnu/libwayland-client.so.0)
No background specified. will blur your background instead.
[ERROR:0] global /root/parts/opencv/src/modules/dnn/src/vkcom/src/context.cpp (197) Context Vulkan check failed, result = -9
[ERROR:0] global /root/parts/opencv/src/modules/dnn/src/vkcom/src/context.cpp (105) isAvailable Failed to init Vulkan environment. OpenCV(4.5.1) /root/parts/opencv/src/modules/dnn/src/vkcom/src/context.cpp:197: error: (-2:Unspecified error) Vulkan check failed in function 'Context'

Using OpenCL for image manipulation
Starting capture using device: /dev/video0
Failed to open /dev/video0

Next, some notes:

  1. I have Manjaro Linux KDE 21.0.7 installed, running on Linux 5.11.22-2 kernel version;
  2. I have installed the v4l2loopback-dkms package using pacman;
  3. I have configured the v42, using the snapcraft instructions, executed the commands sudo modprobe -r v4l2loopback; sudo modprobe v4l2loopback and rebooted the machine. Next, I comprove this:
    ➜  ~ cat /etc/modprobe.d/fakecam.conf 
    options v4l2loopback devices=1 video_nr=20 card_label="fakecam" exclusive_caps=1
    ➜  ~ cat /etc/modules-load.d/fakecam.conf 
    v4l2loopback
  4. Next, a list of my connected video devices:
    
    ➜  ~ v4l2-ctl --list-devices
    fakecam (platform:v4l2loopback-000):
    /dev/video20

Integrated_Webcam_HD: Integrate (usb-0000:00:14.0-5): /dev/video0 /dev/video1

5. Next, a list of errors of access denied:

➜ ~ sudo journalctl -e --no-pager | grep DENIED jun 19 18:00:34 aurelio-inspiron3576 audit[44496]: AVC apparmor="DENIED" operation="open" profile="snap.fakecam.fakecam" name="/proc/44496/mounts" pid=44496 comm="python3" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000 jun 19 18:00:34 aurelio-inspiron3576 kernel: audit: type=1400 audit(1624140034.919:1044): apparmor="DENIED" operation="open" profile="snap.fakecam.fakecam" name="/proc/44496/mounts" pid=44496 comm="python3" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000 jun 19 18:00:36 aurelio-inspiron3576 audit[44687]: AVC apparmor="DENIED" operation="open" profile="snap.fakecam.fakecam" name="/dev/video0" pid=44687 comm="python3" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=0 jun 19 18:00:36 aurelio-inspiron3576 kernel: audit: type=1400 audit(1624140036.393:1045): apparmor="DENIED" operation="open" profile="snap.fakecam.fakecam" name="/dev/video0" pid=44687 comm="python3" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=0 jun 19 18:08:31 aurelio-inspiron3576 audit[49304]: AVC apparmor="DENIED" operation="open" profile="snap.fakecam.fakecam" name="/dev/video0" pid=49304 comm="python3" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=0 jun 19 18:14:03 aurelio-inspiron3576 audit[51974]: AVC apparmor="DENIED" operation="open" profile="snap.fakecam.fakecam" name="/dev/video0" pid=51974 comm="python3" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=0



Thanks for help. 
lucyllewy commented 3 years ago

Seemingly your installation hasn't enabled the camera permission. You can verify that with snap connections fakecam which will show either fakecam:camera unconnected if the permission isn't set (my assumption), or connected to :camera if it is.

To enable the permission run sudo snap connect fakecam:camera.

luisaureliocasoni commented 3 years ago

@diddledan I have connected and it works. Perdon for my error.

Thanks for your help.