Repository navigation
media: apple: isp: M3 Air camera on 27.2 firmware; T8122 and T8132 gain and exposure - #2670
Conversation
The ISP firmware is told where the PMU registers are with SET_ISP_PMU_BASE. On every other SoC this is the power manager block plus 0x4000 (T8103: 0x23b700000 + 0x4000). The T8122 power manager is at 0x2d0700000, but the table gave 0x2d07040000, which is one hex digit too long and outside the SoC's MMIO space. Use 0x2d0704000. On the J615 with ISP firmware 27.2 the firmware now acknowledges the stop command: "never received magic number from firmware" and the forced coprocessor stop are gone, and each session closes about one second sooner. Reported-by: scottjones <444693+scottjones@users.noreply.github.com> Link: #2149 Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
… filter With the 1921_01 set file (IMX558, J613 and J615), starting the temporal filter at the strength the firmware's device tree gives (1) and enabling it stalls capture: the stream is accepted but no frame arrives, and the next stop times out. This happens with MBNR on or off and on firmware 14.7 (J613, #2149) as well as 27.2 (J615). Starting the filter without enabling it, the motion history alone, or the filter stopped all stream normally. Use the off sequence for this set file, as the IMX558 1925_03 entry already does. The choice comes from the sensor and set file the firmware reports, not from the board or the firmware version. Link: #2149 Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The J613 26.6.2 preview profile turned MBNR and the temporal filter off, chosen by the board compatible and the exact firmware version, with a preview_26 module parameter to turn it off again. Any other T8122 Mac on 26.6.2 was refused at probe. What it worked around is the temporal filter of the IMX558 1921_01 set file, which the sensor table now turns off for every Mac with that sensor. MBNR is not part of the problem: on the J615 (27.2 firmware) capture runs at 30 fps with MBNR on. So remove the profile, its board and version checks and the module parameter; MBNR is enabled as on every other ISP. The host tests now check that capture setup enables MBNR and runs the temporal filter setup on both interfaces, and test the firmware version parser on its own. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The firmware version parser only knows exact versions. Anything else is unknown, and unknown selects the 12.x command layout. On the J615 with ISP firmware 27.2 that layout's set file load, which carries a 32-bit address, times out (-62) and the camera never starts. Firmware newer than the newest known version now takes that version's layout, 26.6.2. On the J615 27.2 firmware this loads the set file and streams 1920x1080 at 30 fps. Older unknown versions stay unknown as before. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The T8132 ISP (M4) is the same generation as the T6040 and T6041 and writes the same frame metadata, but its match data did not set meta_exposure, so the GAIN and EXPOSURE_ABSOLUTE controls were missing. Userspace that decides on denoising from the gain, such as a camera filter, had nothing to read. Set it. On the J713 the controls appear, read 260/256 gain and 8.3 ms falling to 5.0 ms exposure as auto exposure settles in daylight, and streaming is unchanged (1920x1080 at 30 and 15 fps, no sequence gaps). Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
No blockers. I checked the five commits against the driver at the head. The PMU base now matches the T8122 power manager plus 0x4000, as the other SoCs use. The temporal filter choice comes from the set file the firmware reports (
HW row: J613, ISP firmware as installed, this series on the default command line: 1080p30 stream with MBNR on and the temporal filter off through the sensor table, open/stream/close x10 with 0 stop/IPC errors. The same run on one M1 Pro or M2 for the version mapping. Each with 0 AVC, 0 failed units, 0 new kernel errors. Assisted-by: LLM (Claude:Opus 5.5) |
|
Row on a production kernel: 15-inch M3 MacBook Air (J615),
Still owed from the PR description: a J613 26.6.2 row. |
|
J713 (M4 Air, macOS 27.2 stub) row: this PR's head merged into a candidate default kernel (J713 display/GPU/deep-sleep series + #2675 + #2700 + #2694), stock apple-isp, stock command line, one boot.
|
The T8122 ISP (M3) running 27.2 firmware writes the same exposure section in its frame metadata as the T6040 and T8140, but its match data did not set meta_exposure, so the GAIN and EXPOSURE_ABSOLUTE controls were missing and a camera filter that decides from the gain had nothing to read. Set it. On the J615 in the dark, the exposure follows the frame-rate cap (32.5 ms at 30 fps, 65.8 ms with dynamic frame rate on and at 15 fps) while the gain rises from 1.02x to 16.6x as auto exposure settles, and streaming is unchanged (1920x1080 at 30 and 15 fps, no sequence gaps). Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Blockers: 1.
|
Firmware newer than 26.6.2 took the 26.6.2 command layout by a version comparison, so builds that have never been run (26.6.3, 27.0, 30.0) were admitted with a guessed layout. Only 27.2.0 has been run with it (T8122). Map 27.2.0 exactly and leave every other newer build unknown: it then gets the 12.x layout, whose 32-bit set file load such firmware refuses, so the camera fails closed until a row adds its version. Log the choice for apple,firmware-compat only, not once per parsed property. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Pushed 0872ebb for the blocker, as one commit with no force push:
Nothing changes on the J615 (it reports 27.2.0) or the J713 (H17 ISP, selected by match data). The J613 26.6.2 row and an M1/M2 row are still owed. |
|
M4 Air row on a production kernel: J713,
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial Pre-PR Checklist Review (head 0872ebb5cd83)
0 code/policy/attribution/CI blockers. Holding only for the remaining §5 hardware rows below.
Checklist Summary (§1–§6)
- §1 No model gating: Pass. Removes the board/SoC/version
isp_preview26_admitted()gate (apple,j613/apple,t8122-isp/26.6.2) and keys temporal-filter disablement on the firmware-reported sensor/setfile (ISP_IMX558_1921_01->ISP_TEMPORAL_FILTER_OFF). Commit0872ebb5narrows theapple,firmware-compatmapping to exact27.2.0 -> ISP_FIRMWARE_V_26_6_2, leaving unverified newer versionsISP_FIRMWARE_V_UNKNOWNso they fail closed on the 32-bit setfile load. - §2 Production-ready: Pass. Removes the
preview_26module parameter (default cmdline), fixes the out-of-range T8122pmu_basetypo (0x2d07040000->0x2d0704000), logs the 27.2.0 layout message once forapple,firmware-compatonly, and updates both host tests. - §3 Safety: Pass. Fixes an invalid MMIO base passed to firmware;
isp_meta_read_exposure()bounds-checks the metadata section table and entry offsets before reading. - §4 Clean-room & attribution: Pass. All 7 commits carry human identity (
Ryan Murray) andSigned-off-by:with no agent trailers; PR body carriesAssisted-by:. - §6 Naming: Pass. Only updates existing test files; no new disallowed names introduced.
- CI: Green (
host-testsSUCCESS;mergeable=MERGEABLE).
Remaining §5 HW Rows Before Approve
- J613 (M3 Air 13", T8122, 26.6.2 firmware) at
0872ebb5on the default command line: confirm streaming with MBNR on and temporal filter off viaISP_IMX558_1921_01, 10/10 open/stream/close cycles with 0 stop/IPC errors, verifyV4L2_CID_GAINandV4L2_CID_EXPOSURE_ABSOLUTEread sensibly (or stay cleanly ignored if 26.6.2 metadata differs), plus 0 SELinux denials, 0 failed units, and 0 new kernel errors. - One other non-H17 ISP Mac (e.g., M1 Pro or M2) on 26.6.2 or 27.2.0 at
0872ebb5: confirm probe and streaming with MBNR on after removingisp_preview26_admitted()'s probe refusal (0 SELinux denials, 0 failed units, 0 new kernel errors).
(J713 on all 7 commits and J615 on commits 1–6 are already reported and clean.)
Assisted-by: LLM (Gemini 4 Neon)
|
Non-H17 ISP rows (M1 Pro J316s T6000 and M2 J413 T8112): default boot fleet78 carries commits 1-5 of this PR. Commits 6-7 only change the branch for firmware newer than 26.6.2 and the T8122 entry, so on these two Macs the module runs the same code as 0872ebb.
New kernel errors: none. On the M1 Pro, the only lines were the The J613 on 26.6.2 is still owed. We don't have one in our lab. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR Checklist Re-check — Upgrading to APPROVE (head 0872ebb5cd83)
All code, safety, attribution, and CI checks (host-tests green) were already clear at this head, and the newly posted non-H17 ISP hardware rows round out coverage across every affected Mac in the lab (§1/§5):
- M1 Pro (J316s, T6000, ISP fw 13.5.0) & M2 (J413, T8112, ISP fw 13.5.0): Both exercise
ISP_IMX558_1921_01(ISP_TEMPORAL_FILTER_OFF+ MBNR enabled): 24/24 (M1 Pro) and 26/26 (M2) NV12 modes at 30/15 fps with 0 sequence gaps, 10/10 open/stream/close cycles, 15 s s2idle with active 1080p30 stream (1200/1200 frames, 0 gaps, clean post-resume open),GAIN/EXPOSURE_ABSOLUTEcorrectly absent, 0 ISP errors, 0 SELinux denials, 0 failed units, 0 new kernel errors. - J615 (T8122, fw 27.2.0) & J713 (T8132, fw 27.2): Already verified clean across modes, cycles, WebRTC/PipeWire/GStreamer, s2idle, and
meta_exposuretracking.
(Non-blocking coverage note: J613 on 26.6.2 firmware — and non-H17 Macs on 26.6.2/27.2.0 — remain untested because J613 is not in the author's lab; please still solicit a J613 26.6.2 run when a machine is available.)
Assisted-by: LLM (Gemini 4 Neon)
Problem
On the 15-inch MacBook Air M3 (J615, T8122) the FaceTime camera delivers no frames on the macOS 27.2 firmware:
file load (32-bit address) times out with -62 and the camera does not start.
sensor's set file (IMX558 1921_01): the stream is accepted, no frame arrives, the next stop times out. media: apple: isp: T8122: camera on 14.7 firmware; drm/apple: J615 panel brightness #2149 saw the
same on a J613 with 14.7 firmware.
0x2d07040000, one hex digit too long and outside the SoC'sMMIO space (every other SoC: power manager +
0x4000; the T8122 power manager is at0x2d0700000). The 27.2firmware then never acknowledges the stop command.
The J613 26.6.2 preview profile (board check, exact firmware version,
preview_26parameter) worked around thefilter stall by turning MBNR and the temporal filter off on that one board.
Change
0x2d0704000), as found in media: apple: isp: T8122: camera on 14.7 firmware; drm/apple: J615 panel brightness #2149.already does). Chosen by the sensor and set file the firmware reports, not by board or firmware version.
version that has been run); any other newer build stays unknown and fails closed until a row adds it (commit 7,
from review).
meta_exposure, as on T6040/T6041 (same ISP generation and metadata size), so the per-frameGAIN and EXPOSURE_ABSOLUTE controls appear.
meta_exposuretoo. Its 27.2 frame metadata has the same exposure section, so the J615 reportsgain and exposure, and camera-denoise can decide from the gain.
Testing
J615, ISP firmware 27.2, fleet kernel (integration + Air PRs), this series as a module on the default boot:
v4l2src, PipeWire's default camera node, and Firefox 160 WebRTC (getUserMedia + a VP8 loopback) onboth of its camera backends.
after resume; a fresh open afterwards runs at 30.00 fps.
Since then on the J615's production kernel (
7.3.0-aurora-fleet78, which carries commits 1-5), stock module,default command line, dark room: 26/26 modes, 10/10 cycles, 0 stop or IPC errors, PipeWire and Firefox on both
backends, s2idle with a 1080p30 stream 900/900 frames
(#2670 (comment)).
J615, commit 6 as a module on that kernel, dark room: exposure follows the frame-rate cap (32.5 ms at 30 fps;
65.8 ms with dynamic frame rate on, and at 15 fps), and the gain rises from 1.02x to 16.6x as auto exposure settles.
camera-denoise switches from "no gain report" to "using the sensor gain". 1920x1080 at 29.99/15.01 fps, no gaps.
J713 production kernel
7.3.0-bj713t4+(carries all seven commits), stock module, dim room: GAIN/EXPOSURE_ABSOLUTEfollow auto exposure (gain 8.7x, 30.0 ms at 30 fps), 4/4 modes, 10/10 cycles, PipeWire + Firefox, s2idle with a stream
900/900 (#2670 (comment)).
J713 (T8132), commit 5 as a module: GAIN and EXPOSURE_ABSOLUTE appear and follow auto exposure (daylight: gain
260/256, exposure 8.3 ms falling to 5.0 ms); 1920x1080 at 30.02/15.01 fps, no gaps.
Host tests:
run-host-tests.py --only isp24/24 (the preview tests now cover the version parser and the capturesetup). checkpatch clean on all seven commits; no new W=1 warnings.
Still to run
scene from 9.5 to 0.63 (mean absolute luma difference). It needs a motion check before it replaces "off".
How the cause was found (J615, 27.2 firmware, module-only, fleet kernel, no reboot)
A lab module with runtime knobs (command layout, MBNR mode, temporal-filter sequence, PMU base), 60 frames of
1920x1080 NV12 at 30 fps per setting:
The stall does not depend on the PMU base. The PMU base changes the stop: with
0x2d0704000the firmwareacknowledges it ("never received magic number" and the forced coprocessor stop are gone).
No camera frame was stored: frames were reduced on the machine to sequence numbers, timestamps and sparse luma/chroma means.
Assisted-by: LLM (Claude:Opus 5.5)