Skip to content

gk7201v200: ship an sc2336 IQ profile, and fix sc2335's day dehaze typo - #2499

Merged
widgetii merged 1 commit into
masterfrom
gk7201v200-sc2336-iq
Sep 29, 2026
Merged

widgetii merged 1 commit into
masterfrom
gk7201v200-sc2336-iq

Conversation

@widgetii

@widgetii widgetii commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Problem

On a GK7201V200 + SC2336 camera the picture is soft and blocky. The gk7205v500 family links the SC2232 profile as default.ini, and with no sc2336.ini on the image, majestic loads that. Reported in #2234 (comment).

This PR ships an SC2336 profile as /etc/sensors/iq/sc2336.ini. Majestic loads /etc/sensors/iq/<sensor>.ini ahead of default.ini, so an SC2336 camera picks it up with no setting.

The file is the SC2336 profile from that camera's own firmware, converted to this tree's form: CRLF to LF, and [cl_*] day sections renamed to the plain names. It carries two data fixes, both in sections majestic refused in the reporter's log:

  • [dynamic_dehaze]: 9 IsoThresh values ending 6400,128, against 8 AutoDehazeStr values. The 128 rung is a typo; the other profiles have 12800 there. It is dropped, and ExpThreshCnt goes from 9 to 8, which leaves the 8 strengths as given.
  • [dynamic_gamma] and [ir_dynamic_gamma]: gammaExpThreshLtoH was on the ISO scale in an exposure-keyed section. It is set to the HtoL values, as hisi ev200 iq: gammaExpThreshLtoH is exposure, not ISO #2477 did for the other ev200 profiles.

It also fixes sc2335.ini's day [dynamic_dehaze], which has the same …,6400,128 typo with 9 strengths. Majestic rejects that as not ascending. It becomes 12800, as the file's own night section has. No package in this tree installs sc2335.ini, so this part changes no image built from here.

Hardware tested on

The reporter's XiongMai GK7201V200 + SC2336 (chip id 0x72010200), on the 09-27 image with this branch's exact sc2336.ini fetched into /etc/sensors/iq/ and the overlay's default.ini copy removed: #2234 (comment). They report the picture is the same as with their vendor profile, the one in the before/after snapshots at #2234 (comment). I did not run it myself.

Evidence

The reporter's log with the vendor profile loaded, before the two fixes:

IQ: [dynamic_dehaze] has 9 thresholds and 8 strengths; one strength per threshold or nothing. The section was left alone
IQ: [dynamic_gamma] gammaExpThreshLtoH (2400..25600) is below gammaExpThreshHtoL (100000..1600000) at every rung, so the two are not the same quantity -- LtoH reads as ISO and this section is keyed on exposure. Ignoring LtoH and switching on HtoL alone, without hysteresis

After, from the reporter's console with this file, as posted in the comment linked above:

[     sdk] resolve_iq_profile@2359       IQ profile /etc/sensors/iq/sc2336.ini matches the detected sensor
[   scene] load_iq_profile_locked@2274   Loading INI profile /etc/sensors/iq/sc2336.ini (day set)
[   scene] iq_summary@1057               IQ /etc/sensors/iq/sc2336.ini: [dynamic_dehaze] loaded
[   scene] iq_summary@1057               IQ /etc/sensors/iq/sc2336.ini: [dynamic_gamma] loaded
[iq_apply] iq_apply_dynamic@2624         IQ: gamma curve 1 of 3 (exposure 472191)

