Documentation
On this page

Subsystems

Audio

The speaker, the microphone and the audio server's plug-in.

Hardware

The audio front end (AFE, 0x11210000) and the MT6366 codec’s line-out (the DL1 path), a speaker amplifier on I2C3 (an AW87319 at 0x58; an SIA81xx sits beside it at 0x28), whose enable or one-wire pin is GPIO 164, and the main microphone on AIN0 through the codec’s UL path and VUL12. No earpiece or headset path is driven.

Driver

mtk_audio.c brings the pieces up in steps (mp_audio_steps), each with the ones before it: status, clocks and the codec’s digital path, a line-out tone, the amplifier checked and on, iOS playing through /dev/mapple-audio, and the microphone through /dev/mapple-mic, up only while it is open. The samples go through the speaker guard (speaker_guard.c) last, and the writes are held under Android’s levels: the speaker stays mp_audio_below (20 dB by default) under Android’s level, and the amplifier is on while there is sound and off after 3 s without. The AFE is in mt6781_afe.c.

Device tree

/arm-io/gpio lists pin 164 as driven; /arm-io/i2c3 (with --audio) is the amplifier’s bus; /product/haptics comes with the audio flag. See Device tree.

Boot-arguments

mp_audio_steps (5 by default, 0 on a safe boot), mp_audio_below, mp_audio_gain, mp_audio_secs in the catalogue.

User space

MappleAudio.driver, a CoreAudio HAL plug-in (audio/audio_plugin.c of mapple_userland), put in the root beside the audio server’s plug-ins when device.conf has audio 1 (the VirtualAudio plug-in is disabled in the root otherwise; with audio 1 it stays).

Status

device.conf: partial: the speaker (DL1, MT6366 line-out, AW87319) 20 dB under Android’s level through the guard, and the main mic (mp_audio_steps=5) while an app records; no earpiece or headset.

Seen: a ringtone, Control Center volume and keyboard clicks (run 30); Voice Memos recording and playing back through the main microphone (run 31), without a stall while recording (run 34).

Known issues

  • Quieter than Android: the 20 dB margin is deliberate (mp_audio_below).
  • No earpiece, headset or Bluetooth audio.

Source files

bsd/dev/mtk_audio.c, speaker_guard.c, mtk_audio_level.h of the kernel at 76b737c; osfmk/arm64/mt6781_afe.c of the MT6781 layer at 426b4f6; audio/audio_plugin.c of mapple_userland at 4f8127b.

Applies to realme 8i (spaced), release 1 · Updated 15 November 2026