Restore internal camera support on firmware 1.3.5.x - #40
Open
nerdoc wants to merge 2 commits into
Open
Conversation
Since firmware 1.3.5.x the internal camera is owned exclusively by cam_app, which publishes JPEG frames over a memfd IPC channel instead of exposing the UVC device, so input_uvc.so no longer works. The firmware update also wipes /etc/init.d, leaving nothing on port 8080 while nginx still proxies /webcam/ there. Add an Internal Camera Support entry that installs an S59mjpg_streamer service using input_memfd.so, which ships with the firmware.
The single USB camera service only guards against CCX2F3298, so the newer CCX2F3299 revision is treated as a third-party USB camera. The K1 install menu already knows about CCX2F3299.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Disclaimer: this PR is created by Claude Opus 5. It works as fix in my setup - but YMMV.
However - anything is better than the current state: the camree is not working any more with the last update.
And the script seems to be unmaintained - so... If noone does anything, it will die.
Problem
Since firmware 1.3.5.x the internal camera is owned exclusively by
cam_app, whichpublishes JPEG frames over a memfd IPC channel instead of exposing the UVC device.
input_uvc.sofails on it. The firmware update also wipes/etc/init.d, so nothinglistens on port 8080 anymore — while the nginx config installed by this script still
proxies
/webcam/to127.0.0.1:8080. Only the producer is missing.Reported in discussion
#901 (K1C and
K1 Max), and the workaround this PR is based on comes from there — credit to @laffsj.
Changes
1. New "Internal Camera Support" entry (K1 menu, option 19)
Installs
S59mjpg_streamer, which runsmjpg_streamerwithinput_memfd.so. Both thebinary and the plugin ship with the firmware, so no Entware packages are needed. The
service waits for
cam_appin a backgrounded subshell, so a slow camera init does notstall the boot —
rcSruns init scripts sequentially, and a foreground wait loop delayseverything after it.
Install is refused when USB Camera Support is present (both want port 8080) or when
input_memfd.sois missing (firmware too old).2.
S50usb_camera-single: recognizeCCX2F3299The guard only matched
CCX2F3298, so the newer revision is treated as a third-partyUSB camera. On my K1 the internal camera enumerates over USB, so it lands in
V4L_DEVSand the guard does not fire:
install_menu_K1.shalready checks forCCX2F3299, so this only brings the service inline with the menu.
Testing
Tested on a K1, firmware build 2026-06-25, camera
CCX2F3299 (1.3)::8080and through nginx on/webcam/(both 4408 and 4409)startis idempotent — it does not spawn a second streamerNot tested: the boot path (the printer was mid-print), and hardware other than the K1.
Known limitations, not addressed here
S50usb_camera-dualstartsinput_uvc.so -d /dev/video4for the internal camera, whichcannot work on 1.3.5.x either. Fixing it properly means mixing
input_memfdfor theinternal camera with
input_uvcfor the USB one, and I have no dual-camera setup totest that on, so I left it alone.
camera_settings_control.shpicks the nebula config (ranges 50…160) only forCCX2F3298;CCX2F3299falls through to the generic one (−64…64). That looks relatedto discussion #910,
but on my printer
v4l2-ctl -d /dev/video4 -lreturns nothing at all under thisfirmware, so I could not verify which ranges are correct and did not touch it.