The two refusals above are gone. The diff against the vendor file, after the [cl_ rename, is exactly those three lines.

Local gk7201v200_lite build: rootfs 4940/5120 KB, uImage 1834/2048 KB (details in the comment below).

Scope

  • No kernel patches under general/package/all-patches/linux/ (those go to OpenIPC/linux)
  • No files specific to a single retail camera model (those go to OpenIPC/builder)
  • No probing or bring-up tooling (that goes to OpenIPC/ipctool)
  • Nothing under general/overlay/ or in a shared load_<vendor> script hardcodes a value specific to my board
  • Package sources come from an OpenIPC repository, and any version bump keeps at least the specificity of the pin it replaces (a new package should pin a full 40-character SHA)
  • No LD_PRELOAD, and no binaries that cannot be rebuilt from source
  • New code is selected by a defconfig, so CI actually builds it

A GK7201V200 + SC2336 camera ran the SC2232 profile the gk7205v500
family links as default.ini, and gave a soft, blocky picture. With the
SC2336 profile from the camera's own firmware in its place the reporter
called it "MUCH better", in the same room at the same exposure
(#2234). majestic loads /etc/sensors/iq/<sensor>.ini
ahead of default.ini, so shipping it as sc2336.ini is enough.

The file is that profile converted to this tree's form -- CRLF to LF,
[cl_*] day sections to the plain names -- with two data fixes, both in
sections majestic refused in the reporter's log:

- [dynamic_dehaze] listed 9 IsoThresh ending "6400,128" against 8
  AutoDehazeStr. The 128 rung is a typo (12800 in the other profiles);
  dropped, with ExpThreshCnt 9 -> 8, it leaves the 8 strengths as given.
- [dynamic_gamma] and [ir_dynamic_gamma] had gammaExpThreshLtoH on the
  ISO scale in an exposure-keyed section; set to the HtoL values, as
  #2477 did for the other ev200 profiles.

sc2335.ini's day [dynamic_dehaze] has the same typo with 9 strengths, so
majestic rejected it as not ascending; 128 -> 12800, as its own night
section has. No package here installs sc2335.ini, so this reaches no
image built from this tree.
@widgetii widgetii mentioned this pull request Sep 28, 2026
@widgetii

Copy link
Copy Markdown
Member Author

Local make BOARD=gk7201v200_lite on this branch:

- uImage: [1834KB/2048KB]
- rootfs.squashfs: [4940KB/5120KB]

/etc/sensors/iq:
default.ini -> sc2232.ini
sc2232.ini    143193
sc2336.ini    156170

For reference, the 09-27 nightly's rootfs was 4924 KB. The offline checks listed in CLAUDE.md all pass.

@widgetii
widgetii marked this pull request as ready for review September 29, 2026 08:18
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add an SC2336 IQ profile and fix SC2335 dehaze thresholds

✨ Enhancement 🐞 Bug fix ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Add a vendor-derived SC2336 IQ profile so cameras can use sensor-specific tuning instead of the
 default.
• Correct SC2336 dehaze and gamma thresholds, and SC2335’s invalid daytime dehaze threshold.
• Wire SC2336 into the Goke package, but its install path does not match the added file.
Diagram

graph TD
  G["Goke package"] --> D["Target IQ directory"] --> M(["Majestic profile loader"]) --> I(["Image processing"])
  P["SC2336 profile"] -.->|"source path mismatch"| G
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep the profile in the Goke package
  • ➕ Makes the install recipe package-local and directly addresses the missing source path.
  • ➖ Duplicates the profile if the Hisilicon package also needs it later.
2. Use an explicit shared profile source
  • ➕ Allows both SoC packages to consume one maintained profile.
  • ➖ Introduces cross-package wiring for a profile currently installed by only one package.

Recommendation: Keep the sensor-named profile strategy, but make its file location and install command agree before merging; placing it in the Goke package is the simpler option. The referenced Goke-local sc2232.ini path is also absent in this checkout, so validate the package install rather than relying on the reported manual profile test.

Files changed (3) +1538 / -1

Enhancement (1) +1536 / -0
sc2336.iniAdd vendor-derived SC2336 day and night IQ tuning +1536/-0

Add vendor-derived SC2336 day and night IQ tuning

• Adds exposure, sharpening, noise-reduction, gamma, and dehaze tuning for SC2336. The daytime dehaze table now has eight matching thresholds and strengths, and both gamma sections use exposure-scale thresholds. It is not currently installed by the modified Goke recipe because the recipe references another package directory.

general/package/hisilicon-osdrv-hi3516ev200/files/sensor/iq/sc2336.ini

Bug fix (1) +1 / -1
sc2335.iniCorrect the daytime SC2335 dehaze ISO rung +1/-1

Correct the daytime SC2335 dehaze ISO rung

• Changes the final ISO threshold from 128 to 12800, restoring ascending thresholds while retaining all nine strengths. No package install command in this tree references this profile.

general/package/hisilicon-osdrv-hi3516ev200/files/sensor/iq/sc2335.ini

Other (1) +1 / -0
goke-osdrv-gk7205v500.mkAdd SC2336 to the Goke IQ install recipe +1/-0

Add SC2336 to the Goke IQ install recipe

• Adds an install command for sc2336.ini beside the SC2232 default. The command points into the Goke package, but the new file is under the Hisilicon package, so it cannot install the added profile as written.

general/package/goke-osdrv-gk7205v500/goke-osdrv-gk7205v500.mk

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. New sensor profile never reaches cameras 📘 Rule violation ≡ Correctness
Description
GOKE_OSDRV_GK7205V500_INSTALL_TARGET_CMDS reads sc2336.ini from the Goke package, but the file
was added only to the HiSilicon package, whose install recipe does not list it. Every image
selecting the Goke package, including the intended GK7201V200 image, reaches the command with a
missing source file, and neither package installs the profile to /etc/sensors/iq.
Code

general/package/goke-osdrv-gk7205v500/goke-osdrv-gk7205v500.mk[111]

+	$(INSTALL) -m 644 -t $(TARGET_DIR)/etc/sensors/iq $(GOKE_OSDRV_GK7205V500_PKGDIR)/files/sensor/iq/sc2336.ini
Evidence
The added install command references sc2336.ini beneath GOKE_OSDRV_GK7205V500_PKGDIR, while the
new file exists beneath the HiSilicon package; GK7201V200 selects the Goke package. HiSilicon's
explicit IQ installation list also omits the file, so it provides no alternative runtime-installed
copy.

Rule 4: New sources are wired into the build
Rule 12: Shipped files are reachable from something that runs
general/package/goke-osdrv-gk7205v500/goke-osdrv-gk7205v500.mk[109-112]
general/package/hisilicon-osdrv-hi3516ev200/files/sensor/iq/sc2336.ini[1-1]
general/package/hisilicon-osdrv-hi3516ev200/hisilicon-osdrv-hi3516ev200.mk[73-78]
general/package/hisilicon-osdrv-hi3516ev200/files/sensor/iq/sc2336.ini[1-4]
br-ext-chip-goke/configs/gk7201v200_lite_defconfig[52-53]
general/package/hisilicon-osdrv-hi3516ev200/hisilicon-osdrv-hi3516ev200.mk[72-78]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new SC2336 profile exists only in the HiSilicon package, but the Goke install command reads it from the Goke package. This leaves Goke image builds without the command's source file, while HiSilicon does not install the profile either.
## Fix Focus Areas
- general/package/goke-osdrv-gk7205v500/goke-osdrv-gk7205v500.mk[109-112]
- general/package/hisilicon-osdrv-hi3516ev200/files/sensor/iq/sc2336.ini[1-1]
## Recommended Fix
Move `sc2336.ini` into `general/package/goke-osdrv-gk7205v500/files/sensor/iq/` so the added install command copies it to `/etc/sensors/iq/sc2336.ini`, then verify a GK7201V200 image build.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@widgetii
widgetii merged commit e321f75 into master Sep 29, 2026
53 of 58 checks passed
@widgetii
widgetii deleted the gk7201v200-sc2336-iq branch September 29, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant