From 22432481fdaf107c3258a6a7303cb92877267d78 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Sun, 6 Sep 2026 22:43:36 +0300 Subject: [PATCH] Stop shipping a dangling /etc/sensors/iq/default.ini The osdrv packages create default.ini as a symlink to one fixed sensor's IQ file -- imx307.ini for hisilicon-osdrv-hi3516ev200 and goke-osdrv-gk7205v200. Two device profiles prune that exact file to fit NOR and leave the symlink behind, so the image ships a default.ini that resolves to nothing. majestic answers that silently. init_iq_monitor() (src/hisi/sdk.c) has no default for isp.iqProfile, falls through to /etc/sensors/iq/default.ini, and returns on `access(default_prof, 0) != 0` without logging at any level. No IQ profile means no monitor thread, so SCENE_Set3DNR() never runs and VPSS keeps the single static NRX block from scene.c tune_vpss() at every ISO. The explicit-iqProfile path does log "Cannot find %s file"; only this fallback is mute. Measured on a lab hi3516ev300_85h50ai (IMX335, nightly-20260904-605fa9d) against a night scene at ISO ~30000, changing nothing but the profile majestic loads: dangling imx335.ini RTSP, 20 s capture 14.13 Mbit/s 3.54 Mbit/s /proc/umap/rc InsBr 14310 kbps 3626 kbps StartQp 42 (= MaxQp) 31 3DNR SFS2 5/16/0/30 36/60/60/52 3DNR TFS 1/7/12/10 5/9/13/11 The encoder was configured correctly the whole time -- VBR 4096, MinQp 28, MaxQp 42. Rate control pinned at MaxQp while still emitting 14 Mbit/s is what an undenoised sensor at ISO 30000 costs, not a bitrate that was ignored. It reads as "the bitrate setting does nothing" and "3DNR is off", which is how it was reported. hi3516ev300_lite_xm-85h50ai keeps imx335.ini and runs an IMX335, so general/overlay now carries a default.ini aimed at it. BR2_ROOTFS_OVERLAY is rsynced after the packages install and rootfs_script.sh runs the excludes list after that, so the overlay's symlink replaces the package's and the pruning that follows is harmless. This also stops the board loading an IMX307 profile for an IMX335 sensor, which is what it would have got had imx307.ini simply been kept. gk7202v300_lite_ipg-g3-wr prunes every IQ file its package installs (imx307, imx335, sc2232), so there is nothing to aim a symlink at. It drops default.ini instead. Behaviour is unchanged -- majestic already loads no profile there -- but the image stops carrying a broken link that would silently start resolving to the wrong sensor's profile the moment one of those entries goes stale. The board runs jxh63, which no shipped IQ file covers; a note in the list records that keeping imx307.ini costs 126 KB if it turns out to want one. An audit of every device profile against its SoC's osdrv package finds no others: the rest either keep the symlink's target, remove default.ini already, or pin .isp.iqProfile in customizer.sh. --- .../general/scripts/excludes/gk7202v300_lite.list | 10 ++++++++++ .../general/overlay/etc/sensors/iq/default.ini | 1 + .../general/scripts/excludes/hi3516ev300_lite.list | 6 ++++++ 3 files changed, 17 insertions(+) create mode 120000 devices/hi3516ev300_lite_xm-85h50ai/general/overlay/etc/sensors/iq/default.ini diff --git a/devices/gk7202v300_lite_ipg-g3-wr/general/scripts/excludes/gk7202v300_lite.list b/devices/gk7202v300_lite_ipg-g3-wr/general/scripts/excludes/gk7202v300_lite.list index 4ee3b94db..6cf1a34dc 100644 --- a/devices/gk7202v300_lite_ipg-g3-wr/general/scripts/excludes/gk7202v300_lite.list +++ b/devices/gk7202v300_lite_ipg-g3-wr/general/scripts/excludes/gk7202v300_lite.list @@ -25,6 +25,16 @@ /etc/sensors/gc5603_i2c_5M.ini /etc/sensors/imx327_i2c_1080p.ini /etc/sensors/iq/imx307.ini +# imx307.ini above is the target of the osdrv package's +# /etc/sensors/iq/default.ini symlink, and this list drops every IQ file +# the package installs (imx307, imx335, sc2232), so there is nothing left +# to aim it at. Drop the symlink too rather than ship a dangling one: +# majestic's init_iq_monitor() takes the same silent no-profile path +# either way, but a dangling link also starts resolving to the wrong +# sensor's profile the moment one of these entries goes stale. +# This board runs jxh63, which the package ships no IQ file for. If it +# turns out to want one, keeping imx307.ini costs 126 KB. +/etc/sensors/iq/default.ini /etc/sensors/mis2008_i2c_1080p.ini /etc/sensors/os02g10_i2c_1080p.ini /etc/sensors/sc223a_i2c_1080p.ini diff --git a/devices/hi3516ev300_lite_xm-85h50ai/general/overlay/etc/sensors/iq/default.ini b/devices/hi3516ev300_lite_xm-85h50ai/general/overlay/etc/sensors/iq/default.ini new file mode 120000 index 000000000..b2af41347 --- /dev/null +++ b/devices/hi3516ev300_lite_xm-85h50ai/general/overlay/etc/sensors/iq/default.ini @@ -0,0 +1 @@ +imx335.ini \ No newline at end of file diff --git a/devices/hi3516ev300_lite_xm-85h50ai/general/scripts/excludes/hi3516ev300_lite.list b/devices/hi3516ev300_lite_xm-85h50ai/general/scripts/excludes/hi3516ev300_lite.list index 8ecab44ef..ce12d4585 100644 --- a/devices/hi3516ev300_lite_xm-85h50ai/general/scripts/excludes/hi3516ev300_lite.list +++ b/devices/hi3516ev300_lite_xm-85h50ai/general/scripts/excludes/hi3516ev300_lite.list @@ -48,6 +48,12 @@ /etc/sensors/sp2305_i2c_1080p.ini /etc/sensors/sp2308_i2c_1080p.ini # +# imx307.ini is what the osdrv package points /etc/sensors/iq/default.ini +# at, so dropping it here would leave that symlink dangling and majestic +# would load no IQ profile at all. general/overlay ships a default.ini +# aimed at imx335.ini -- this board's sensor -- and the rootfs overlay is +# rsynced before this list runs, so the replacement is already in place. +# /etc/sensors/iq/f23.ini /etc/sensors/iq/imx307.ini /etc/sensors/high-fps/imx307_1280x720_60fps.ini