Skip to content

Camera on the M3 MacBook Air (J613) with 26.6.2 firmware - #119

Closed
scottjones wants to merge 2 commits into
omacom:integration/aurorafrom
scottjones:t8122-camera-pr
Closed

scottjones wants to merge 2 commits into
omacom:integration/aurorafrom
scottjones:t8122-camera-pr

Conversation

@scottjones

Copy link
Copy Markdown
Collaborator

Drafted with an AI assistant (Claude Code); I reviewed it before opening. The commits carry Assisted-by: Claude:claude-opus-5-5.

The FaceTime camera on the 13" M3 Air (J613) streams on 26.6.2 OS firmware with these two driver changes, plus an ISP heap in m1n1 (not part of this PR, see below). Background and logs are in #117.

Commits

  1. media: apple: isp: recognise the 26.6.2 firmware. The driver didn't know 26.6.2, so fw_compat was unknown and isp_cmd_ch_set_file_load() sent the 32-bit CH_SET_FILE_LOAD record. The 26.6.2 firmware reads the 64-bit layout and faulted on the address it found there (FFW_Platform_Catch, far 0x3c00101c000); every later command timed out. Recognising 26.6.2 (after 14.7) selects the 64-bit record. That is the only fw_compat comparison in the driver.
  2. media: apple: isp: stream the IMX558 on 26.6.2 firmware. On that firmware:
    • Setfile: use 1925_03, the header version 0x21 IMX558 setfile in the 26.6.2 (25G83) appleh16camerad, as the H17 path already does.
    • Temporal filter: don't enable MBNR, the temporal filter or motion history. The firmware runs them through the neural engine (MLVNR ... aneclient not ready). With them on, the sensor streams, but every frame stays in the temporal filter's input queue (Raw output buffer unavailable, Host metadata unavailable), nothing is delivered, and the firmware asserts in CVideoFlowH15Cmd.cpp line 714 when the stream stops.

H17 and older firmware take the same paths as before.

Tested (J613)

The Mac runs system firmware 27.0 and OS firmware 26.6.2, with m1n1 aurora17-5 plus a T8122 + 26.6.2 ISP heap. The kernel is 2026.10.11.15, and this branch's two commits were built as apple-isp.ko on that base with the release config and toolchain.

Check Result
Probe ISP firmware-compat: 26.6.2, sensor 0x558 detected, /dev/video1 with the IMX558 presets
Setfile isp_1925_03XX.dat loads in about 1 ms
Capture 1920×1080 NV12, 60 frames at 30.03 fps, twice in a row (firmware stopped and booted again in between); exposed, in colour
Browser Google Meet shows live video (with an earlier build: these changes plus the two experiments below)
Indicator camera light on while streaming, off afterwards

To narrow it down I also tried resident firmware (as on T8140) and allocating the 0x5240-byte capture metadata the firmware reports in CH_INFO_GET. Neither is needed. Re-enabling the temporal filter stages brings the stall and the assert back.

On integration/aurora (cadfb30a) both commits apply cleanly, checkpatch is clean, and drivers/media/platform/apple/isp compiles with the release config. I didn't do a full kernel build there.

Not in this PR

🤖 Generated with Claude Code

m1n1 sets apple,firmware-version and apple,firmware-compat to 26.6.2 on a
13" M3 MacBook Air (J613) whose stub runs macOS 26.6.2 (25G83) OS
firmware. The driver did not know that version, so fw_compat was unknown
and isp_cmd_ch_set_file_load() sent the 32-bit CH_SET_FILE_LOAD record.
The 26.6.2 firmware reads the 64-bit layout: it took the setfile address
from the wrong fields and faulted on it (FFW_Platform_Catch, far
0x3c00101c000, the data surface at 0x101c000 with garbage above it), and
every later command timed out.

Recognise 26.6.2, which orders after 14.7, so the 64-bit record is used.
That is the only place the driver compares fw_compat.

Tested on J613 (system firmware 27.0, OS firmware 26.6.2): the setfile
loads in about 1 ms instead of faulting.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Scott Jones <[email protected]>
With the 26.6.2 firmware recognised, the J613 IMX558 streams once two
more things change for that firmware:

- Setfile: use 1925_03, the header version 0x21 IMX558 setfile in the
  26.6.2 (25G83) appleh16camerad, as the H17 firmware already does.
  1925_03 is what this was tested with; 1921_01 crashed the firmware
  before the CH_SET_FILE_LOAD fix and was not retried after it.

- Temporal filter: do not enable MBNR, the temporal filter or motion
  history. This firmware runs them through the neural engine (it logs
  "MLVNR ... aneclient not ready"). With them enabled, the sensor
  streams, but every frame stays in the temporal filter's input queue:
  the firmware reports "Raw output buffer unavailable" and "Host
  metadata unavailable", delivers nothing, and asserts in
  CVideoFlowH15Cmd.cpp line 714 when the stream is stopped. With them
  off, frames reach the host.

H17 and older firmware are unchanged.

Tested on J613 (system firmware 27.0, OS firmware 26.6.2, m1n1 with an
ISP heap for T8122 on 26.6.2): 1920x1080 NV12 at 30 fps, exposed and in
colour with the setfile; two streams in a row, with the firmware stopped
and booted again in between.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Scott Jones <[email protected]>
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.

1 participant