Skip to content

media: apple: isp: M3 Air camera on 27.2 firmware; T8122 and T8132 gain and exposure - #2670

Merged
RyanTheTide merged 7 commits into
integration/aurorafrom
airs-camera/t8122-isp-272
Nov 22, 2026
Merged

RyanTheTide merged 7 commits into
integration/aurorafrom
airs-camera/t8122-isp-272

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On the 15-inch MacBook Air M3 (J615, T8122) the FaceTime camera delivers no frames on the macOS 27.2 firmware:

  • The version parser only knows exact versions, so 27.2 reads as unknown and gets the 12.x command layout. Its set
    file load (32-bit address) times out with -62 and the camera does not start.
  • With the right layout, starting the temporal filter at the strength the firmware gives (1) stalls capture with this
    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.
  • The T8122 entry gives the ISP firmware a PMU base of 0x2d07040000, one hex digit too long and outside the SoC's
    MMIO space (every other SoC: power manager + 0x4000; the T8122 power manager is at 0x2d0700000). The 27.2
    firmware then never acknowledges the stop command.

The J613 26.6.2 preview profile (board check, exact firmware version, preview_26 parameter) worked around the
filter stall by turning MBNR and the temporal filter off on that one board.

Change

  1. Fix the T8122 PMU base (0x2d0704000), as found in media: apple: isp: T8122: camera on 14.7 firmware; drm/apple: J615 panel brightness #2149.
  2. Run the IMX558 1921_01 set file without the temporal filter (sensor table entry, as the IMX558 1925_03 entry
    already does). Chosen by the sensor and set file the firmware reports, not by board or firmware version.
  3. Drop the J613 26.6.2 preview profile and its module parameter. MBNR runs as on every other ISP.
  4. Read firmware 27.2.0 with the 26.6.2 command layout instead of the 12.x one. Only 27.2.0 is mapped (it is the
    version that has been run); any other newer build stays unknown and fails closed until a row adds it (commit 7,
    from review).
  5. T8132 (M4): set meta_exposure, as on T6040/T6041 (same ISP generation and metadata size), so the per-frame
    GAIN and EXPOSURE_ABSOLUTE controls appear.
  6. T8122 (M3): set meta_exposure too. Its 27.2 frame metadata has the same exposure section, so the J615 reports
    gain 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:

  • All 26 modes (13 NV12 sizes, 30 and 15 fps): exact frame rate, no sequence gaps, first frame 1.12 s. Before: 0 frames.
  • 10/10 open/stream/close cycles; 0 stop or IPC errors over the whole run (before: every stop timed out).
  • GStreamer v4l2src, PipeWire's default camera node, and Firefox 160 WebRTC (getUserMedia + a VP8 loopback) on
    both of its camera backends.
  • s2idle (22 s, RTC wake) with a 1080p30 stream running: 900/900 frames, no sequence gaps, the stream continues
    after resume; a fresh open afterwards runs at 30.00 fps.
  • Exposure priority 1 in a dark room drops to 17.5 fps as intended; the T8122 default (0) holds 30 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_ABSOLUTE
follow 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 isp 24/24 (the preview tests now cover the version parser and the capture
setup). checkpatch clean on all seven commits; no new W=1 warnings.

Still to run

  • A J613 row (same T8122 ISP and IMX558 1921_01 set file): the filter now turns off through the sensor table, as the removed profile did, with MBNR on. On its 26.6.2 firmware this also checks that commit 6's gain and exposure read sensibly (a section this layout does not describe reads as zero and is ignored).
  • Follow-up, not in this PR: starting the filter at strength 0 streams too and cuts frame-to-frame noise on a still
    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:

layout MBNR temporal filter frames
12.x (27.2 unknown) off disable set file load -62, STREAMON fails
26.6.2 off / on disable 60/60, 30.00 fps
26.6.2 off / on disable + history stop + stop (off sequence) 60/60, 30.00 fps
26.6.2 off / on start(1) + history + enable 0
26.6.2 on start(1) + enable 0
26.6.2 on start(1) only / history + enable / start(0) + history + enable / band0 set 60/60 each

