Raspberry-UDP_audio_receiver

🎶 Network Audio Receiver (UDP) for Raspberry Pi

A lightweight UDP stereo audio receiver for Raspberry Pi. It outputs directly to ALSA (also compatible with PipeWire using its ALSA bridge), ensuring very low latency – ideal for real-time monitoring and live audio.


✨ Features


⚙️ Settings Overview (Form2)

Control / Field Description
Audio Output Selection Choose the audio output device (3.5 mm jack, HDMI, USB, etc.). If no configuration exists for a device, a default configuration is created automatically at program start. Only one device can be selected at a time.
IP IP address to receive audio from. Use 0.0.0.0 to listen on all network interfaces.
Port UDP port for incoming audio. Default is 5010.
Network Buffer Size of the receive buffer in bytes. Must be at least as large as a single sent audio block.
Frequency Audio sample rate in Hz (e.g., 48000).
Latency Audio latency in samples. Typical values: 22000 for JACK/Headphones, 3000 for USB audio.
Swap Byte Order Enable this if the incoming audio uses a different byte order (big/little endian).
Hide Window If enabled, the application window remains minimized or hidden once audio starts.
Activate Immediately applies the current settings without saving them.
Save Saves the current settings to the configuration file for future use.
Delete Device Deletes the selected device configuration. If the device exists, it will be recreated with default values at the next program start.

💡 Example Test Setup

Result: Stable low-latency playback in a typical home network.


📥 Receiver

Start the player:

./udp_player

A window appears and starts playback automatically when UDP packets arrive. Audio output selection: If this is the first run or no previous configuration was selected, choose your desired audio output (3.5 mm jack, HDMI, USB, etc.) in the settings window.

Silence Handling:


📤 Sender (System Audio)

Install ffmpeg:

sudo apt install ffmpeg

To transmit system audio, use the provided startup script StartFFmpegTransmitter.sh:

  1. Edit the script and replace the IP address with the address of your receiver.
  2. Set the port number to match the configuration on the receiver.
  3. Make the script executable:
chmod +x StartFFmpegTransmitter.sh
  1. Save the file, place it on the desktop, and start it with a double-click.

🎯 Latency Optimization


🔊 Audio Volume

If sound is too quiet:

alsamixer

Or via terminal:

amixer set 'Master' 100% unmute

📜 License

This project is licensed under the MIT License.


🌐 Other Projects by the Author