designware_i2s BCM2712: trigger(STOP) permanently breaks DMA restart — WRITEI_FRAMES returns 0 until module reload (RPi5)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- c, linux
- Domain
- audio-video-rtc, embedded-iot, operating-systems
Research direction
Start by tracing the designware_i2s trigger(STOP) and trigger(START) paths in the snd_soc_dwc_i2s module. Reproduce on a Raspberry Pi 5 with the provided two sequential aplay commands and inspect DMA state between runs. Done means repeated PCM open, playback, close, and reopen cycles produce audio without a module reload.
Written by the indexing model from the issue text.
Description
Describe the bug
Platform
- SBC: Raspberry Pi 5 (BCM2712, arm64)
- Kernel: 6.12.75+rpt-rpi-2712 (
uname -r:6.12.75+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.12.75-1+rpt1 (2025-03-31) aarch64) - HAT: Fusion HAT+ — Google Voice HAT I2S codec (
sndrpigooglevoi, ALSA card 2) - Amp: MAX98357A (I2S Class D, built into HAT)
- Amp enable: sysfs GPIO —
/sys/class/fusion_hat/fusion_hat/speaker
Bug Description
On Raspberry Pi 5 (BCM2712), the designware_i2s driver has a broken trigger(START) path after any trigger(STOP). Once any ALSA PCM client exits (ALSA always calls trigger(STOP) on close), the DMA engine permanently stops restarting. Every subsequent SNDRV_PCM_IOCTL_WRITEI_FRAMES ioctl returns 0 frames written in blocking mode — the kernel accepts the call with no error, but no frames are clocked out on the I2S bus. The only recovery is a full module reload.
Steps to reproduce the behaviour
Steps to Reproduce
# Play first file — works fine
aplay -D hw:sndrpigooglevoi,0 -f S32_LE -r 48000 -c 2 /tmp/test.wav
# aplay exits → kernel calls trigger(STOP)
sleep 10
# Play second file — silent, rc=0
aplay -D hw:sndrpigooglevoi,0 -f S32_LE -r 48000 -c 2 /tmp/test.wav
Symptoms
aplayexits withrc=0SNDRV_PCM_IOCTL_WRITEI_FRAMESreturns 0 (blocking mode) on every write — kernel acknowledges writes but DMA produces no outputSNDRV_PCM_IOCTL_DRAINandDROPsucceed/proc/asound/card2/pcm0p/sub0/status:hw_ptrandappl_ptrdo not advance- No ALSA errors, no kernel errors in dmesg
- Physical speaker pop on GPIO toggle confirms amp is alive
- Issue is not PipeWire suspend (
session.suspend-timeout-seconds = 0confirmed, also reproduces with PipeWire masked)
strace (failing playback)
# Every write during the silent (broken) playback:
ioctl(4, SNDRV_PCM_IOCTL_WRITEI_FRAMES, {frames=1024, ...}) = 0 # 0 frames written each time
ioctl(4, SNDRV_PCM_IOCTL_WRITEI_FRAMES, {frames=1024, ...}) = 0
# ... repeated for full file duration
ioctl(4, SNDRV_PCM_IOCTL_DRAIN, 0) = 0
ioctl(4, SNDRV_PCM_IOCTL_DROP, 0) = 0
Root Cause Analysis
The designware_i2s DMA path on BCM2712 fails to re-initialize after trigger(STOP). The specific sequence:
- First
aplayopens device →trigger(START)→ DMA starts, audio works aplayexits → ALSA callstrigger(STOP)→ DMA halts- Next
aplayopens device →trigger(START)is called but DMA never restarts - WRITEI_FRAMES ioctls return 0 indefinitely (kernel-side ring buffer pointers do not advance)
This is not a clock-gating or amp wakeup issue — we exhausted those hypotheses (sox silence padding, GPIO timing, PipeWire disable, dmix keepalive). The DMA engine itself does not restart after trigger(STOP).
Workaround
Use a single persistent aplay process for the lifetime of the system — never let it call trigger(STOP). Feed silence between audio bursts via a pipe:
# One aplay, never exits
proc = subprocess.Popen(
["aplay", "-D", "hw:sndrpigooglevoi,0", "-f", "S32_LE", "-r", "48000", "-c", "2", "-"],
stdin=subprocess.PIPE
)
# Silence writer thread keeps DMA fed between utterances
# Speech PCM is injected into proc.stdin on demand
Additionally, a boot-time oneshot service reloads the module to ensure a clean DMA state:
# /etc/systemd/system/i2s-module-reset.service
[Service]
Type=oneshot
ExecStart=/bin/bash -c "modprobe -r snd_soc_dwc_i2s; modprobe snd_soc_dwc_i2s"
Device (s)
Raspberry Pi 5
System
Platform
- SBC: Raspberry Pi 5 (BCM2712, arm64)
- Kernel: 6.12.75+rpt-rpi-2712 (
uname -r:6.12.75+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.12.75-1+rpt1 (2025-03-31) aarch64) - HAT: Fusion HAT+ — Google Voice HAT I2S codec (
sndrpigooglevoi, ALSA card 2) - Amp: MAX98357A (I2S Class D, built into HAT)
- Amp enable: sysfs GPIO —
/sys/class/fusion_hat/fusion_hat/speaker
Logs
No response
Additional context
Impact
Any application on RPi5 with a sndrpigooglevoi (Google Voice HAT) or other designware_i2s-backed I2S device that opens and closes the PCM device more than once will hit this silently. The symptoms (rc=0, no errors, data written but no audio) make this very hard to diagnose. Other RPi5 users with I2S HATs are likely affected.
Kernel Version
Linux picar 6.12.75+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.12.75-1+rpt1 (2025-03-31) aarch64 GNU/Linux
- Dominant language
- C
- Stars
- 13.2k
- Forks
- 5.5k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 21
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/linux
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7415 · 2 comments · 1 reaction ·
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace app Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/linux#7399 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
raspberrypi/linux#7357 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7054 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
raspberrypi/linux#7634 · 8 comments · 1 reaction ·
All issues in raspberrypi/linux
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·