The FM File Replay service simulates real Software-Defined Radio (SDR) hardware by reading audio files, performing GPU-accelerated FM modulation, and transmitting baseband I/Q samples via UDP to the Holoscan SDR pipeline.
This service is not simply replaying audio files. Instead, it provides a complete simulation of the type of data that would be received from physical SDR hardware connected to FM radio channels. The replay service:
- Reads audio files from the configured file list
- FM-modulates the audio data to specified channel frequencies
- Sums across multiple simulated FM channels
- Transmits the resulting I/Q samples via UDP to the Holoscan SDR
This allows for realistic testing and development without requiring physical SDR hardware.
Replay files must be located within the build context of the file-replay service that is deployed, specifically inside src/file-replay/files.
So for a file located at:
streaming-data-to-rag/src/file-replay/files/file1.mp3the ENV should be set to
export REPLAY_FILES="file1.mp3"Configure the file replay service using these environment variables:
export REPLAY_FILES="file1.mp3,file2.mp3,file3.mp3" # Comma-separated list of audio filesexport REPLAY_TIME=3600 # Maximum replay time in seconds (default: 3600)
export REPLAY_MAX_FILE_SIZE=50 # Maximum size of individual file in MB (default: 50)- Location: All replay files must be placed in
src/file-replay/files/ - Formats: Supported audio formats include MP3, WAV, and other common audio files
- Size Limit: Individual files should not exceed the configured
REPLAY_MAX_FILE_SIZE(default: 50MB) - Naming: Files should be named as specified in the
REPLAY_FILESenvironment variable
The replay configuration must match the Holoscan SDR parameters in src/software-defined-radio/params.yaml:
| Parameter | Holoscan Config Path | Description |
|---|---|---|
| Sample Rate | sensor.sample_rate |
I/Q sample rate in Hz |
| UDP Port | network_rx.dst_port |
UDP destination port |
| Max Payload Size | network_rx.max_payload_size |
UDP packet size limit |
| Number of Channels | channelizer.num_channels |
Number of FM channels to simulate |
| Channel Spacing | channelizer.channel_spacing |
Frequency spacing between channels in Hz |
Place your audio files in the src/file-replay/files/ directory:
# Example file structure
src/file-replay/files/
├── news_broadcast.mp3
├── music_station.mp3
└── talk_radio.wavSet the required environment variables:
export REPLAY_FILES="news_broadcast.mp3,music_station.mp3,talk_radio.wav"
export REPLAY_TIME=7200 # 2 hours
export REPLAY_MAX_FILE_SIZE=100 # 100MB limitBuild the container as part of the main deployment:
docker compose -f deploy/docker-compose.yaml --profile replay buildDeploy the service:
docker compose -f deploy/docker-compose.yaml --profile replay up -dCheck that the service is running and transmitting data:
# Check container status
docker logs fm-file-replay
# Verify UDP traffic (if netstat is available)
netstat -u | grep <UDP_PORT>- Audio Input: Reads entire set of audio files and holds in memory
- Channel Assignment: Each file is assigned to a specific FM channel frequency
- FM Modulation: Audio is frequency-modulated using GPU acceleration
- Channel Summation: All modulated channels are summed to create composite baseband signal
- I/Q Generation: Complex baseband samples are generated for transmission
- UDP Transmission: I/Q samples are packetized and sent via UDP
- Base Image:
nvcr.io/nvidia/pytorch:23.08-py3 - GPU Requirements: CUDA-capable GPU for FM modulation acceleration
- Dependencies: PyTorch, audio processing libraries, network utilities
The service transmits UDP packets containing I/Q samples to the Holoscan SDR container. Ensure network connectivity between containers:
- Protocol: UDP
- Data Format: Complex I/Q samples (interleaved float32)
- Packet Size: Configurable via
max_payload_size - Target: Holoscan SDR container on specified port
Files Not Found
# Verify file location
ls -la src/file-replay/files/
# Check environment variable
echo $REPLAY_FILESUDP Transmission Issues
# Check container networking
docker network ls
docker network inspect <network_name>Audio Format Issues
# Check file formats
file src/file-replay/files/*.mp3
# Verify file sizes
du -h src/file-replay/files/*View detailed service logs:
# Real-time logs
docker logs -f fm-file-replay
# Recent logs
docker logs --tail=100 fm-file-replayMonitor GPU usage during FM modulation:
# Inside container or on host
nvidia-smi
# Container resource usage
docker stats fm-file-replayWhen transitioning from file replay to physical SDR hardware:
- Disable file replay: Remove
--profile replayfrom docker compose commands - Enable USB mounting: Add USB device mounts to docker-compose.yaml
- Configure GNU Radio: Use provided GRC file in
examples/directory - Update parameters: Ensure sample rates and frequencies match your hardware
For detailed physical SDR setup, see the main README section on "USB Device Mounting for Physical SDR Hardware".