You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+76-57Lines changed: 76 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,102 +2,118 @@
2
2
3
3
UDP network audio receiver for Raspberry Pi with very low latency via ALSA.
4
4
5
-
The program automatically detects whether packets are being received:
5
+
---
6
6
7
-
- If packets arrive → audio is played.
8
-
- For maximum quality, no codec is used – the audio is transmitted uncompressed.
9
-
- This allows for very low latency, making it ideal for real-time transmissions (e.g., monitoring, live audio).
10
-
- A separate settings window is available.
11
-
- If the “Start Minimized” checkbox is selected, the application will start minimized.
12
-
- A startup script for an FFmpeg audio sender (`StartFFmpegTransmitter.sh`) is provided. Place it on the desktop and start it with a double-click.
7
+
## ⚡ Quick Start
13
8
14
-
---
9
+
### Sender (System Audio)
15
10
16
-
## 💠 Requirements
11
+
1. Install ffmpeg:
17
12
18
-
- Raspberry Pi running Debian Bookworm
19
-
- ALSA installed
20
-
- Network connection for receiving UDP packets
13
+
```bash
14
+
sudo apt install ffmpeg
15
+
```
21
16
22
-
---
17
+
2. Edit the provided `StartFFmpegTransmitter.sh` script:
23
18
24
-
## 🧪 Test Setup
19
+
* Replace the IP address with your receiver's IP.
20
+
* Set the port number to match the receiver configuration.
21
+
3. Make the script executable:
25
22
26
-
Example setup used during development and verification:
23
+
```bash
24
+
chmod +x StartFFmpegTransmitter.sh
25
+
```
27
26
28
-
-**Sender**: Raspberry Pi 4 playing YouTube videos in a browser, connected via **2.4 GHz Wi-Fi** to a router.
29
-
-**Receiver**: Another Raspberry Pi 4, connected via **Ethernet (LAN)** to the same router.
30
-
- Receiver’s **3.5 mm jack audio output** connected to a **HiFi receiver** for playback.
27
+
4. Place the script on the desktop and double-click to start transmitting.
31
28
32
-
This setup demonstrated stable low-latency streaming under typical home network conditions.
29
+
### Receiver
33
30
34
-
---
31
+
1. Start the player:
35
32
36
-
## ▶️ Usage
33
+
```bash
34
+
./udp_player
35
+
```
37
36
38
-
### 📤 Sender (System Audio)
39
-
Install `ffmpeg`:
37
+
2. The window will appear and start playback automatically when UDP packets are received.
38
+
3. Choose the audio output device in settings (3.5 mm jack, HDMI, USB, and more).
40
39
41
-
sudo apt install ffmpeg
40
+
**Silence Handling:**
42
41
43
-
To transmit system audio, use the provided startup script **`StartFFmpegTransmitter.sh`**:
42
+
* If no audio packets arrive for 5 seconds, ALSA stops and releases the output.
43
+
* Playback resumes automatically when new packets arrive.
44
44
45
-
1. Edit the script and replace the IP address with the address of your receiver.
46
-
2. Set the port number to match the configuration on the receiver.
47
-
3. Make the script executable:
48
-
```bash
49
-
chmod +x StartFFmpegTransmitter.sh
45
+
---
50
46
51
-
Save the file, place it on the desktop, and start it with a double-click.
47
+
## ✨ Features
52
48
53
-
### 📥 Receiver
49
+
* UDP audio streaming with very low latency
50
+
* Uncompressed audio for maximum quality
51
+
* Automatic detection of incoming audio packets
52
+
* Silence handling with automatic ALSA release and re-initialization
53
+
* Selectable audio output (3.5 mm jack, HDMI, USB, and more)
54
+
* Adjustable latency per output device:
55
+
* 3.5 mm jack ≈ 22000 (=22 ms)
56
+
* USB audio stick ≈ 3000 (=3 ms)
57
+
* Start minimized option
58
+
* Separate settings window for configuration
59
+
* Startup script provided for FFmpeg sender
54
60
55
-
Start the player:
61
+
---
56
62
57
-
./udp_player
63
+
## 💠 Requirements
58
64
59
-
A window appears and starts playback automatically when UDP packets arrive.
65
+
* Raspberry Pi running Debian Bookworm
66
+
* ALSA installed
67
+
* Network connection for receiving UDP packets
60
68
61
69
---
62
70
63
-
### 📥 Receiver
71
+
## 🧪 Test Setup
72
+
73
+
***Sender**: Raspberry Pi 4 playing YouTube videos via Wi-Fi.
74
+
***Receiver**: Another Raspberry Pi 4 connected via LAN.
75
+
* Receiver audio output connected to HiFi receiver (3.5 mm jack, HDMI, or USB).
64
76
65
-
Start the receiver:
66
-
```bash
67
-
./udp_player
68
-
```
77
+
---
78
+
79
+
## ▶️ Usage
80
+
81
+
Refer to the Quick Start section above.
69
82
70
-
The receiver window will appear and automatically start playing audio when UDP packets are received.
83
+
**Audio Output Selection:**
71
84
72
-
**Silence Handling:**
73
-
If no audio packets—or only silent packets—are received for 5 seconds, the ALSA output is stopped and released. When new packets arrive, ALSA is automatically re-initialized, allowing playback to resume seamlessly.
85
+
* Choose your desired output device in settings.
86
+
* Supported outputs: 3.5 mm jack, HDMI, USB, and more.
87
+
88
+
**Silence Handling:**
89
+
90
+
* ALSA output stops after 5 seconds of no packets and restarts automatically when new packets arrive.
74
91
75
92
---
76
93
77
94
## 🎯 Optimization Notes
78
95
79
-
Audio latency can be configured in the receiver application:
96
+
***Lower buffer size** → lower audio delay
97
+
***Too low** → possible dropouts or crackling audio
0 commit comments