Skip to content

iPhone XR: sound in the desktop - #116

Merged
henrikklee merged 2 commits into
mainfrom
a12-desktop-audio
Dec 2, 2026
Merged

henrikklee merged 2 commits into
mainfrom
a12-desktop-audio

Conversation

@henrikklee

Copy link
Copy Markdown

Makes the XR's speakers and microphone work in the desktop (PipeWire), not only on bare ALSA:

  • Codec start: the CS42L75's speaker protection DSP often didn't boot on the first start (state 08), at boot as well as on a reload, so the sound card was missing after boot. The driver now resets the codec and starts it again, up to three times.
  • Sample formats: PipeWire opened the speakers at 32 bits, and the amplifier refused them (-EINVAL). The card now offers only the formats the codecs take.
  • 16-bit recording: 24 and 32-bit captures came out as garbage, because the A12's MCA receives only the top 16 of the codec's 24 bits correctly. Recording is offered at 16 bits only, which records cleanly.

Tested on the XR with Omarchy A. After boot, PipeWire lists Built-in Audio Speakers and Internal Microphone. A desktop recording gives real data, with silence at -77 dBFS, and no more ASoC errors. On a module reload the first CLP start failed with state 08 and the retry brought it up.

On the iPhone XR the speaker protection DSP often does not boot on the
first start (state 08), at boot as on a reload; a reset and another
start of the codec bring it up, so retry the whole start up to three
times.

The codec sends 24-bit samples, but the A12's MCA receives only their
top 16 bits correctly so far: 24 and 32-bit captures came out as
garbage. Offer 16-bit capture only, which records cleanly.

Assisted-by: LLM
Signed-off-by: Henrik Klee <henrik@goat-code.com>
The MCA front end offers 16, 24 and 32-bit samples, the amplifiers take
16 and 24 bits and the codec records 16: PipeWire opened the speakers
at 32 bits and the amplifier refused them (-EINVAL). Merge the back
ends' formats into the front ends'.

Assisted-by: LLM
Signed-off-by: Henrik Klee <henrik@goat-code.com>
@henrikklee
henrikklee merged commit c4800ea into main Dec 2, 2026
4 checks passed
@henrikklee
henrikklee deleted the a12-desktop-audio branch December 2, 2026 22:53
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