The stall does not depend on the PMU base. The PMU base changes the stop: with 0x2d0704000 the firmware
acknowledges 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)

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>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

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 (isp-cam.c:71-72 -> isp_ch_configure_temporal_filter(), isp-cam.c:918). Removing preview_26 takes out the board/version admission check and the module parameter with it. isp-cmd.c:383 is the only place that reads fw_compat (the 32- vs 64-bit set file load), so the new version mapping changes only that. Commits have a human Signed-off-by and no agent trailers.

  1. drivers/media/platform/apple/isp/isp-drv.c:749-754: the "newer than 26.6.2" mapping applies to every non-H17 ISP (T8103/T600x/T8112/T602x/T8122), not only T8122. Any of them whose apple,firmware-compat reads above 26.6.2 now switches from the 32-bit to the 64-bit set file load. That is probably right, since 13.5 and later all use the 64-bit layout, but the only proof is on T8122. Please add one more non-H17 ISP Mac that reports a compat above 26.6.2 (M1 Pro or M2) to the rows. Also, isp_check_firmware_version() calls this parser for both apple,firmware-version and apple,firmware-compat, so the new dev_info prints twice on every probe. Logging only for the compat property, or dropping it to dev_dbg, would avoid that.
  2. Nit, not for this PR: isp-drv.c:1175 keeps pmu_base in the per-SoC match data. The bug fixed here, one extra hex digit, is what you get from a hand-copied table. The pmgr node's reg in the DT already carries this address (plus the fixed 0x4000), so reading it from there would remove the table entry.

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)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Row on a production kernel: 15-inch M3 MacBook Air (J615), 7.3.0-aurora-fleet78, which carries this PR's five commits. Stock apple_isp, default command line, macOS 27.2 firmware, dark room.

  • Probe: apple,firmware-compat 27.2.0 is newer than 26.6.2, using its layout, sensor 0x558, set file 1921_01.
  • 26/26 modes (13 NV12 sizes at 30 and 15 fps): exact rate, 0 sequence gaps, first frame 1.12 s.
  • 10/10 open/stream/close cycles at 1080p30.
  • GStreamer v4l2src 300 buffers: 11.15 s. The default PipeWire source and Firefox 160 WebRTC (V4L2 and portal backends) also stream.
  • s2idle for 22 s with a 1080p30 stream running: 900/900 frames, 0 gaps. A fresh open after resume runs at 30.00 fps.
  • 0 ISP stop or IPC errors over the run (no never received magic number).
  • Exposure priority in the dark: 0 gives 29.99 fps, 1 gives 15.53 fps.

Still owed from the PR description: a J613 26.6.2 row.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

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.

  • 1080p30 NV12, 120 frames, 0 sequence gaps.
  • Per-frame gain and exposure are reported and track the scene: gain rose from 260 to 2708 (1/256 units) and exposure from 83 to 500 (100 µs units) in a dark room. The frame rate dropped to 20.5 fps there because of the 50 ms exposure.
  • 0 ISP errors, 0 failed units.

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>
@RyanTheTide RyanTheTide changed the title media: apple: isp: M3 Air camera on 27.2 firmware; T8132 gain and exposure media: apple: isp: M3 Air camera on 27.2 firmware; T8122 and T8132 gain and exposure Nov 21, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 1.

  1. isp-drv.c:743-754: any firmware-compat newer than 26.6.2 now gets the 26.6.2 layout. That includes versions never run (the host test asserts 30.0.0), on every non-H17 ISP. Only 27.2.0 on T8122 has been run. Please map the verified version(s) exactly (27.2.0 -> ISP_FIRMWARE_V_26_6_2) and leave other versions unknown, so a new firmware is one line backed by a row instead of an assumption.
    The rest looks right: the PMU base fix matches pmgr + 0x4000, the temporal filter choice is keyed on the reported sensor and set file, dropping the J613 profile removes a board/version check and a module parameter, and meta_exposure on T8132 matches T6040/T6041. Smaller: the new dev_info at isp-drv.c:751 prints twice per probe, because the parser runs for both firmware-version and firmware-compat. Removing the refusal also means every non-H17 Mac on 26.6.2 now probes with MBNR on. Rows still owed: J613 on 26.6.2 with this head (MBNR on, filter off via the sensor table, 10 open/stream/close cycles), and one M1/M2 whose compat mapping changes.

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>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Pushed 0872ebb for the blocker, as one commit with no force push:

  • isp_read_fw_version() now maps only 27.2.0 to the 26.6.2 layout. Every other newer build (26.6.3, 26.7, 27.0, 27.2.1, 30.0) stays unknown, so it fails closed until a row adds its version.
  • The layout line is logged for apple,firmware-compat only, so it no longer prints twice per probe.
  • tools/asahi/isp-preview-tests.py asserts the new mapping and passes. tools/asahi/isp-tests.py passes too. W=1 build of drivers/media/platform/apple/isp/ adds no new warnings (the isp-ipc.c fortify warning and the unused apple_isp_hw_t6040 are already there on the base). checkpatch is clean.

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.

