Repository navigation
j81: speakers — SmartIO, MCA v1 and MAX98721 on the iPad Air 2 - #192
Merged
Merged
Conversation
What the iPad Air 2's ADT and 19H422 kernelcache say about its audio path (SmartIO + MCA v1, two MAX98721 speaker amps on i2c1, CS42L81 on spi1), what the A9/A10 path already covers, the plan and the speaker-safety rules. No driver or device change yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The iPad Air 2's audio DMA runs through SmartIO, as on A9 and A10. Its firmware is the __DATA,__firmware section of AppleT7000SmartIO in the board's kernelcache (19H422: 493792 bytes, a 32-bit ARM image). - smartio: accept com.apple.driver.AppleT7000SmartIO. - devices/j81/firmware.json: read the kernelcache and write lib/firmware/apple/t7000-smartio.bin with smartio-from-kernelcache@2. No driver loads it yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enable the bus without clients, so the two MAX98721 amplifiers (0x31, 0x34) can be identified from user space before a driver exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The iPad Air 2's SmartIO is an AppleA7IOP version 1: same firmware protocol and boot order as the S8000/T8010 (version 2), different register offsets, no mask mirror and no 0xb84 status. apple-sio-core gets a per-version register table and apple,t7000-sio (MCA0 and MCA3 endpoints of the J81); S8000 and T8010 program the same registers in the same order as before. The binding gains the compatible, without a shim region for it. Builds as a module for apple-4k. Not run on hardware yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The iPad Air 2's MCAs are mca-version 1, driven in iOS by the same AppleAE2MCA as the A9/A10 ones through _setIISConfig_v1. The fields keep their encoding; offsets, the interrupt status/enable pair, the MCLK divider and the CFG constants differ. The A5 driver (Cascadia s5l-audio.c, hardware-tested) programs the same values. s8000-mca gets a per-version register table, translates its interrupt causes to the version 1 registers, allows a frame longer than its slots (PAD), and adds apple,t7001-mca with the J81 speaker link (MCA3: provider, 2 channels in 8 slots, 256-bit frame). Version 4 and 5 variants program the same registers and values as before. Builds as a module for apple-4k. Not run on hardware yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The iPad Air 2 has two MAX98721 boosted class-D amplifiers on I2C1 (0x31 and 0x34), fed by MCA3 in TDM slots 0 and 1. Their registers follow the MAX98925 map; the sequence follows iOS 15's AppleMAX98721Amp (19H422): TDM consumer at 256 BCLKs per frame, limiter, boost and boost current from the ADT speaker-config record, gain capped at iOS's value and starting at 0, and the amplifiers enabled only while a stream runs. A new small driver (max98721.c, reusing max98925.h) rather than an extension of max98925.c, which needs an MCLK and only handles 32-64 BCLKs per frame. Built as a module in both configs; no device tree binds it yet. Not run on hardware yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The A8X NCO is the block of the T8010 variant (iOS: AppleS5L8960XNCO, the same control bits), with its channels 0x1000 apart instead of 0x4000: iOS falls back to a 0x1000 page when the ADT has no pmgr-nco-page-size, and the T7001 ADT has none. Add apple,t7001-nco. The binding patch sits after the sound patch that adds apple,t8010-nco to the same list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Describe SmartIO, the i2s-switch, MCA3 (the speaker link) and the NCO in t7001.dtsi, all disabled, with values from Apple's J81 device tree. Enable SmartIO on the Air 2. The NCO reference rate is not in the IPSW ADT (iBoot fills it in), so the NCO, MCA3, the amplifiers and the sound card stay off until it has been read from a running device. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The NCO reference rate comes from a running J81's Apple device tree (clock-frequencies[10] = 342857142 Hz); with it the NCO, the i2s-switch and MCA3 are enabled on the Air 2. The amplifiers and the sound card follow after the read-only probe of the amplifiers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a J81 the SmartIO firmware booted, but the driver's first reply to its ready message failed: on AppleA7IOP version 1 the AP enables the send FIFO itself (it read 0x00020000, disabled). The MCA version register reads 0x00010002, the version in its upper half. Both fixes are in the version 1 paths only. The amplifiers answer at 0x31 and 0x34 with revision 0x80; the docs record the probe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two MAX98721 amplifiers on I2C1 and an audio-graph-card2 card that plays to both from MCA3 (one TDM link, slot 0 to 0x31, slot 1 to 0x34), the graph port in the MCA binding, and CONFIG_SND_AUDIO_GRAPH_CARD2=m. Not yet played on hardware: with MCA3 enabled, RAM boots of this kernel freeze early in 4 of 5 attempts (bisected to enabling the MCA3 node; see docs/j81-audio.md). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lti refcounts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The amplifiers' gain controls start at 0 (muted) and PipeWire does not
know them by name, so without a profile the card plays silence. The
profile sets both to 22, the level iOS uses and the most the driver
allows; PipeWire's software volume applies on top.
Tested on a J81 with Omarchy: WirePlumber picks the profile ("Built-in
Audio Speakers") and sets both controls; pw-play is heard.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both speakers play through PipeWire on an installed Omarchy, so audio_output is working; the headphone jack and the microphones are not supported yet. drivers.json's j81 entry comes from this branch's apple-4k kernel, where the MCA driver binds the speaker link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 20, 2026
SmartIO on the A8/A8X (AppleA7IOP version 1), MCA version 1 in the S8000 MCA driver, the MAX98721 speaker amplifier driver, the T7001 NCO, the device tree and a UCM profile; both speakers play in stereo. The headphone jack and the microphones are not part of it. Squashed from ricktav's j81/audio (17aa5eb); patch files renumbered to follow main.
henrikklee
marked this pull request as ready for review
November 22, 2026 18:06
Patch numbers follow main's, and the changelog, compatibility table and driver catalog are combined with the other J81 changes. ricktav's patches are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The iPad Air 2's (J81, A8X / T7001) speakers. With this, both speakers play in stereo, on an installed Omarchy through PipeWire as well: an ALSA card "J81 Speakers" with a UCM profile, so PipeWire offers it as "Built-in Audio Speakers".
The A8X audio path is the one the A9/A10 support already uses (SmartIO DMA → MCA → i2s-switch → amplifiers), but with older versions of each block. This PR adds those versions and the amplifier driver, and describes the speaker link in the device tree.
Changes
drivers/soc-apple0028-0029): the A8/A8X SmartIO runs AppleA7IOP version 1 mailboxes. On V1 the AP has to enable the send FIFO itself; without that, setup fails with -EBUSY.devices/j81/firmware.jsonstages the A8X SmartIO firmware (smartio-from-kernelcache@2).drivers/sound0020-0021): the T7001 register layout, from iOS 15.8's_setIISConfig_v1. The version register carries the version in its upper half. The speaker link runs TDM, 8×16-bit slots in a 256-bit frame, with the bit clock from an AP NCO channel at twice SCLK. As on J71b, output is bounded to -12 dB until there is speaker protection.drivers/clk0007,drivers/sound0025 binding): the T7001 variant (0x1000 channel stride, from iOS'sAppleS5L8960XNCO). Its reference is 342857142 Hz, from the live ADT'sclock-frequencies.drivers/sound0022-0023): a new codec driver. MAX98721 has no public datasheet; every register iOS writes matches the MAX98925 map, so the driver uses that map. It writes the protection values from Apple'sspeaker-config(limiter, boost, current limit), and turns the amplifier on only while a stream runs.drivers/sound0027): a fix for the "multi" link's port references.graph_get_next_multi_ep()drops the reference of the port it is given, and two callers dropped it again. Each deferred probe of a card with a "multi" node took the port's refcount below zero ("refcount_t: addition on 0; use-after-free"). This is not specific to Apple hardware.devices/t70010012-0016; bindingsdrivers/sound0024 i2s-switch syscon, 0026 MCA graph port): I2C1, SmartIO, the i2s-switch, MCA3, the NCO and the two amplifiers, and anaudio-graph-card2card. Everything is described int7001.dtsiand disabled there, then enabled ont7001-air2. The card has one CPU and two codecs on one TDM link ("semi-multi"); slot 0 is the left speaker (0x31), slot 1 the right (0x34).CONFIG_SND_AUDIO_GRAPH_CARD2=min both configs.system/defaults/usr/share/alsa/ucm2,conf.d/J81_SpeakersandOrchard/ipad-air2): both amplifiers' gain controls start at 0 (muted), and PipeWire doesn't know them by name. Without a profile, the card plays silence. The profile sets both to 22, and PipeWire's software volume applies on top, as on the iPad 6 and 7.audio_outputisworking, with a note that the headphone jack isn't supported. The j81 entry intools/catalog/drivers.jsoncomes from this branch's apple-4k kernel. Includes the regenerated matrix and a CHANGELOG line.docs/j81-audio.mdhas the hardware table, the status and the test log.Speaker safety
There is no speaker protection (thermal or excursion model) yet, so:
Not included
Testing
orchard run) with a probe payload built from this branch's apple-4k kernel.hw_ptradvances at 48000 frames/s with no underruns. MCA3 TX is enabled and the frame running. The NCO runs at 24.576 MHz. The i2s-switch routes MCA3 to pad 3. Both amplifiers have their global enable set and no status flags.orchard launch):boot-entries sync. That system predates the SmartIO recipe, so I copied in the firmware file the recipe makes (same sha256).pw-playand a web game in the browser play through the speakers.orchard installwith the new firmware recipe.kernel/audit-patches.pypasses for apple-4k and apple-16k.python -m unittest discover -s tests: everything passes except the 5 tests intest_ramandtest_cascadia_loaderthat also fail on unmodifiedmainon this host.🤖 Generated with Claude Code