feat: add 64-bit Raspberry Pi OS (Bookworm/Trixie) support via mpv rewrite#129
feat: add 64-bit Raspberry Pi OS (Bookworm/Trixie) support via mpv rewrite#129alionar wants to merge 35 commits into
Conversation
…ing mpv - Replace omxplayer with mpv (ARM64 compatible) - Add mpv_ipccontrol: replaces omxplayer_dbuscontrol via IPC socket + socat - Add per-camera logging, restart counters, uptime tracking - Add observe/debug/logs diagnostic commands - Fix screen blanking: replace fbi with xset dpms (fbi broken on KMS) - Fix RTSP timeout: use --demuxer-lavf-o=timeout instead of --network-timeout - Use --hwdec=auto-safe for stability on kernel 6.12+ - Update install.sh: remove omxplayer, add X11/openbox setup, create xorg.service - Update displaycameras.service: add Requires=xorg.service - Remove omxplayer_dbuscontrol (replaced by mpv_ipccontrol) - Add dev/ Docker test environment: arm64 Bookworm + Xvfb + noVNC + automated tests
- Replace omxplayer references with mpv throughout - Add X11/openbox prerequisite and setup instructions - Update install, removal, and configuration sections - Add developer Docker test environment usage - Add observe/debug/logs command documentation - Add Bookworm KMS compatibility notes - Add key differences table vs omxplayer branch
- Switch base image to vascoguita/raspios:arm64 (official RPi OS Lite rootfs) - Replace Xvfb + x11vnc with TigerVNC (Xvnc) — more reliable VNC stack - Replace novnc apt package with direct GitHub install v1.4.0 (apt package broken on RPi OS) - Add python3-xdg and menu packages to fix openbox warnings - Remove set -e from entrypoint to prevent silent failures - Increase startup sleep timings for more reliable service startup - Reset layout.conf.default to test mode with placeholder RTSP URLs - Update README: docker compose up -d --build, run tests via docker exec
- Add --title="$name" to mpv launch — shows camera name in window title - Fix --hwdec: auto-safe on Pi (was incorrectly no), keep no in Docker - Deploy openbox-rc.xml to disable mpv window decorations on Pi (install.sh) - Disable screen blanking via openbox autostart on Pi (xset -dpms) - Bake openbox-rc.xml and DPMS disable into Docker image (Dockerfile) - Replace fbi with procps in install.sh packages (watch command needed for observe) - Add openbox-rc.xml to dev/config/
|
Hi, install works without any problems and I can see my camera feed. But I'm having problems trying to use full LCD screen as camera image is rotated and on center of screen. Tried also the rotate option on displaycameras conf file, but still nothing changes. I'm using a HDMI 800x480 screen on a Raspberry pi. EDIT: If I call mpv manually from console with this commands all works ok: EDIT2: I just solve this editing the line 118 on file "displaycameras" and change this: Them I installed all again with the normal execution from the checkout source directory: Anyway after this I found a new problem when running my feed, starting from the command: and so on looping this disconnected error and the image on the screen shows on and off like each 4s to 10s. |
Add mpv_extra_opts to displaycameras.conf to allow passing arbitrary mpv flags without editing the script. Add Troubleshooting section to README covering OpenGL INVALID_OPERATION errors (fix: --vo=x11) and video rotation vs camera rotation confusion.
Hi @BaltasarParreira, thanks for testing!
This switches mpv to software X11 rendering. No extra packages needed. CPU usage goes up slightly but the feed plays without restarting. Both options are pushed to this branch. Pull the latest and give it a try. |
|
Hi, thanks for the quick reply and trying to fix the problems. I just installed the new version and add the new option for my OpenGL problem in "displaycameras.conf" file: But now nothing works, no feed showing and I get this on the log file: Looks like something related with x11 or display number. |
|
@BaltasarParreira Seems like an X display auth issue. Try changing to mpv_extra_opts="--vo=xv"Let me know if that works. |
User=pi caused X auth mismatch since displaycameras runs as root. Also fixes setups where the pi user does not exist (Bookworm default).
|
@BaltasarParreira In the meantime, pushed a fix for the X display auth issue. Please pull the latest and retry with |
|
Ok, still the same auth problem using the normal systemctl service as you can see in this part of the log: But running manual from SSH console and now I have to do it like this or he can't find the display: Old version was not needed to pass the: "DISPLAY=:0" calling displaycameras command. EDIT: Also now, after booting screen no longer shows the console login text and always has a mouse cursor with black background, before this cursor never showed. |
|
Ah ah ah ahhh.... ; ) Now I get full window with this: |
|
Hey @BaltasarParreira, I checked your photos and logs. Three guesses at root causes:
I'll try to spare some time to push these changes to a branch as well. |
|
Ok, news tests with your last information. 1. The timeout / restart loop: I think this is the correct way. and changed the Type to: adding on the same group the new line: Them I run: Ressult: The calling of but no more the on/off effect on the screen and camera feed showing at least. 2. X11 auth. I didn't test nothing further since my previous changes are still in effect and don't get AUTH errors starting the service, etc, 3. The "flipped" coordinatesc. Adding the "--no-keepaspect-window" to the "mpv_extra_opts=" on the conf file didn't change nothing when I revert back the size to "0 0 799 479". |
displaycameras.service was using Type=forking with an empty PIDFile, causing a restart loop. Restored upstream's Type=oneshot design with RemainAfterExit=yes. Added -ac flag to startx in xorg.service to disable X11 access control, fixing "Authorization required" errors when mpv connects to the display.
Add --no-keepaspect to mpv so camera feeds stretch to fill the configured window region like omxplayer did. Add -nocursor to X server startup to hide the mouse cursor on the kiosk display. Add troubleshooting docs for rotated display window sizing.
- Add rotate/rotaterev cases using mpv IPC geometry (ported from upstream) - Fix getplaystatus to query core-idle via IPC instead of PID check - Remove fbi blanking (broken under X11+KMS), add x11-xserver-utils - Add setvideopos IPC command, seq_step validation, update docs
|
Hi @BaltasarParreira , here's what changed:
|
mpv 0.35.1 ignores set_property geometry for repositioning. wmctrl moves windows via X11, matching omxplayer's original behavior.
mpv ≥0.39 no longer forces window position from --geometry. Feature-detect --force-window-position via mpv --list-options and inject it when available. No-op on Bookworm's mpv 0.35.1.
X11 root window handles screen blanking. fbi + black.png was the omxplayer-era approach for framebuffer blanking
is_alive() was never called. get_uptime() can't be used inside watch subshell
Cron runs repair every 60s. With multiple broken cameras, repair can exceed 60s and overlap. flock -n makes the second invocation exit immediately. Also removed unnecessary PIDFILE delete/recreate from the repair loop
|
Hi, fresh install from scratch of the OS and downloaded your latest "feature/mpv-64bit" revision. Changing back to the flipped coordinates settings ( "0 0 479 799") and without that flag I got the full landscape feed on the screen again like before. The command: EDIT: Well... after a certain time on running, It starts getting a few freezes on the feed and/or huge delay on the image and this starts showing on the log: Maybe is a hardware limitation as I'm running everything on a Raspberry pi zero 2w. |
|
Even with Docker for dev testing, mpv with a 2×2 grid can already overload the container CPU. The Pi Zero 2W is probably the bottleneck. The Pi Zero 2W doesn't have enough headroom for mpv under X11. omxplayer decoded on the VideoCore GPU overlay at ~5% CPU. mpv goes through X11 and software decode, which eats 50%+ CPU per stream. I hit the same thing and had to drop from 9 cameras to 4 in dev Docker setup.
|
|
@BaltasarParreira I pushed a few changes that should make a noticeable difference on your hardware:
|


Summary
omxplayer was removed in Raspberry Pi OS Bullseye/Bookworm and is no longer available on 64-bit ARM. This PR rewrites displaycameras to use mpv instead, enabling support for 64-bit Raspberry Pi OS Bookworm/Trixie (ARM64).
Changes
Tested on
vascoguita/raspios:arm64, official RPi OS Lite rootfs)Call for testers
If you have a Raspberry Pi 4 running 64-bit Raspberry Pi OS Bookworm/Trixie, please test this branch and report back. Specifically:
sudo ./install.shcomplete without errors?sudo systemctl start displaycameras?--hwdec=auto-safe?Notes