Repository navigation
ASoC: apple: t8140-aop-audio: drive the speakers to full scale - #1201
Merged
Merged
Conversation
The speaker front-end converted each S32 sample to the float the LEAP consumes through a ceiling of 0.5, on the belief that the LEAP doubles its input: a sine written as 6 791 000/2^31 read back on the SpeakerTap with a peak of 13 582 000. The tap is not the transmitter's format, though. The ADT describes the speaker stream as 32-bit words and the tap as 24-bit samples in 32-bit slots with its own framing, so its words do not give the wire's scale. Measured from outside the machine, the speakers fall 6 dB short of macOS. The same 80 s program through the same speaker chain (Linux at full volume, macOS at volume scalar 1.0, its 0 dB) recorded by four raw external microphones on other Macs (2026-11-08): pink -30 dBFS -5.8 / -5.9 / -6.0 / -5.7 dB(A) pink -18 dBFS -5.7 / -5.7 / -5.8 / -5.7 dB(A) sweep -12 dBFS -5.7 / -5.8 / -4.9 / -5.7 dB(A) and every 1/3-octave group from 125 Hz to 16 kHz within -4.8..-5.9 dB: a flat gain, not tone, and a factor of two. macOS keeps its speaker output within digital full scale and does not wrap, so a float of 1.0 is the wire's full scale and the 0.5 ceiling left both amplifiers 6 dB below it. Make the ceiling unity: a full-scale S32 sample is a float of 1.0. The "Speaker Playback Volume" table is regenerated against it (still 0.5 dB steps, 127 = 0 dB, 87 = macaudio's safe level 20 dB down), so a protection engine that owns the speakers now drives the amplifiers at the full scale its own model already assumes. Unowned, playback stays refused. The KUnit suite checks the new full scale and the exact conversions at it. Checked on the J700 with sound, same session and microphone positions, stock kernel vs this change, both at full volume under speakerguardd v2, four raw external microphones (2026-11-08 17:16-17:24): pink -18 dBFS +5.8 / +5.8 / +6.0 / +5.9 dB(A) sweep -12 dBFS +5.8 / +6.0 / +5.9 / +5.8 dB(A) music +5.5 / +5.5 / +5.8 / +5.4 dB(A) with every 1/3-octave group from 125 Hz to 16 kHz within +4.8..+6.2 dB, two passes repeating within 0.1 dB, and no amplifier fault, wrap or distortion signature. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
Contributor
Author
|
Qualification done (2026-11-08 17:35-19:08). On the J700 with this change plus speakerguardd v2 RC6, at full volume:
Ready for the merge train. |
RyanTheTide
added a commit
that referenced
this pull request
Nov 8, 2026
Brings #1122, #1123, #1124 (T8142 DART/MTP/MSI), #1176 (G17 fw-id fence), #1201 (J700 speaker full scale) and the rest of integration since 11943fb into aurora-wip. Conflicts were in four device-tree binding documents only, where aurora-wip has the T8152 versions and integration the T8142/T8152/T6050 generalisation: - apple,admac: keep both the lone apple,t8152-admac and the apple,t6050-admac/apple,t8140-admac pair. - apple,t8152-aop: take integration (it still allows a lone apple,t8152-aop, one or two mailboxes). - apple,t8152-aop-audio: take integration and keep a lone apple,t8152-aop-audio compatible. - apple,dwc3: keep the T8152 host-mode rules, and require resets and usb-role-switch on every enabled non-T8152 controller. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
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.
The J700 (MacBook Neo) speakers played 6 dB quieter than macOS at full volume. The cause is in the kernel, not in speakerguardd: the AOP speaker front-end mapped a full-scale S32 sample to a LEAP float of 0.5. This makes a full-scale sample a float of 1.0.
Why 0.5 was wrong
The 0.5 ceiling came from a SpeakerTap readback during bring-up (a sine written at 6 791 000/2^31 read back at 13 582 000). The ADT describes the speaker stream as 32-bit words and the tap as 24-bit samples in 32-bit slots with different framing, so the tap words do not show the wire's scale. macOS keeps its speaker output within digital full scale and does not wrap, yet it is 2x louder for the same chain output, so the wire's full scale is a float of 1.0.
Measurements
Same 80 s program, four raw external microphones on other Macs (J616s Snowball, J616s HQ mic, M2 HQ mic, M1 Pro HQ mic), dB(A).
Before (2026-11-08 12:45/12:48, Linux at full volume vs macOS at volume scalar 1.0):
Every 1/3-octave group from 125 Hz to 16 kHz was within -4.8..-5.9 dB: a flat factor of two.
This change, same session and microphone positions (17:16-17:24), stock fleet kernel vs the same kernel plus this commit, both at full volume under speakerguardd v2:
Safety
Testing
Merge-train notes: one file,
sound/soc/apple/aop_t8140.rs, J700 only. Based on integration/aurora e636747, so it merges cleanly.🤖 Generated with Claude Code