Skip to content

Restore internal camera support on firmware 1.3.5.x - #40

Open
nerdoc wants to merge 2 commits into
Guilouz:mainfrom
nerdoc:fix/internal-camera-firmware-1.3.5
Open

Restore internal camera support on firmware 1.3.5.x#40
nerdoc wants to merge 2 commits into
Guilouz:mainfrom
nerdoc:fix/internal-camera-firmware-1.3.5

Conversation

@nerdoc

@nerdoc nerdoc commented Aug 27, 2026

Copy link
Copy Markdown

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, which
publishes JPEG frames over a memfd IPC channel instead of exposing the UVC device.
input_uvc.so fails on it. The firmware update also wipes /etc/init.d, so nothing
listens on port 8080 anymore — while the nginx config installed by this script still
proxies /webcam/ to 127.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 runs mjpg_streamer with input_memfd.so. Both the
binary and the plugin ship with the firmware, so no Entware packages are needed. The
service waits for cam_app in a backgrounded subshell, so a slow camera init does not
stall the boot — rcS runs init scripts sequentially, and a foreground wait loop delays
everything after it.

Install is refused when USB Camera Support is present (both want port 8080) or when
input_memfd.so is missing (firmware too old).

2. S50usb_camera-single: recognize CCX2F3299

The guard only matched CCX2F3298, so the newer revision is treated as a third-party
USB camera. On my K1 the internal camera enumerates over USB, so it lands in V4L_DEVS
and the guard does not fire:

V4L_DEVS=[/dev/video4]
CREALITY_CAMS=0        # with 'CCX2F3298'
CREALITY_CAMS=2        # with 'CCX2F329[89]'

install_menu_K1.sh already checks for CCX2F3299, so this only brings the service in
line with the menu.

Testing

Tested on a K1, firmware build 2026-06-25, camera CCX2F3299 (1.3):

  • stream and snapshot work on :8080 and through nginx on /webcam/ (both 4408 and 4409)
  • repeated start is idempotent — it does not spawn a second streamer
  • the detection numbers above are measured on that machine

Not tested: the boot path (the printer was mid-print), and hardware other than the K1.

Known limitations, not addressed here

  • S50usb_camera-dual starts input_uvc.so -d /dev/video4 for the internal camera, which
    cannot work on 1.3.5.x either. Fixing it properly means mixing input_memfd for the
    internal camera with input_uvc for the USB one, and I have no dual-camera setup to
    test that on, so I left it alone.
  • camera_settings_control.sh picks the nebula config (ranges 50…160) only for
    CCX2F3298; CCX2F3299 falls through to the generic one (−64…64). That looks related
    to discussion #910,
    but on my printer v4l2-ctl -d /dev/video4 -l returns nothing at all under this
    firmware, so I could not verify which ranges are correct and did not touch it.

nerdoc added 2 commits August 27, 2026 12:28
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.
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