Skip to content

fix(sg2002): capture resolutions other than 1920x1080 - #990

Open
akarineren wants to merge 2 commits into
sipeed:mainfrom
akarineren:fix/lt6911-input-size
Open

akarineren wants to merge 2 commits into
sipeed:mainfrom
akarineren:fix/lt6911-input-size

Conversation

@akarineren

Copy link
Copy Markdown

Problem

  1. At any resolution other than 1920x1080 (e.g. 1280x720, which is in
    hdmi_res_list), no frame is captured: VIFPS stays 0 and the web page
    shows "No HDMI signal".
  2. Once (1) is fixed, switching to an unsupported resolution (e.g. 1680x1050)
    and back leaves the capture stopped until a new viewer connects.

Cause and fix

  1. The SDK's LT6911 driver hard-codes INPUT_WIDTH/INPUT_HEIGHT to
    1920x1080. kvm_mmf now builds a copy of the driver that takes the size it
    reads from the sensor at initialization.
  2. lt6911_get_csi_res() only reports NEW_RES when the size differs from
    the last supported one, so going back to it never reopens the capture. It
    now forgets the last size on an unsupported resolution.

If you prefer fixing the driver in the SDK instead of patching it from
CMake, the second commit does not depend on how (1) is fixed. The prebuilt
server/dl_lib libraries are not updated.

Testing

NanoKVM with LT6911UXC, app 2.5.4, Linux target, web page watching over
H.264:

Build 1280x720 1280x720 → 1680x1050 → 1280x720
main no frame —
main + 1st commit OK no frame after 60 s
main + both OK OK within 6 s

With both commits, switching 1920x1080 ↔ 1280x720 while running also works
(within 6 s). Not tested on LT6911C / LT6911D.

Related: #5

The SDK's LT6911 driver hard-codes INPUT_WIDTH/INPUT_HEIGHT to
1920x1080, so at any other resolution (e.g. 1280x720) no frame is
captured and the web page shows "No HDMI signal".

Build a copy of the driver that takes the size kvm_mmf reads from the
sensor at initialization.
Going from a resolution to an unsupported one and back reports
NORMAL_RES instead of NEW_RES, since the size equals the last supported
one, so the capture is never reopened.

Forget the last size on an unsupported resolution.
@dormancygrace

Copy link
Copy Markdown

@akarineren If you’re interested, I’d love to hear how NanoKVM OS behaves on your LT6911UXC device. I’ve substantially reworked the capture pipeline and resolution handling, including support for additional aspect ratios and portrait modes.

I haven’t tested your exact supported → unsupported → supported sequence on your hardware, so your findings would be particularly helpful. No pressure, of course — and thanks again for improving the upstream implementation!

@akarineren akarineren closed this Nov 17, 2026
@akarineren akarineren reopened this Nov 17, 2026
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.

2 participants