Context
We can now run the full station stack on a single PC:
- QEMU x64 — Yocto image with Station Agent (A/B rootfs, GRUB, read-only)
- native_sim — Zephyr firmware running as Linux process (SA818 driver, GPIO/ADC emulators, UART PTY)
Serial communication (Shell, AT commands) works via UART PTY → QEMU USB-Serial. Audio is the missing link.
Goal
Station Agent in QEMU captures/plays audio from a virtual USB soundcard, and the audio data flows to/from native_sim's audio pipeline — just like on real hardware where the STM32 presents as a USB Audio Class device.
Architecture
native_sim (Zephyr) Host Kernel QEMU Guest (Yocto)
┌──────────────┐ ┌─────────────┐ ┌──────────────────┐
│ RX Audio ────┼─► play ──►│ snd-aloop │►─ cap ─┼► Station Agent │
│ (DAC write) │ hw:L,0,0 │ (loopback) │ hw:L,1 │ (ALSA capture) │
│ │ │ │ │ │
│ TX Audio ◄───┼─◄ cap ───◄│ │◄─play ─┼◄ Station Agent │
│ (ADC read) │ hw:L,1,1 │ │ hw:L,0 │ (ALSA playback) │
└──────────────┘ └─────────────┘ └──────────────────┘
Implementation steps
Zephyr side (this repo)
QEMU/run.sh side (linux-image repo)
Station Agent side (station-manager repo)
Host prerequisites
sudo modprobe snd-aloop
# Verify: aplay -l should show "Loopback" card
Acceptance criteria
Not in scope
- USB Audio Class emulation in native_sim (real STM32 USB stack not needed for simulation)
- DFU over USB (separate ticket if needed)
- Real-time latency guarantees (best-effort is fine for testing)
References
Context
We can now run the full station stack on a single PC:
Serial communication (Shell, AT commands) works via UART PTY → QEMU USB-Serial. Audio is the missing link.
Goal
Station Agent in QEMU captures/plays audio from a virtual USB soundcard, and the audio data flows to/from native_sim's audio pipeline — just like on real hardware where the STM32 presents as a USB Audio Class device.
Architecture
Implementation steps
Zephyr side (this repo)
dac_alsa— similar to existingdac_wavbut writes PCM to an ALSA device instead of a WAV file. Config:CONFIG_DAC_ALSA=y, device tree propertyoutput-device = "hw:Loopback,0,0".hw:Loopback,1,1to feed TX audio into the radio pipeline. Lower priority since TX testing is less common.native_sim_native_64.confentries forCONFIG_DAC_ALSA=yand update the DT overlay to usealsa-dacinstead ofwav-dac.QEMU/run.sh side (linux-image repo)
run.sh:sudo modprobe snd-aloopas prerequisite.Station Agent side (station-manager repo)
Host prerequisites
sudo modprobe snd-aloop # Verify: aplay -l should show "Loopback" cardAcceptance criteria
native_simRX audio (e.g., sine tone) appears as capture data on QEMU guest's ALSA devicenative_simADC inputNot in scope
References
drivers/dac/in this reposnd-aloopkernel module