New files for running the FM receiver in Docker with audio output: - Dockerfile.gnuradio-audio: GNU Radio image with ALSA→PulseAudio bridge - libasound2-plugins for ALSA PulseAudio plugin - /etc/asound.conf configures ALSA to route to PulseAudio - docker-compose.fm-receiver.yml: Full FM receiver setup - PulseAudio socket mount for audio - USB passthrough for RTL-SDR (requires privileged mode) - XML-RPC port 8090 exposed for tuning control - Environment vars: FREQ_MHZ, GAIN - entrypoint-fm.sh: Builds and runs flowgraph at specified frequency - run-fm-receiver.sh: Helper script with usage instructions Usage: HOST_UID=$(id -u) FREQ_MHZ=107.2 docker compose -f docker/docker-compose.fm-receiver.yml up
36 lines
1.0 KiB
Docker
36 lines
1.0 KiB
Docker
FROM librespace/gnuradio:latest
|
|
|
|
# PulseAudio client + ALSA-PulseAudio plugin for audio output
|
|
# GNU Radio uses ALSA backend, so we bridge ALSA → PulseAudio
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
pulseaudio-utils \
|
|
libpulse0 \
|
|
libasound2-plugins \
|
|
alsa-utils \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Configure ALSA to use PulseAudio as default output
|
|
# This makes any ALSA app (including GNU Radio) output to PulseAudio
|
|
RUN echo 'pcm.!default { type pulse }' > /etc/asound.conf && \
|
|
echo 'ctl.!default { type pulse }' >> /etc/asound.conf
|
|
|
|
# Create non-root user for PulseAudio (matches typical host UID)
|
|
ARG USER_ID=1000
|
|
ARG GROUP_ID=1000
|
|
RUN groupadd -g ${GROUP_ID} gnuradio || true \
|
|
&& useradd -m -u ${USER_ID} -g ${GROUP_ID} gnuradio || true
|
|
|
|
WORKDIR /flowgraphs
|
|
|
|
# PulseAudio socket location
|
|
ENV PULSE_SERVER=unix:/run/pulse/native
|
|
|
|
# XML-RPC port for runtime control
|
|
ENV XMLRPC_PORT=8090
|
|
EXPOSE 8090
|
|
|
|
USER gnuradio
|
|
|
|
# Default: run a flowgraph passed as argument
|
|
ENTRYPOINT ["python3"]
|