Lobster Audio Beacon Node

Overview (Key Operational Facts)

This system is a headless Raspberry Pi 4 audio node used to broadcast mixed audio through a low-power FM transmitter.

Core behavior:

  • Spotify audio source using librespot
  • DTMF beacon transmission every 420 seconds
  • Text-to-speech announcement after the DTMF
  • ALSA dmix software mixer allows multiple audio sources simultaneously
  • USB audio interface (C-Media 0d8c:000c) drives the transmitter
  • 48 kHz audio pipeline
  • Spotify bitrate set to 96 kbps

Operational tuning:

  • Spotify client volume ~88%
  • ALSA PCM mixer ~29%
  • WAV files pre-rendered at correct amplitude

Audio flow:

Spotify → librespot
DTMF WAV → aplay
TTS WAV → aplay
            ↓
        ALSA dmix
            ↓
 C-Media USB audio interface
            ↓
   Low power FM transmitter

Beacon timing:

  • DTMF duration: ~12.6 s
  • TTS duration: ~6.8 s
  • Total playback window: ~19–20 s
  • Cycle interval: 420 seconds

Primary System Components

Hardware

Host system

  • Raspberry Pi 4 Model B Rev 1.1
  • 4 CPU cores
  • 3.8 GiB RAM
  • Debian 13 (trixie)
  • Kernel 6.12.62+rpt-rpi-v8
  • Headless operation

Audio interface

Vendor: C-Media
USB ID: 0d8c:000c
Product: C-Media USB Headphone Set
ALSA card: Set
Device: hw:Set,0

Supported formats:

  • 16-bit PCM
  • Stereo
  • 44100 Hz
  • 48000 Hz

System pipeline standard:

48000 Hz
Stereo
16 bit

Connected USB devices

  • C-Media USB audio adapter
  • Zebra GK420d label printer
  • CP210x USB serial adapter
  • ASMedia USB SATA bridge

Audio Pipeline

Librespot (Spotify Connect)

Service:

/etc/systemd/system/librespot.service

Startup command:

/root/librespot/target/release/librespot \
  --name Lobster_FM \
  --backend rodio \
  --bitrate 96 \
  --device default

Important parameters:

Device name:

Lobster_FM

Bitrate:

96 kbps

Backend:

rodio (ALSA through CPAL)

Output device:

default

Using default is required so ALSA mixing works.


Beacon Playback

DTMF beacon file:

/root/.openclaw/workspace/will_you_marry_me_becky_dtmf_48k_conv.wav

Properties:

  • 48000 Hz
  • stereo
  • 16-bit PCM
  • 12.6 seconds

TTS announcement file:

/root/.openclaw/workspace/tts_48k.wav

Properties:

  • 48000 Hz
  • stereo
  • 16-bit PCM
  • 6.82 seconds

Playback Script

Location:

/usr/local/bin/dtmf_loop.sh

Simplified behavior:

loop forever
    play DTMF wav
    play TTS wav
    sleep so total cycle = 420 seconds

Example implementation:

#!/bin/bash

DTMF="/root/.openclaw/workspace/will_you_marry_me_becky_dtmf_48k_conv.wav"
TTS="/root/.openclaw/workspace/tts_48k.wav"
INTERVAL=420

while true
do
    START=$(date +%s)

    aplay "$DTMF"
    aplay "$TTS"

    END=$(date +%s)
    ELAPSED=$((END - START))
    SLEEP_FOR=$((INTERVAL - ELAPSED))

    if [ "$SLEEP_FOR" -gt 0 ]; then
        sleep "$SLEEP_FOR"
    fi
done

System Services

librespot

systemctl status librespot

Service behavior:

  • Spotify Connect endpoint
  • restarts automatically
  • runs continuously

dtmf-loop

/etc/systemd/system/dtmf-loop.service

Definition:

[Unit]
Description=DTMF Loop Playback Service
After=network.target

[Service]
ExecStart=/usr/local/bin/dtmf_loop.sh
Restart=always
User=root

[Install]
WantedBy=multi-user.target

ALSA Mixing Configuration

File:

/etc/asound.conf

Configuration:

pcm.!default {
    type plug
    slave.pcm "mixed"
}

ctl.!default {
    type hw
    card Set
}

pcm.mixed {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:Set,0"
        rate 48000
        channels 2
        period_size 1024
        buffer_size 4096
    }
}

This forces all playback to:

default → plug → dmix → hw:Set,0

So multiple programs can play audio simultaneously.

Correct playback command:

aplay file.wav

Incorrect command that bypasses mixing:

aplay -D hw:Set,0 file.wav

Volume Configuration

aplay does not change volume.

Volume comes from:

  1. WAV file amplitude
  2. ALSA PCM mixer
  3. Spotify client volume

Current ALSA mixer level:

PCM = 44 (29%)

Operational tuning:

Control Value
Spotify client ~88%
ALSA PCM mixer ~29%

Observations:

  • 50% Spotify volume too quiet
  • 100% can drown out TTS
  • DTMF still decodes correctly even when Spotify is louder

System Status

Temperature observed:

28.7°C

CPU cores:

4

Memory:

3.8 GiB

Filesystem:

917G root
17G used

Network:

WiFi only
192.168.10.103

Power Status

Reported by:

vcgencmd get_throttled

Result:

0x50005

Meaning:

  • undervoltage detected
  • throttling occurred

Possible effects:

  • USB instability
  • audio glitches
  • unpredictable behavior under load

Power supply quality should be verified for long-term reliability.


Monitoring Commands

Temperature:

vcgencmd measure_temp

Power status:

vcgencmd get_throttled

Audio devices:

aplay -l
aplay -L
cat /proc/asound/cards

Mixer levels:

amixer

Service logs:

journalctl -u librespot -f
journalctl -u dtmf-loop -f

Reference Information

These details are useful for diagnostics but not essential to normal operation.

System info:

uname -a
cat /etc/os-release

Network sockets:

ss -tlpn

CPU load monitoring:

top
pidstat -u -p $(pidof librespot) 1

Thermal sensor raw value:

cat /sys/class/thermal/thermal_zone0/temp

USB devices:

lsusb

Operational Summary

The Lobster node is a stable headless Raspberry Pi system that:

  • streams Spotify audio through librespot
  • injects a DTMF beacon every 420 seconds
  • plays a TTS announcement
  • mixes all sources through ALSA dmix
  • outputs through a USB audio interface
  • feeds a low power FM transmitter

Correct audio balance is achieved with:

Spotify volume ≈ 88%
ALSA PCM ≈ 29%

The only hardware concern identified during audit is historical undervoltage events, which should be addressed for maximum reliability.

More from dickie
All posts