Skip to content

fix: chạy được trên NEO One (camera auto-detect + cửa sổ 1x1)#2

Open
tuanln wants to merge 1 commit into
mainfrom
fix/neo-one-camera-window
Open

fix: chạy được trên NEO One (camera auto-detect + cửa sổ 1x1)#2
tuanln wants to merge 1 commit into
mainfrom
fix/neo-one-camera-window

Conversation

@tuanln

@tuanln tuanln commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Bối cảnh

Deploy NeoStopMotion lên NEO One (Armbian aarch64 + XFCE/xfwm) gặp 2 lỗi khiến app không dùng được. PR sửa cả hai, đã verify chạy thật trên thiết bị.

Lỗi & cách sửa

1. Camera mở cứng index 0

CaptureEngine mở cv2.VideoCapture(0) cố định, nhưng trên NEO camera thật ở /dev/video1 (node /dev/video0 là metadata/obsensor, mở index 0 thất bại) → app báo "Cannot open webcam index 0".

  • open() nay ép backend V4L2 (mở nhanh, tránh backend obsensor dò chậm ~6s/index) và dò các /dev/video* có thật, chọn index đầu tiên đọc được frame.
  • Vẫn ưu tiên env NEO_STOPMOTION_WEBCAM_INDEX → index cấu hình → tự dò.

2. Cửa sổ QML thu về 1x1

ApplicationWindowvisibility: Window.Windowed không áp được width/height trên nền này → cửa sổ 1x1, UI không hiện (dù QML không báo lỗi, GL direct rendering OK).

  • Đổi sang Window.Maximized: WM tự co theo màn hình, hợp kiosk maker-station mà vẫn còn nút đóng (khác FullScreen).

Kiểm thử

  • Verify thật trên NEO One: camera (index 1) + UI "Trạm làm phim hoạt hình" hiển thị đầy đủ, preview webcam chạy.
  • pytest: 29/29 PASS.

🤖 Generated with Claude Code

Hai lỗi gặp khi deploy lên NEO One (Armbian aarch64 + xfwm):

1. Camera: CaptureEngine mở cứng webcam_index=0, nhưng camera thật ở
   /dev/video1 (node /dev/video0 là metadata/obsensor, mở index 0 thất bại).
   → open() nay ép backend V4L2 (nhanh, tránh dò obsensor chậm ~6s) và dò các
   /dev/video* có thật, lấy index đầu tiên đọc được frame; vẫn ưu tiên env
   NEO_STOPMOTION_WEBCAM_INDEX rồi tới index cấu hình.

2. Cửa sổ QML: ApplicationWindow ở visibility Window.Windowed không áp được
   width/height trên nền này → cửa sổ thu về 1x1 (UI không hiện). Đổi sang
   Window.Maximized để WM tự co theo màn hình (hợp kiosk, vẫn còn nút đóng).

Đã verify chạy thật trên NEO One: camera (index 1) + UI hiển thị đầy đủ.
29/29 test PASS.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant