Repository navigation
sigmastar: infinity6c: add SmartSens SC430AI driver (TP-Link Tapo C120) - #7
Conversation
PR Summary by QodoAdd SmartSens SC430AI driver for SigmaStar Infinity6C
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
4 MP, 4-lane MIPI, 2688x1520@30 (also 2560x1440 crop and 2688x1520@60). Ported from the sc450ai driver; register tables, gain steps and AE limits come from the sensor's stock SigmaStar SDK driver (TP-Link Tapo C120). Linear mode is tested on the Tapo C120 (SSC377) with majestic; the DOL/HDR paths keep the template structure and are untested.
Code Review by Qodo
1.
|
Load sensor_sc430ai_mipi.ko (OpenIPC/sensors#7) and ship its IQ file. Detection needs nothing new: ipcinfo -s already reports sc430ai and the default srcfg works on the Tapo C120.
- keep the base VTS and line period per handle instead of in file-scope globals, so one camera's mode change cannot alter another's timing - pCus_GetAEGain returns the clamped gain last set (was left unassigned) - pCus_GetFPS_HDR reads the HDR VTS registers, not the linear ones - HDR long exposure gets its own getter using the HDR line period - HDR short exposure getter undoes the setter's <<4 and half-line units Linear mode re-tested on the Tapo C120.
Load sensor_sc430ai_mipi.ko (OpenIPC/sensors#7). Detection needs nothing new: ipcinfo -s already reports sc430ai and the default srcfg works on the Tapo C120. The IQ file is not included (no vendor SDK release carries it); users take /etc/sensors/sc430ai.bin from their camera's stock firmware.
openipc-ai
left a comment
There was a problem hiding this comment.
Reviewed this against the tree rather than the hardware — I don't have a C120 — and it holds up well.
- The Makefile globs
*$(OPENIPC_SNS_MODEL)*.c, so one file really is the whole change; no registration needed. - No leftovers from the sc450ai skeleton. I grepped for parent-sensor identity across all 2036 lines and the only hit is your attribution comment.
- Chip ID 0xCE39 at 0x3107/0x3108 is distinct from every sibling here (sc401ai 0xCD2E, sc450ai 0xBD2F, sc830ai 0xC143, sc850sl 0x9D1E) and follows the family pattern;
ipcinfo -sreturningsc430aiis exactly the test that exercises the ID table. - Timing constants are self-consistent: VTS 1650 at 30 fps gives 20202 ns, at 60 fps 10101 ns, HDR VTS 3300 at 30 fps 10101 ns.
Your fix commit went further than the finding asked — moving vts_30fps and Preview_line_period out of file scope into the handle was a real multi-instance bug that nobody had flagged. Worth saying.
The untested HDR mode being advertised is not a problem with this PR: 8 of the 10 existing infinity6c drivers advertise one too, and sc450ai carries the same // Modify it template markers. You are the only one who documents the limitation.
One request, and it is the only reason this is changes-requested rather than an approval. The header names drv_ms_cus_sc430ai_MIPI_tp_ww, SigmaStar SDK build 202306132013 — a filename out of TP-Link's stock tree. That is exactly what you were asked to strip from OpenIPC/wiki#549, and it would be inconsistent of us to require it in one repo and not the other. The register tables are the substance; the stock filename and build number add nothing a reader can use. Something like "register tables and AE constants derived from the sensor's SigmaStar SDK driver" keeps the honest attribution without the disclosure.
The register tables are the substance; the vendor build's filename and build number add nothing a reader can use, and the OpenIPC wiki page for the same device was asked to leave them out.
SSC377, SmartSens SC430AI, 16 MB NOR, RTL8188FTV on USB. The generic ssc377_lite defconfig with the 16 MB layout, the rtl8188fu driver and the SAE-capable wpa_supplicant-openipc; the Wi-Fi module's power gate (GPIO 42) in the wireless/usb entry; IR-cut, backlight and IR LED pins; the SC430AI IQ file. Depends on OpenIPC/sensors#7 (driver), OpenIPC/firmware#2445 (loader entry) and OpenIPC/firmware#2449 (supplicant package).
|
Header changed: "register tables and AE constants derived from the sensor's SigmaStar SDK driver", no filename or build number. That is the only change in the new commit. On ordering: agreed, this goes first, then OpenIPC/firmware#2445. The builder device that ties the C120 pieces together is OpenIPC/builder#162; it was built against this branch and tested on the camera today: |
openipc-ai
left a comment
There was a problem hiding this comment.
Header is clean now — no stock filename, no SDK build number, and the remaining "stock driver" mentions are generic limits with no path or identifier in them. That was the only thing outstanding.
Approving. This goes in first; OpenIPC/firmware#2445 follows, then #2449, then OpenIPC/builder#162.
Note for anyone rebuilding locally afterwards: sigmastar-osdrv-sensors tracks HEAD, and the tarball is cached by filename, so clear dl/sigmastar-osdrv-sensors or you will keep building the old sensor set.
SSC377, SmartSens SC430AI, 16 MB NOR, RTL8188FTV on USB. The generic ssc377_lite defconfig with the 16 MB layout, the rtl8188fu driver and the SAE-capable wpa_supplicant-openipc; the Wi-Fi module's power gate (GPIO 42) in the wireless/usb entry; IR-cut, backlight and IR LED pins; the SC430AI IQ file. Depends on OpenIPC/sensors#7 (driver), OpenIPC/firmware#2445 (loader entry) and OpenIPC/firmware#2449 (supplicant package). Co-authored-by: nzzane <12163646+nzzane@users.noreply.github.com>
Adds
sigmastar/infinity6c/sensor_sc430ai_mipi.cfor the SmartSens SC430AI (4 MP, 4-lane MIPI, I2C 0x60, ID 0xCE39).Why: OpenIPC boots on the TP-Link Tapo C120 (SSC377) but had no SC430AI driver, and the stock
sc430ai_MIPI.kooopses inside OpenIPC'smi.ko(sensor-handle layout differs between SDK builds) — see OpenIPC/firmware#1654 and OpenIPC/firmware#1766.What: the sc450ai driver as the skeleton, with the SC430AI register tables, gain steps (analog step table + coarse/fine digital gain) and exposure limits taken from the sensor's stock SigmaStar SDK driver. Modes: 2688x1520@30 (default), 2560x1440@30 (crop), 2688x1520@60. DOL/HDR entries keep the template structure and are untested.
Tested on a Tapo C120 with the current OpenIPC infinity6c kernel (5.10.61) and majestic:
Sensor index 0: 2688x1520@30fps, 3A on with the vendor IQ file, RTSP/JPEG fine, IR-cut day/night switching fine. Builds with this repo's Makefile without warnings.Follow-up in OpenIPC/firmware#2445:
sc430aiinload_sigmastar(auto-detection viaipcinfo -salready works,srcfg 0 1 0 0 0 0is fine on this board) and the IQ filesc430ai.bin.