Repository navigation
media: apple: isp: temporal filter and mains frequency as macOS sets them (J700, J616s) - #774
Conversation
On the H17 interface macOS does not start the ISP's temporal noise filter the same way for every sensor. For the IMX958 (J616s) it sends a longer start record, (1, 0, 0), then turns high-strength filtering and band 0 modulation off and sets the band 0 strength thresholds to 120 and 100 in 1/256 steps, before the motion history and the enable. For the IMX558 (J700) it starts nothing: it disables the filter and stops the motion history and the filter, since the firmware keeps that state between streams. These values come from Daybreak's reading of the macOS 27.0 camera stack. Linux sent the short start with the apple,temporal-filter value on every sensor, 1 on the J700. On the Neo, starting the filter with 0 instead of 1 already leaves about 13% less luma noise and 18% less chroma noise on a still scene. Keep the per-sensor choice next to the setfile of each sensor and leave every other sensor on the original sequence. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The H17 firmware's auto exposure keeps exposure times in step with the mains frequency so that lights do not flicker or band in the picture. macOS tells it the frequency for every camera, 50 Hz unless the country uses 60 Hz, as Hz in 16.16 fixed point. Linux never sent it. Add the standard V4L2 power line frequency control on H17 hardware, 50 Hz by default as on macOS, and send it with the stream setup. It is applied when the stream starts, like the exposure priority. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Neo measurement of the filter-stopped sequence, fleet14c plus this series as a test module, evening light:
|
|
Fresh-boot check on the Neo, 2026-11-01 20:16 (fleet14c, this change as a test module with default settings, boot 2ea81766), very dark room (1.6 lux, gain 4160, 30 ms exposure):
This is the second freeze with the filter-stopped sequence on the Neo (the first was at 18:40, 9 minutes with no frames). Stock streams have not frozen in any run today. Keeping this as a draft until the cause is understood. The J616s half (strength controls, mains frequency) is not implicated, so splitting it out is an option. Logs: reports/camera-quality-20261101/neo-774-freshboot-20261101/ (full dmesg included). 🤖 Generated with Claude Code |
|
Fresh-boot A/B on the Neo, 2026-11-02 00:44-00:58 (fleet14d, this change as a signed test module, dark room with gain at maximum). Each boot's first stream was 150 frames at about 23-44 s uptime. Module options switched between the stock sequence and this change:
So the first-stream freeze seen at 20:16 (and the 18:40 stall) didn't reproduce in three fresh boots with this change. One difference from those two runs: then, another camera client (GNOME Camera via camera-denoise) opened the device while the test stream ran, which camera-denoise #6 now handles. I can't fully rule the change out from three boots, so I'm leaving the merge to review with these numbers. Logs: reports/camera-quality-20261101/neo-774-freeze-20261102/ (dmesg of every boot). 🤖 Generated with Claude Code |
|
Correction to my last comment: at 20:16 the freeze started at 28.4 s uptime, before GNOME Camera tried to open the device at 45.6 s. So the second client doesn't explain that freeze. The cause is still unknown, and it didn't reproduce in the three fresh boots above. 🤖 Generated with Claude Code |
|
Merging as the camera reviewer.
🤖 Generated with Claude Code |
The camera on the Neo and the J616s is much grainier than on macOS. This brings the ISP setup in line with what macOS sends on the H17 interface, using parameter facts from Daybreak's reading of the macOS 27.0 camera stack (opcodes and values only).
What changes
V4L2_CID_POWER_LINE_FREQUENCYcontrol on H17 hardware, 50 Hz by default, applied when the stream starts. P010 keeps its minimal sequence.Everything else macOS sends at stream start already matches (CNR, MBNR 0/1/1, AE stability 32/20, AE rate limits).
Measured on hardware (fleet14 with this series as a test module, NV12 1080p30, read-only captures, 8-bit luma)
Tests
apple-isp*): 40/40, with three new cases for both temporal filter sequences and the 50/60 Hz encoding.W=1: ISP objects build clean.KCFLAGS=-Werrorstops on an existing FORTIFY warning in isp-ipc.c, which this series doesn't touch.--strict: clean on both commits.🤖 Generated with Claude Code