@RyanTheTide

RyanTheTide commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

M4 Air row on a production kernel: J713, 7.3.0-bj713t4+ (integration plus the J713 PRs, including this PR with all seven commits), stock module, default command line, dim room.

  • GAIN and EXPOSURE_ABSOLUTE are present and follow auto exposure: gain 260 -> 2232/256 (8.7x), exposure 8.3 -> 30.0 ms at 30 fps. camera-denoise logs using the sensor gain from /dev/video0.
  • 4/4 modes (1920x1080 and 1280x720 at 30 and 15 fps): exact rate, no sequence gaps, first frame 0.47 s. 10/10 open/close cycles.
  • GStreamer v4l2src, the default PipeWire source, and Firefox 160 WebRTC on both backends all stream. 0 ISP stop or IPC errors.
  • s2idle for 15 s (suspend_stats success 1) with a 1080p30 stream: 900/900 frames, no gaps. A fresh open after resume runs at 30.19 fps.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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). Commit 0872ebb5 narrows the apple,firmware-compat mapping to exact 27.2.0 -> ISP_FIRMWARE_V_26_6_2, leaving unverified newer versions ISP_FIRMWARE_V_UNKNOWN so they fail closed on the 32-bit setfile load.
  • §2 Production-ready: Pass. Removes the preview_26 module parameter (default cmdline), fixes the out-of-range T8122 pmu_base typo (0x2d07040000 -> 0x2d0704000), logs the 27.2.0 layout message once for apple,firmware-compat only, 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) and Signed-off-by: with no agent trailers; PR body carries Assisted-by:.
  • §6 Naming: Pass. Only updates existing test files; no new disallowed names introduced.
  • CI: Green (host-tests SUCCESS; mergeable=MERGEABLE).

Remaining §5 HW Rows Before Approve

  1. J613 (M3 Air 13", T8122, 26.6.2 firmware) at 0872ebb5 on the default command line: confirm streaming with MBNR on and temporal filter off via ISP_IMX558_1921_01, 10/10 open/stream/close cycles with 0 stop/IPC errors, verify V4L2_CID_GAIN and V4L2_CID_EXPOSURE_ABSOLUTE read sensibly (or stay cleanly ignored if 26.6.2 metadata differs), plus 0 SELinux denials, 0 failed units, and 0 new kernel errors.
  2. 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 removing isp_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)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Non-H17 ISP rows (M1 Pro J316s T6000 and M2 J413 T8112): default boot 7.3.0-aurora-fleet78, stock apple-isp, default command line, ISP firmware 13.5.0. Both cameras report the IMX558 isp_1921_01XX.dat set file, so the temporal-filter entry from this PR applies to them, with MBNR on.

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.

M1 Pro M2
every NV12 size at 30 and 15 fps, 60 frames each 24/24, 0 sequence gaps, 30.21 / 15.06 fps 26/26, 0 gaps, 29.97 / 15.00 fps
open/stream/close cycles at 1080p30 10/10, 0 gaps 10/10, 0 gaps
s2idle for 15 s (RTC wake) with a 1080p30 stream 1200/1200 frames, 0 gaps 1200/1200 frames, 0 gaps
fresh open after resume 30.21 fps 29.97 fps
GAIN / EXPOSURE_ABSOLUTE not offered (no meta_exposure on T6000) not offered (T8112)
ISP errors, SELinux denials, failed units 0, 0, 0 0, 0, 0

New kernel errors: none. On the M1 Pro, the only lines were the dwc3 genpd_prepare -11 messages that every suspend logs on that Mac.

The J613 on 26.6.2 is still owed. We don't have one in our lab.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_ABSOLUTE correctly 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_exposure tracking.

(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)

@RyanTheTide
RyanTheTide merged commit 27bae42 into integration/aurora Nov 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants