Wiring
The audio path is Radxa ZERO 3W → UDA1334A DAC → MAX98306 amplifier → two 4 Ω drivers (the TPA2012 still works in the MAX98306's place, see TPA2012 instead of the MAX98306). The Radxa sends digital I2S on three header pins, the DAC turns it into line-level stereo, and the MAX98306 amplifies that into the speakers. The DAC's 3.5 mm jack carries the same line-level signal for headphones or active speakers. Everything runs from the Radxa's 5 V.
Before anything is powered: check the amplifier's gain (see Gain and signal level). The MAX98306 board ships at 9 dB, which is safe with the UDA1334A; 12 dB gives full power. The Adafruit TPA2012 board ships at 24 dB (G0 and G1 pulled high): set it to 12 dB first. At 24 dB it clips hard at low volume, which sounds terrible and stresses the drivers.
Complete wiring diagram
flowchart LR
classDef power fill:#fde2e2,stroke:#c62828,color:#000
classDef ground fill:#e5e7eb,stroke:#374151,color:#000
classDef i2s fill:#dbeafe,stroke:#1d4ed8,color:#000
classDef analog fill:#dcfce7,stroke:#15803d,color:#000
classDef ctrl fill:#fef3c7,stroke:#b45309,color:#000
classDef spk fill:#f3e8ff,stroke:#7e22ce,color:#000
classDef open fill:#ffffff,stroke:#9ca3af,stroke-dasharray:4 3,color:#6b7280
PSU["USB-C power supply<br/>5 V / 3 A"]
subgraph RADXA["Radxa ZERO 3W — 40-pin header"]
direction TB
R4["pin 4 · 5V"]:::power
R6["pin 6 · GND"]:::ground
R12["pin 12 · GPIO3_A3<br/>I2S3_SCLK_M0"]:::i2s
R35["pin 35 · GPIO3_A4<br/>I2S3_LRCK_M0"]:::i2s
R40["pin 40 · GPIO3_A5<br/>I2S3_SDO_M0"]:::i2s
R2["pin 2 · 5V"]:::power
R9["pin 9 · GND"]:::ground
R15["pin 15 · GPIO3_B0<br/>(gpiochip3 line 8)"]:::ctrl
end
subgraph DAC["UDA1334A DAC (Adafruit #3678)"]
direction TB
DVIN["VIN"]:::power
D3V["3VO · unconnected"]:::open
DGND["GND"]:::ground
DWSEL["WSEL"]:::i2s
DDIN["DIN"]:::i2s
DBCLK["BCLK"]:::i2s
DL["LOUT"]:::analog
DAG["AGND"]:::ground
DR["ROUT"]:::analog
DJACK["3.5 mm jack<br/>(same signal)"]:::analog
end
subgraph AMP["MAX98306 amplifier (Adafruit #987)"]
direction TB
ALP["L+ in"]:::analog
ALM["L− in"]:::analog
ARM["R− in"]:::analog
ARP["R+ in"]:::analog
AVDD["VDD"]:::power
AGND["GND"]:::ground
AGAIN["gain jumper · 12 dB"]
ASD["SD"]:::ctrl
AOLP["L+ out"]:::spk
AOLM["L− out"]:::spk
AORP["R+ out"]:::spk
AORM["R− out"]:::spk
end
CAP["470–1000 µF / 10 V<br/>(+ to VDD, − to GND)"]:::power
subgraph SPK["ANGGREK 3-inch drivers, 4 Ω / 5 W"]
direction TB
SLP["Left +"]:::spk
SLM["Left −"]:::spk
SRP["Right +"]:::spk
SRM["Right −"]:::spk
end
PSU == "USB-C" ==> RADXA
R4 -- "red" --> DVIN
R6 -- "black" --> DGND
R12 -- "blue · bit clock" --> DBCLK
R35 -- "green · word select" --> DWSEL
R40 -- "yellow · data" --> DDIN
R2 -- "red · ≥ 0.5 mm²" --> AVDD
R9 -- "black · ≥ 0.5 mm²" --> AGND
CAP --- AVDD
CAP --- AGND
R15 -- "orange · amp enable<br/>high = on" --> ASD
DL -- "shielded / twisted" --> ALP
DR -- "shielded / twisted" --> ARP
DAG -- "analog ground" --> ALM
DAG -- "analog ground" --> ARM
AOLP -- "red" --> SLP
AOLM -- "black" --> SLM
AORP -- "red" --> SRP
AORM -- "black" --> SRM
Colour key: red = power, grey = ground, blue = I2S (digital), green = line-level analog, amber = control, purple = speaker outputs, dashed = leave unconnected. The wire colours on the edges are suggestions that make the build easy to check, not a standard.
Step by step
The same wiring in three parts, in the order you build it.
1. Radxa → DAC (digital audio)
flowchart LR
classDef power fill:#fde2e2,stroke:#c62828,color:#000
classDef ground fill:#e5e7eb,stroke:#374151,color:#000
classDef i2s fill:#dbeafe,stroke:#1d4ed8,color:#000
classDef open fill:#ffffff,stroke:#9ca3af,stroke-dasharray:4 3,color:#6b7280
subgraph RADXA["Radxa ZERO 3W"]
direction TB
P4["pin 4 · 5V"]:::power
P6["pin 6 · GND"]:::ground
P12["pin 12 · I2S3_SCLK_M0"]:::i2s
P35["pin 35 · I2S3_LRCK_M0"]:::i2s
P40["pin 40 · I2S3_SDO_M0"]:::i2s
end
subgraph DAC["UDA1334A"]
direction TB
VIN["VIN"]:::power
V3["3VO · unconnected"]:::open
GND["GND"]:::ground
WSEL["WSEL"]:::i2s
DIN["DIN"]:::i2s
BCLK["BCLK"]:::i2s
end
P4 -- red --> VIN
P6 -- black --> GND
P12 -- blue --> BCLK
P35 -- green --> WSEL
P40 -- yellow --> DIN
2. Power, control and line level into the amplifier
flowchart LR
classDef power fill:#fde2e2,stroke:#c62828,color:#000
classDef ground fill:#e5e7eb,stroke:#374151,color:#000
classDef analog fill:#dcfce7,stroke:#15803d,color:#000
classDef ctrl fill:#fef3c7,stroke:#b45309,color:#000
subgraph RADXA["Radxa ZERO 3W"]
direction TB
P2["pin 2 · 5V"]:::power
P9["pin 9 · GND"]:::ground
P15["pin 15 · GPIO3_B0"]:::ctrl
end
subgraph DAC["UDA1334A"]
direction TB
L["LOUT"]:::analog
AG["AGND"]:::ground
R["ROUT"]:::analog
end
subgraph AMP["MAX98306"]
direction TB
VDD["VDD"]:::power
G["GND"]:::ground
GAIN["gain jumper · 12 dB"]
SD["SD"]:::ctrl
LP["L+"]:::analog
LM["L−"]:::analog
RM["R−"]:::analog
RP["R+"]:::analog
end
C["470–1000 µF"]:::power
P2 -- "red, thick" --> VDD
P9 -- "black, thick" --> G
C --- VDD
C --- G
P15 -- orange --> SD
L --> LP
AG --> LM
AG --> RM
R --> RP
3. Amplifier → speakers
flowchart LR
classDef spk fill:#f3e8ff,stroke:#7e22ce,color:#000
subgraph AMP["MAX98306 outputs (bridge-tied, never to GND)"]
direction TB
OLP["L+"]:::spk
OLM["L−"]:::spk
ORP["R+"]:::spk
ORM["R−"]:::spk
end
subgraph LEFT["Left driver 4 Ω"]
direction TB
LP["+"]:::spk
LM["−"]:::spk
end
subgraph RIGHT["Right driver 4 Ω"]
direction TB
RP["+"]:::spk
RM["−"]:::spk
end
OLP -- red --> LP
OLM -- black --> LM
ORP -- red --> RP
ORM -- black --> RM
Connection tables
Radxa ZERO 3W → UDA1334A DAC
The board's pins, in the order printed on it: VIN, 3VO, GND, WSEL, DIN, BCLK, LOUT, AGND, ROUT.
| Radxa pin | Radxa function | UDA1334A pin | Purpose |
|---|---|---|---|
| 4 | +5 V | VIN | Supply (the board regulates to 3.3 V) |
| 6 | GND | GND | Common ground |
| 12 | GPIO3_A3 · I2S3_SCLK_M0 | BCLK | Bit clock |
| 35 | GPIO3_A4 · I2S3_LRCK_M0 | WSEL | Word select: left/right |
| 40 | GPIO3_A5 · I2S3_SDO_M0 | DIN | Audio data |
| — | — | 3VO | Unconnected. The board's 3.3 V output, not an input |
| — | — | LOUT, AGND, ROUT | Line output to the amplifier, see below |
The board needs no jumpers or pads: its defaults are I2S format, unmuted, no de-emphasis, and the clock derived from WSEL by the DAC's own PLL. Pin 13 (I2S3_MCLK_M0) stays unconnected. Some UDA1334A boards also bring out SCLK, SF0, SF1, MUTE and DEEM; leave those unconnected too.
Install with sudo deploy/device/install.sh --system --dac=uda1334a, then reboot. Its overlay is deploy/device/files/overlays/radxa-zero3-i2s3-uda1334a.dts, and aplay -l then lists a card called UDA1334A.
Speakers or headphones
The UDA1334A's 3.5 mm jack and LOUT/ROUT carry the same signal: plugging in headphones does not silence the amplifier. The software does that: Settings → Audio → Listen on chooses:
- Speakers: the amplifier plays, with the standby rules and the volume limit.
- Headphones or line out: the amplifier is switched off and stays off while music plays, and the separate headphone volume limit (50 % by default) applies. Switching to headphones lowers the volume to that limit at once.
Switching the amplifier off needs its enable line: the MAX98306's SD pin (or the TPA2012's SDL and SDR) on header pin 15, with BOOMBOX_AMP_GPIO=gpiochip3:8 in /etc/boombox/agent.env (see Radxa → MAX98306). Without it, the setting is not offered, because the speakers would keep playing.
The MAX98306 has one SD pin for both channels. Some TPA2012 boards break out SDL only; SDR is tied on. Then the line silences the left channel alone, and on headphones or in standby the right speaker keeps playing. Wire SDR to pin 15 as well if the board has a pad for it; otherwise set BOOMBOX_AMP_CHANNELS=left in agent.env, so the page and the display's menu say so.
Waveshare 2.13" e-Paper HAT (optional)
The HAT (board Rev2.1, 250 × 122) stacks on the header. It uses SPI3 on its M1 pins and three GPIOs, none of the I2S pins (12, 35, 38, 40) nor the amplifier line (15), so it goes together with the DAC. Rev2.1 has no PWR pin. Set it up with install.sh --system --epaper=v3 (the version on the back of the panel; ours is a V3). The V4 driver also draws on a V3 panel, but each of its quick updates is then a slow full refresh: if every update takes about 4 s and flashes, the panel is a V3.
| HAT | Header pin | Radxa ZERO 3W | gpiochip3 line |
|---|---|---|---|
| VCC | 1 or 17 | 3.3 V | – |
| GND | 6, 9 or 20 | GND | – |
| DIN | 19 | SPI3_MOSI_M1 | – |
| CLK | 23 | SPI3_CLK_M1 | – |
| CS | 24 | SPI3_CS0_M1 (driven by the kernel) | – |
| DC | 22 | GPIO3_C1 | 17 |
| RST | 11 | GPIO3_A1 | 1 |
| BUSY | 18 | GPIO3_B2 | 10 |
flowchart LR
classDef power fill:#fde2e2,stroke:#c62828,color:#000
classDef ground fill:#e5e7eb,stroke:#374151,color:#000
classDef spi fill:#e0f2fe,stroke:#0369a1,color:#000
classDef ctrl fill:#fef3c7,stroke:#b45309,color:#000
subgraph RADXA["Radxa ZERO 3W"]
direction TB
P17["pin 17 · 3V3"]:::power
P20["pin 20 · GND"]:::ground
P19["pin 19 · SPI3_MOSI_M1"]:::spi
P23["pin 23 · SPI3_CLK_M1"]:::spi
P24["pin 24 · SPI3_CS0_M1"]:::spi
P22["pin 22 · GPIO3_C1"]:::ctrl
P11["pin 11 · GPIO3_A1"]:::ctrl
P18["pin 18 · GPIO3_B2"]:::ctrl
end
subgraph EPD["Waveshare 2.13-inch e-Paper HAT"]
direction TB
VCC["VCC"]:::power
GND["GND"]:::ground
DIN["DIN"]:::spi
CLK["CLK"]:::spi
CS["CS"]:::spi
DC["DC"]:::ctrl
RST["RST"]:::ctrl
BUSY["BUSY"]:::ctrl
end
P17 -- "3.3 V, never 5 V" --> VCC
P20 --> GND
P19 --> DIN
P23 --> CLK
P24 --> CS
P22 --> DC
P11 --> RST
BUSY -- "panel → Radxa" --> P18
Stacked on the header, the HAT makes these connections by itself. The diagram is for its 8-pin cable: go by the labels on the HAT's connector.
The panel keeps its picture without power; only a refresh costs energy (a full one takes about 2 s).
Rotary encoder and Back button (optional, with the display)
A rotary encoder with a push switch works the display: turn for the volume, press to play or pause, hold to open the menu; in the menu, turn left past the first row to go back. A Back button is optional: it goes back with one press. Set it up with install.sh --system --epaper=v3 --knob=on. None of these pins is used by the I2S DAC (12, 35, 38, 40, and 13 for a master clock), the amplifier line (15) or the display (11, 18, 19, 21, 22, 23, 24). Avoid pins 3, 5, 27 and 28: their I2C pull-ups make them unreliable as inputs.
KY-040 module (CLK, DT, SW, +, GND):
| Encoder | Header pin | Radxa ZERO 3W | gpiochip3 line |
|---|---|---|---|
| + | 1 or 17 | 3.3 V, never 5 V: the module's pull-ups go to "+", and 5 V on a GPIO destroys it | – |
| GND | 9, 25 or 39 | GND | – |
| CLK (A) | 29 | GPIO3_B3 | 11 |
| DT (B) | 31 | GPIO3_B4 | 12 |
| SW | 36 | GPIO3_A7 | 7 |
| Back button (optional) | 32 | GPIO3_C2 | 18 |
| Back button, other side | GND | GND | – |
flowchart LR
classDef power fill:#fde2e2,stroke:#c62828,color:#000
classDef ground fill:#e5e7eb,stroke:#374151,color:#000
classDef ctrl fill:#fef3c7,stroke:#b45309,color:#000
subgraph RADXA["Radxa ZERO 3W"]
direction TB
P1["pin 1 · 3V3"]:::power
P25["pin 25 · GND"]:::ground
P29["pin 29 · GPIO3_B3"]:::ctrl
P31["pin 31 · GPIO3_B4"]:::ctrl
P36["pin 36 · GPIO3_A7"]:::ctrl
P32["pin 32 · GPIO3_C2"]:::ctrl
P39["pin 39 · GND"]:::ground
end
subgraph ENC["KY-040 rotary encoder"]
direction TB
EP["+"]:::power
EG["GND"]:::ground
ECLK["CLK"]:::ctrl
EDT["DT"]:::ctrl
ESW["SW"]:::ctrl
end
BACK["Back button<br/>(optional)"]:::ctrl
P1 -- "3.3 V, never 5 V" --> EP
P25 --> EG
ECLK --> P29
EDT --> P31
ESW --> P36
BACK --> P32
BACK --> P39
The KY-040 has pull-ups on CLK and DT but none on SW. The speaker's kernel ignores the pull-ups a program asks for, so --knob=on adds an overlay (radxa-zero3-knob) that sets the Radxa's own pull-ups on all four pins at boot: no resistor needed, but a reboot after the first --knob=on. Without it SW reads low whether pressed or not. A bare encoder (EC11: A, B, a common pin and the switch's two pins) works the same: A to 29, B to 31, common and one switch pin to GND, the other switch pin to 36; no "+". With long wires, 10 nF from A and B to GND calm the contacts.
Clicks: most encoders take a full quadrature cycle per click. If every second click does nothing, the encoder clicks twice per cycle: run install.sh --knob-steps=2. If turning clockwise lowers the volume, swap CLK and DT.
The e-Paper HAT has no pass-through header: solder the encoder's wires to the header pins underneath, or connect the display through its 8-pin cable instead of stacking it. Check the lines with gpioinfo gpiochip3 before the first run. The speaker's kernel has no rotary-encoder driver: the display's program reads the lines itself through libgpiod's edge events (deploy/device/files/epaper/nowplaying/controls.py).
Radxa ZERO 3W → MAX98306 (power and control)
The MAX98306 (Adafruit #987, "Stereo 3.7W Class D Audio Amplifier") is an analog amplifier: it takes line level from the DAC, not I2S from the Radxa, and needs nothing in software. (The similarly named MAX98357A is a different chip, a mono amplifier with its own DAC: don't mix them up when ordering.)
| Radxa pin | Function | MAX98306 pin | Purpose |
|---|---|---|---|
| 2 | +5 V | VDD | Amplifier supply: use thicker wire (≥ 0.5 mm²), it carries up to ~1.5 A at full volume |
| 9 | GND | GND | Amplifier ground, also thick |
| 15 | GPIO3_B0 (gpiochip3 line 8) | SD | Amplifier enable: high = on, low = shut down (idle standby). One pin for both channels |
| — | — | gain jumper | 12 dB (see Gain and signal level) |
Solder the 470–1000 µF capacitor directly across VDD and GND on the amplifier board, observing polarity (the stripe marks −).
The SD line is optional. Left unconnected, the board keeps the amplifier on, but then standby and Listen on: headphones cannot switch it off. Wired to pin 15, the speaker switches the amplifier off after the idle time set in the web interface. That saves power and removes the faint hiss of an idle class-D amplifier. Enable it with BOOMBOX_AMP_GPIO=gpiochip3:8 in /etc/boombox/agent.env.
It also takes away the DAC's pops. The UDA1334A pops whenever its clock starts or stops, at every prompt, phone stream and Spotify pause, and without the SD line each pop is heard. With it, the agent keeps the DAC running with silence while the amplifier is on, and switches the amplifier only while the DAC runs. That costs about 3% of one core, and only until the amplifier goes to standby.
UDA1334A → MAX98306 (analog audio)
| UDA1334A | MAX98306 | Note |
|---|---|---|
| LOUT | L+ | Left signal |
| ROUT | R+ | Right signal |
| AGND | L− and R− | The DAC is single-ended: tie both negative inputs to its analog ground |
Keep these wires short and away from the speaker wires and the I2S lines. A twisted pair (signal with ground) or a thin shielded cable avoids hum.
MAX98306 → speakers
| MAX98306 | Driver | Note |
|---|---|---|
| L+ out | Left driver + (red dot / larger tab) | |
| L− out | Left driver − | |
| R+ out | Right driver + | |
| R− out | Right driver − |
The outputs are bridge-tied: neither speaker terminal is ground. Never connect an output to GND, to the other channel, or to another amplifier's input. Doing that destroys the amplifier the moment it plays. If one driver is wired with reversed polarity, the bass partly cancels. Check the markings.
TPA2012 instead of the MAX98306
The TPA2012 stereo class-D amplifier (Adafruit #1552) works in the MAX98306's place. It is also an analog amplifier with differential inputs and bridge-tied outputs, so the DAC side and the speaker side are wired exactly as above (L+, L−, R+, R− in; L+, L−, R+, R− out). Nothing changes in software. It differs in three things: two shutdown pins instead of one, gain set by two pins instead of a jumper, and less power (2.1 W per channel into 4 Ω at 5 V, 1.4 W into 8 Ω).
flowchart LR
classDef power fill:#fde2e2,stroke:#c62828,color:#000
classDef ground fill:#e5e7eb,stroke:#374151,color:#000
classDef analog fill:#dcfce7,stroke:#15803d,color:#000
classDef ctrl fill:#fef3c7,stroke:#b45309,color:#000
classDef spk fill:#f3e8ff,stroke:#7e22ce,color:#000
classDef open fill:#ffffff,stroke:#9ca3af,stroke-dasharray:4 3,color:#6b7280
subgraph RADXA["Radxa ZERO 3W — 40-pin header"]
direction TB
P2["pin 2 · 5V"]:::power
P9["pin 9 · GND"]:::ground
P15["pin 15 · GPIO3_B0<br/>(gpiochip3 line 8)"]:::ctrl
end
subgraph DAC["UDA1334A<br/>(I2S as above)"]
direction TB
L["LOUT"]:::analog
AG["AGND"]:::ground
R["ROUT"]:::analog
end
subgraph AMP["TPA2012 amplifier (Adafruit #1552)"]
direction TB
VDD["VDD"]:::power
G["GND"]:::ground
G0["G0 · open (pulled up)"]:::open
G1["G1 · to GND"]:::ground
SDL["SDL"]:::ctrl
SDR["SDR"]:::ctrl
LP["L+ in"]:::analog
LM["L− in"]:::analog
RM["R− in"]:::analog
RP["R+ in"]:::analog
AOL["L+ / L− out"]:::spk
AOR["R+ / R− out"]:::spk
end
C["470–1000 µF"]:::power
SPL["Left driver 4 Ω"]:::spk
SPR["Right driver 4 Ω"]:::spk
P2 -- "red, thick" --> VDD
P9 -- "black, thick" --> G
C --- VDD
C --- G
P15 -- orange --> SDL
P15 -- orange --> SDR
L --> LP
AG --> LM
AG --> RM
R --> RP
AOL -- "bridge-tied, never to GND" --> SPL
AOR -- "bridge-tied, never to GND" --> SPR
Radxa ZERO 3W → TPA2012 (power and control)
| Radxa pin | Function | TPA2012 pin | Purpose |
|---|---|---|---|
| 2 | +5 V | VDD | Amplifier supply: use thicker wire (≥ 0.5 mm²), it carries up to ~1 A |
| 9 | GND | GND | Amplifier ground, also thick |
| 15 | GPIO3_B0 (gpiochip3 line 8) | SDL and SDR | Amplifier enable: high = on, low = shut down (idle standby). Same polarity as the MAX98306's SD, so BOOMBOX_AMP_GPIO=gpiochip3:8 works unchanged |
| — | — | G1 → GND, G0 open | Gain 12 dB |
Solder the 470–1000 µF capacitor across VDD and GND here too.
The SDL/SDR line is optional. Left unconnected, the board's pull-ups keep the amplifier on. Some boards break out SDL only: see Speakers or headphones.
The analog inputs and the speaker outputs are the same as on the MAX98306: see UDA1334A → MAX98306 and MAX98306 → speakers. The TPA2012's outputs are bridge-tied too: never connect one to GND or to the other channel.
TPA2012 gain
The TPA2012D2 sets its gain with two pins (TI datasheet):
| G1 | G0 | Gain | With the UDA1334A |
|---|---|---|---|
| 0 (GND) | 0 (GND) | 6 dB (2 V/V) | never clips, about 0.8 W per channel |
| 0 (GND) | 1 (open) | 12 dB (4 V/V) ← use this | full power, clips above about 80 %: volume limit 80 % |
| 1 | 0 | 18 dB (8 V/V) | clips early: don't |
| 1 (open, pulled up) | 1 (open, pulled up) | 24 dB (16 V/V): the Adafruit default | clips hard: don't |
Why: 2.1 W into 4 Ω needs √(2.1 W · 4 Ω) ≈ 2.9 V rms, and the TPA2012 cannot exceed its 5 V supply. The UDA1334A's 0.9 V rms at 12 dB asks for 3.6 V rms, so the amplifier reaches full power at about 80 % of the DAC's output and clips above that. Set the volume limit to 80 % (the steps are in Gain and signal level).
Physical pin map
block-beta
columns 2
p1["1 · 3V3"] p2["2 · 5V → amp VDD"]
p3["3"] p4["4 · 5V → DAC VIN"]
p5["5"] p6["6 · GND → DAC GND"]
p7["7"] p8["8"]
p9["9 · GND → amp GND"] p10["10"]
p11["11"] p12["12 · I2S BCLK → DAC BCLK"]
p13["13"] p14["14 · GND"]
p15["15 · GPIO → amp SD"] p16["16"]
p17["17"] p18["18"]
p19["19"] p20["20 · GND"]
p21["…"] p22["…"]
p33["33"] p34["34 · GND"]
p35["35 · I2S LRCK → DAC WSEL"] p36["36"]
p37["37"] p38["38"]
p39["39 · GND"] p40["40 · I2S DATA → DAC DIN"]
Pin 1 has a square pad and is marked on the silkscreen; odd pins are in one row, even pins in the other. Find pin 1 on your board and check every wire against the Radxa pinout before you plug anything in. Pins 2 and 4 carry 5 V: a jumper on the wrong pin can feed 5 V into a 3.3 V GPIO and destroy it.
Gain and signal level
The UDA1334A outputs about 0.9 V rms at full scale. At 5 V the MAX98306 delivers about 3 W into 4 Ω, which needs √(3 W · 4 Ω) ≈ 3.5 V rms. The gain jumper (6, 9, 12, 15 or 18 dB; see Adafruit's guide for the pads) decides how close the DAC gets to that:
| MAX98306 gain | At full scale | Result |
|---|---|---|
| 6 dB | 1.8 V rms | never clips, about 0.8 W per channel |
| 9 dB (as shipped) | 2.5 V rms | never clips, about 1.6 W per channel |
| 12 dB ← use this | 3.6 V rms | full power, clips above about 90 %: volume limit 90 % |
| 15 or 18 dB | 5 V rms or more | clips early: don't |
A clipping class-D amplifier sounds harsh and stresses the drivers. Power alone does not: the drivers are rated 5 W at 4 Ω, more than either amplifier delivers at 5 V. (The TPA2012 has its own gain pins and figures: see TPA2012 gain.)
Handle it in software, which is exactly what the speaker's volume limit is for:
- Open Settings → Audio → Volume limit and set it to the value in the table (90 % with the MAX98306 at 12 dB, 80 % with the TPA2012 at 12 dB; at 6 or 9 dB it can stay at 100 %).
- Play a bass-heavy track at full volume from the phone. If you hear distortion, lower the limit in steps of 5 %.
Phones cannot raise the volume above that limit.
Power budget
| Consumer | Typical | Peak |
|---|---|---|
| Radxa ZERO 3W (Wi-Fi + Bluetooth streaming) | 0.4 A | 1.0 A |
| UDA1334A | 0.02 A | 0.03 A |
| MAX98306, both channels at full volume (about 3 W / 4 Ω each) | 0.1 A | ≈ 1.5 A |
| Total at 5 V | ≈ 0.5 A | ≈ 2.5 A |
With the TPA2012 (both channels at 2.1 W into 4 Ω, about 88 % efficient) the amplifier peaks at about 1.0 A, and the total at about 2.0 A.
A 5 V / 3 A USB-C supply leaves margin. Weaker supplies cause the classic symptom: the board resets, or Bluetooth drops, on loud bass notes. The bulk capacitor at the amplifier helps with short peaks, not with an undersized supply.
All three boards share one ground: Radxa GND, DAC GND and amplifier GND are connected. Don't add separate ground paths, such as a second supply for the amplifier, unless you join its ground to the Radxa's at one point.
Checklist before power-on
- [ ] Amplifier gain: the MAX98306's gain jumper on 12 dB (or 9 dB as shipped); on a TPA2012, G1 bridged to GND and G0 open (12 dB).
- [ ] I2S wires: pin 12 → BCLK, pin 35 → WSEL, pin 40 → DIN.
- [ ] DAC VIN on pin 4 (5 V), DAC GND on pin 6, 3VO unconnected.
- [ ] Amplifier VDD on pin 2, GND on pin 9, with thick wires and the capacitor polarity right.
- [ ] LOUT → L+, ROUT → R+; the amplifier's L− and R− go to the DAC's AGND.
- [ ] No speaker terminal touches ground or another channel.
- [ ] Nothing shorts across the header: inspect with a light, and measure 5 V to GND with a multimeter (it must not read near 0 Ω).
Continue with Assembly and first power-on.