Skip to content

Commit ebecf8f

Browse files
author
RaspberryPiFpcHub
committed
b
1 parent bec092a commit ebecf8f

File tree

1 file changed

+35
-33
lines changed

1 file changed

+35
-33
lines changed

README.md

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
# UDP Audio Receiver for Raspberry Pi (FPC)
1+
# Network Audio Receiver (UDP) for Raspberry Pi (FPC)
22

3-
This program receives stereo audio data over UDP (e.g., RTP stream) and outputs it via ALSA. It was developed in Free Pascal using Codetyphon on Debian Bookworm
3+
UDP network audio receiver for Raspberry Pi with very low latency via ALSA.
44

55
The program automatically detects whether packets are being received:
6-
- If packets arrive → Audio is played.
7-
- If no audio packets or only silent ones are received for 5 seconds → Audio output stops.
6+
7+
- If packets arrive → audio is played.
8+
- If no audio packets, or only silent packets, are received for 5 seconds → audio output stops.
89
- For maximum quality, no codec is used – the audio is transmitted uncompressed.
910
- This allows for very low latency, making it ideal for real-time transmissions (e.g., monitoring, live audio).
10-
- A separate settings form is now available.
11-
- The application window is now always visible.
12-
- If the `Hide` checkbox is enabled the application is minimized at startup.
13-
- A startup file for an FFmpeg audio sender (`StartFFmpegTransmitter.sh`) is provided; when placed on the desktop, it can be started with a double-click.
11+
- A separate settings window is available.
12+
- At startup, the receiver window is always visible. If the `Hide` checkbox is selected, the window is automatically hidden when audio packets are received and remains hidden.
13+
- A startup script for an FFmpeg audio sender (`StartFFmpegTransmitter.sh`) is provided. Place it on the desktop and start it with a double-click.
1414

1515
---
1616

1717
## 💠 Requirements
1818

19-
- Raspberry Pi with Debian Bookworm
20-
- Codetyphon
19+
- Raspberry Pi running Debian Bookworm
20+
- Codetyphon IDE
2121
- ALSA installed
2222
- Network connection for receiving UDP packets
2323

2424
---
2525

2626
## 🧪 Test Setup
2727

28-
The example test setup for development and verification was as follows:
28+
Example setup used during development and verification:
2929

3030
- **Sender**: Raspberry Pi 4 playing YouTube videos in a browser, connected via **2.4 GHz Wi-Fi** to a router.
3131
- **Receiver**: Another Raspberry Pi 4, connected via **Ethernet (LAN)** to the same router.
32-
- The receiver’s **3.5 mm Jack audio output** was connected to a **HiFi receiver** for playback.
32+
- Receiver’s **3.5 mm jack audio output** connected to a **HiFi receiver** for playback.
3333

3434
This setup demonstrated stable low-latency streaming under typical home network conditions.
3535

@@ -46,53 +46,55 @@ If not yet installed, install `ffmpeg`:
4646
sudo apt install ffmpeg
4747
```
4848

49-
To transmit system audio use the provided startup file `StartFFmpegTransmitter.sh`.
49+
To transmit system audio, use the provided startup file `StartFFmpegTransmitter.sh`:
5050

51-
- IP address of the receiver → replace with the correct address of your receiver.
52-
- Port → can be freely selected, but must match the receiver’s configuration.
53-
- If the file is placed on the desktop, the sender can be started by simply double-clicking the file.
51+
- Replace the IP address with the correct address of your receiver.
52+
- Select a port that matches the receiver configuration.
53+
- Place the file on the desktop and start it with a double-click.
5454

5555
---
5656

5757
### 📥 Receiver
5858

59-
Simply start the receiver:
59+
Start the receiver:
6060
```bash
6161
./udp_player
6262
```
63-
A window will appear and automatically start playing audio when UDP packets are received.
63+
64+
The receiver window will appear and automatically start playing audio when UDP packets are received.
6465

6566
---
6667

6768
## 🎯 Optimization Notes
6869

69-
The audio latency is a **parameter of the receiver application** and can be set in its configuration.
70+
Audio latency can be configured in the receiver application:
71+
72+
- **Lower latency values** → reduce audio delay, improving real-time performance.
73+
- **Too low values** → may cause sporadic audio dropouts, depending on network type and stability.
74+
- **Extremely low values** → may result in distorted or crackling audio due to buffer underruns.
7075

71-
- **Lower latency values** → reduce the audio delay, improving real-time performance.
72-
- **Too low values** → may cause **sporadic audio dropouts**, depending on the connection type (Wi-Fi or LAN) and network stability.
73-
- **Extremely low values** → may result in **distorted / crackling audio** due to buffer underruns.
76+
Optimal settings depend on:
7477

75-
The optimal setting depends on:
76-
- Network quality and stability.
77-
- Connection type (LAN generally allows lower latency than Wi-Fi).
78-
- Performance of the Raspberry Pi and audio output hardware.
78+
- Network quality and stability
79+
- Connection type (LAN generally allows lower latency than Wi-Fi)
80+
- Performance of the Raspberry Pi and audio output hardware
7981

8082
---
8183

82-
## 🔊 If the audio is too quiet
84+
## 🔊 If the audio is too quiet
8385

8486
This may occur if the receiver volume is set too low.
8587

8688
### Possible solutions:
87-
- Use `alsamixer`, press `F6` to select the correct device, and increase volume
88-
- Or use the terminal:
89-
```bash
90-
amixer set 'Master' 100% unmute
91-
```
89+
90+
- Use `alsamixer`, press `F6` to select the correct device, and increase the volume
91+
- Or via terminal:
92+
```bash
93+
amixer set 'Master' 100% unmute
94+
```
9295

9396
---
9497

9598
## 📝 License
9699

97100
This project is licensed under the MIT License.
98-

0 commit comments

Comments
 (0)