Snap app denied access to /dev/video0 by AppArmor after kernel update on Ubuntu 22.04
Environment
Ubuntu 22.04 desktop upgraded kernel recently; camera is a UVC webcam exposed as /dev/video0; application installed as a snap (example: snap 'cheese' or a snap-packaged videoconferencing client).
Symptoms
Snap application shows a black preview and immediately exits or freezes when attempting to open the camera. Native (apt) applications such as guvcview can open the camera successfully.
Observations
dmesg and journalctl show AppArmor DENIED messages referencing the snap process trying to open /dev/video0. 'snap connections <snap-name>' shows the 'camera' interface exists but appears connected; /dev/video0 owner/group is root:video and user is in the video group. After running 'snap connect <snap>:camera' and rebooting, AppArmor DENIED entries persist.
Already attempted
Connected the snap's camera interface, added user to video group, reinstalled the snap, rebooted, tested the camera with a non-snap program (works), created a udev rule to set /dev/video0 permissions (no effect on AppArmor denial), tried running the snap in devmode (worked, but devmode disables confinement and is not acceptable long term).
Question
What steps will allow the confined snap to access the camera persistently without disabling confinement, and what diagnostics should I run to determine whether this is a snapd/AppArmor regression after the kernel update?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags