Feature/audio – Fix CM5 I2S audio and microphone configuration#149
Feature/audio – Fix CM5 I2S audio and microphone configuration#149danic85 wants to merge 8 commits into
Conversation
|
This branch is an attempt to fix the audio configuration on a Raspberry Pi Compute Module 5 running the Raspberry Pi OS. The CM5 is connected to a custom carrier board with 2x ICS-43434 I2S microphones and a MAX98357B amplifier module with speaker connected. The files Review the changes in the branch including the reference installers below (used as a basis for configuring these modules) and suggest reasons why the configuration is not working. The expectation is that the raspberry pi would support audio output and microphone input, but currently neither are working despite working (intermittently) in the past. It is not a hardware issue. Reference installers: https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/main/i2samp.py Additional wiki, not used but may be helpful: Component datasheets: |
… capture path, CM5 mic support Agent-Logs-Url: https://github.com/makerforgetech/modular-biped/sessions/a540dd2d-28c8-45f0-9ce3-5926757b6100 Co-authored-by: danic85 <6583012+danic85@users.noreply.github.com>
After reviewing all the configuration files against the reference installers and Issue 1 — Merge conflict markers committed (Critical)Both Issue 2 —
|
What type of change is this?
📝 What does this change do?
Fixes audio output (MAX98357B amplifier) and microphone input (ICS-43434 I2S microphones) on a Raspberry Pi Compute Module 5 running Raspberry Pi OS. Resolves four root-cause issues that prevented both playback and capture from working.
❓ Why is this change needed?
Audio output and microphone input on the CM5 carrier board stopped working entirely. Despite the hardware being detected by the kernel, neither
aplaynorarecordproduced any sound or recording. The configuration files contained several bugs that collectively caused this failure.🛠️ How was this implemented?
Four issues were identified and fixed:
Resolved merge conflict markers in
installers/i2samp.pyandinstall_audio.sh— both files had committed<<<<<<< / ======= / >>>>>>>markers causing a PythonSyntaxErrorand a broken shell script at runtime.Fixed ALSA card targeting in
asound.conf— allcard 0references replaced with the stable ALSA card namecard sndrpigooglevoi. On CM5/Pi 5 the twovc4hdmidevices enumerate as cards 0 and 1, pushing the I2S card to card 1 or 2 (variable between boots), so the hardcodedcard 0was silently targeting HDMI output instead of the I2S amplifier. The same fix was applied to theasound.confwritten byinstallers/i2samp.py.Added microphone capture path to
asound.conf—pcm.!defaultpreviously usedtype plug → softvol, which is playback-only (dmixcannot handle capture). Changed totype asymwith separateplayback.pcm "softvol"andcapture.pcm "hw:sndrpigooglevoi"so thatarecord -D defaultand speech-recognition libraries have a valid capture route.Fixed
i2smic.pyto support CM5 / Pi 5 — the Pi model detection table only listed models up to Pi 4/CM4; running on CM5 caused an immediate bail-out with "Unsupported Pi board detected.", meaning thesnd-i2smic-rpikernel module was never installed. Pi 5 and CM5 model strings are now included in the Pi 4-generation group (pimodel_select = 2).installers/Audio.mdupdated with a Root Cause Analysis section and corrected reference configuration.🧪 How was this tested?
Changes are configuration-file and installer-script fixes targeted at CM5 hardware. Manual testing on the CM5 carrier board is required to fully verify playback and capture. The Python scripts (
i2samp.py,i2smic.py) passast.parsevalidation and have no syntax errors.💥 Breaking changes
🗂 Related issues
✅ PR Checklist
🚀 Thank you for your contribution to the project!
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.