Face unlock: say why a camera can't be used, list the cameras, pick one
CI / test (push) Canceled after 21m7s

"no camera at PATH" now says why (not there or a broken link, permission
denied, not a V4L2 device, a metadata node rather than the picture node,
OpenCV couldn't start it or it gives no picture: another app using it) and
lists the cameras found (VIDIOC_QUERYCAP on /dev/v4l/by-id/* and /dev/video*).
New commands: `chandra-face cameras`, `chandra-face set-camera PATH` (root,
edits device in face.conf after checking it is a capture node). The Face
unlock window shows the cameras found with a Use button (one password), then
opens again. just install prints NOT READY with the reason when the
configured camera can't be used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhiJfJNAYqWzQiuKMf
This commit is contained in:
Claude committed 2026-11-26 04:47:06 +00:00
1 parent ff6f733810
commit 516180196f
7 files changed
+251 -9

No files matched your search

+8
View File
@@ -69,6 +69,8 @@ chandra-face clear # forget every face
chandra-face pam enable polkit-1 sudo
chandra-face pam disable # polkit-1 and sudo by default
chandra-face status # what is set up, what is missing
chandra-face cameras # the cameras here, and why one can't be used
sudo chandra-face set-camera /dev/v4l/by-id/usb-...-video-index0 # use that one
just uninstall [--purge] # takes it out of every PAM service first (--purge: faces too)
```
@@ -131,6 +133,12 @@ store = /var/lib/chandra-face
models = /usr/local/share/chandra/face
```
When the configured camera can't be used, every command and the Face unlock window say why
(not there, a broken link, permission denied, a metadata node rather than the picture node, busy
in another app) and list the cameras found; the window has a **Use** button for each one that
takes pictures (it saves `device` as root, so the password is asked, and opens again). A
by-id camera usually has two nodes: `-video-index0` is the picture, `-video-index1` metadata.
`chandra-face test` prints the score of each frame, which helps pick a threshold for your camera.
## How it works