🛠 Audio sur le Dock : enregistrer au micro numérique et jouer sur le haut-parleur 3 W

Sipeed Lichee RV Dock (Allwinner D1 / T-Head XuanTie C906) · debutant · Schéma : IMG-sipeed-lichee-rv-dock-debutant-1-licheerv-audio-dmic.svg — Lichee RV Dock en chaîne audio : micro numérique DMIC 2 canaux (PDM, broches PB11 données / PE17 horloge) vers le SoC D1, et amplificateur 3 W vers le connecteur haut-parleur 4 Ω

Objectives

The Dock includes everything needed for audio: a 3 W speaker amplifier (for 4 Ω speakers) with a connector, an analog electret microphone, and most importantly, a 2-channel digital microphone interface (DMIC, PDM, with data on pin PB11 and clock on pin PE17) declared in the mainline device tree under the simple-audio-card sound card named "DMIC". This tutorial covers discovering ALSA on the board, recording 5 seconds from the digital microphones, playing them back on the speaker, and adjusting levels with alsamixer. This is the entry point for voice projects (the 30-pin FPC connector for the R6 6-microphone array is the next step).

Hardware

Complete Code

# 1) Inventaire des cartes et périphériques ALSA
cat /proc/asound/cards        # attendre la carte « DMIC » (simple-audio-card)
arecord -l ; aplay -l

# 2) Enregistrement 2 canaux / 16 kHz / 16 bits pendant 5 s depuis le DMIC
arecord -D hw:0,0 -c 2 -r 16000 -f S16_LE -d 5 dmic.wav
#   (si « Device or resource busy » : changer de numéro de carte vu à l'étape 1)

# 3) Lecture sur le haut-parleur (ampli 3 W du Dock)
aplay -D default dmic.wav

# 4) Niveaux : mixer en mode texte
alsamixer            # F6 : choisir la carte ; monter capture « DMIC » et lecture « HP »
amixer scontrols     # liste les contrôles nommés
amixer -c 0 sget 'Headphone',0   # lire un niveau

# 5) Enchaînement micro -> fichier -> haut-parleur en direct (latence élevée)
arecord -D hw:0,0 -c 2 -r 16000 -f S16_LE -t raw | aplay -D default -c 2 -r 16000 -f S16_LE -

Expected Verification

/proc/asound/cards displays the DMIC card (the dmic-sound node in the Dock's device tree). After speaking loudly for 5 seconds, dmic.wav should be approximately 320 KB (2 channels × 16 kHz × 16 bits × 5 s), and aplay should play it back clearly through the 3 W speaker. On the waveform (record while monitoring arecord -V stereo), both DMIC channels should show activity. If the sound is inaudible, it is almost always because the HP level is set to minimum in alsamixer.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials