Face unlock: say why a camera can't be used, list the cameras, pick one
CI / test (push) Canceled after 21m7s
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:
7 files changed
+251
-9
No files matched your search
@@ -167,5 +167,10 @@ if "--no-models" not in sys.argv:
|
||||
subprocess.check_call([py, "-I", helper, "--no-elevate", "fetch-models"])
|
||||
if "--pam" in sys.argv:
|
||||
subprocess.check_call([py, "-I", helper, "--no-elevate", "pam", "enable"])
|
||||
# Say now when it can't work yet (no camera at the configured path, say), and what is there.
|
||||
st = subprocess.run([py, "-I", helper, "--no-elevate", "status", "--machine"], capture_output=True, text=True)
|
||||
for line in st.stdout.splitlines():
|
||||
if line.startswith("problem "):
|
||||
print("face unlock: NOT READY: " + line[len("problem "):], file=sys.stderr)
|
||||
print("face unlock: add a face in Settings > Session > Face unlock (after logging in to the new "
|
||||
"session), or now with `chandra-face enroll`, then `chandra-face pam enable`")
|
||||
Reference in new issue
Block a user