Commit Graph
11 Commits
Author SHA1 Message Date
nandiandClaude Opus 5.5 019c9ada6c Camera: cut viewfinder CPU use
CI / test (push) Failing after 49s
- Decode half-size frames at 24 fps (15 on the raw front camera) for the viewfinder; full frames only for photos, video, focusing and QR scans
- Swap channels with OpenCV instead of numpy; 2 OpenCV threads for live frames; OpenMP threads sleep when idle

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 01:14:29 -08:00
nandiandClaude Opus 5.5 f5a252e063 Camera: scan for QR codes twice a second
CI / test (push) Failing after 50s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 00:58:32 -08:00
nandiandClaude Opus 5.5 e2ba41acca Camera: QR code scanner
CI / test (push) Canceled after 0s
- Scan the photo viewfinder with OpenCV's QR detectors (aruco, then plain), off the preview thread, not while recording or in the gallery
- A card shows the code's text: Open for web links, Join for Wi-Fi codes (NetworkManager over D-Bus), Copy; nothing happens before a tap
- QR pill turns scanning off

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 00:38:40 -08:00
nandi ebdd330eb5 Camera: reuse ISP scratch buffers and fix video start frame
CI / test (push) Failing after 49s
- Reuse per-state scratch buffers in the Quad Bayer ISP path to cut per-frame allocations; never return an alias to the scratch output
- Release memoryviews and run gc before closing mmaps
- Seed recording from latest_frame() and emit it on stop if no fresh frame arrived, so short clips still produce a valid MP4
- Drop the initial push of the start frame
- Lower H.264 CRF from 20 to 23
- Compute ISP stats on a coarser subsample (//96 instead of //160)
2026-11-28 19:37:05 -08:00
nandi 6cb0562654 Camera: fix VFR video timestamps and close ffmpeg stderr
CI / test (push) Failing after 49s
- Pass -enc_time_base demux to ffmpeg so VFR video keeps the source timing
- Read the encoder's stderr only on failure, and always close the pipe
- Mirror the same ffmpeg flag and stderr close in test_camera.py
2026-11-28 19:28:05 -08:00
nandi 52b42890d6 Camera: C ISP pipeline, contrast autofocus, and VFR video
CI / test (push) Canceled after 0s
- Add chandra-camera-isp.c (C/OpenMP) for Quad-Bayer unpack, CCM, and tone mapping, with a NumPy fallback when it is not built
- Add non-blocking contrast-detection VCM autofocus, with lens subdev discovery on the sensor's I2C bus
- Tune Quad-Bayer AE: a video-mode vblank cap, damped steps, and full analog gain before extending blanking
- Record variable-frame-rate video through a streaming Matroska muxer, and count dropped frames
- Ship libcamera IPA tuning files for imx376, imx519, and uncalibrated sensors
- Map camera buffers by fd and sync them with dma-buf ioctls
2026-11-28 19:25:43 -08:00
nandi 40c5d6722c Face unlock: screen fill-light for low light; fix Quad-Bayer AE ramp
CI / test (push) Failing after 51s
- Boost the backlight to 90% while enrolling with the light on or while sign-in is scanning, then restore the previous level when that ends or the window closes.
- Add a Light: On/Off toggle (L key) to the Face window; the backdrop turns soft white while the light is on.
- Quad-Bayer AE: compute the low-light gain once and cap it by the highlight limit, so ramp-up and highlight back-off agree.
- Tests: backlight round-trip through the Face window, Quad-Bayer debayer color/low-light/dark-frame cases, and the AE ramp, back-off and restore order.
2026-11-28 18:32:15 -08:00
nandi c5b96e2c70 Quad-Bayer camera: direct V4L2 auto-exposure; enhance dark frames
CI / test (push) Failing after 50s
- Camera: on imx371, configure a Raw-only stream and drive exposure, vblank, analogue gain and digital gain through the sensor subdev (QuadSensorAE). Falls back to the viewfinder+raw configuration if the subdev is not found or setup fails.
- Camera: debayer 2x2-binned high-quality Quad-Bayer frames with an auto black level, a tone LUT, and CLAHE on strongly boosted frames.
- Face: add detect_score (default 0.65) and lower the default dark threshold from 25 to 12.
- Face: retry detection and embedding on gamma-lifted, CLAHE-enhanced frames when the image is dark.
2026-11-28 18:12:31 -08:00
nandi bfc60ee0e5 Add chandra-remote: VNC and web control over Tailscale
CI / test (push) Failing after 50s
- remote/: shared-memory framebuffer mirror served as RFB 3.8 (VNC, port 5900) and an HTTP/WebSocket PWA (port 6080), bound to the Tailscale interface and loopback by default
- Compositor: remote pointer, button, scroll, modifier, key, key-tap, text and clipboard input, routed past OLED blanking
- chandra-ctl: add status, refresh and osk commands; add input-* and clipboard-set for remote control
- Camera: debayer 10-bit CSI-2 Quad-Bayer frames for imx371 and high-quality still capture
- Camera: rotate frames by the libcamera mounting angle (CCW for 90), fix the expected test values, and restyle the UI for a dark theme
2026-11-28 17:57:55 -08:00
nandi de39b74282 Camera: move the camera engine into a stdio worker process
CI / test (push) Failing after 49s
- Replace the in-process GTK3 run_gui() with run_worker(), which owns the camera engine.
- Worker streams downscaled Cairo BGRA frames to stdout, with a length header per frame.
- Worker reads UI commands from stdin (switch, snap, snap_full, rec_start, quit) and emits state lines (info, active, flash, toast, saved_photo, rec_state).
- SIGINT/SIGTERM set a stop flag so the worker shuts down cleanly.
2026-11-28 12:25:29 -08:00
nandi 1c954aa657 Add a camera app: photo and video on libcamera or V4L2
CI / test (push) Failing after 52s
- Discover libcamera cameras, falling back to V4L2; label them Back, Front or External and pick the rear sensor first
- Photo mode: JPEG saves to ~/Pictures/Camera, with an optional high-res still capture
- Video mode: H.264 MP4 recording through ffmpeg, saved to ~/Videos/Camera
- Rear torch LED toggle via sysfs, falling back to logind SetBrightness
- GTK3 + Cairo Wayland UI with a viewfinder, timer, grid, camera switch and gallery view
- Add the desktop entry, icon and camera tests
2026-11-28 12:22:36 -08:00