Skip to content

Commit bec092a

Browse files
author
RaspberryPiFpcHub
committed
a
1 parent ce48168 commit bec092a

File tree

14 files changed

+556
-136
lines changed

14 files changed

+556
-136
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22

33
All notable changes to this project are documented in this file.
4+
5+
## [1.0.2] – 2025-08-13
6+
### Added
7+
- A separate settings form is now available.
8+
- If the `Hide` checkbox is enabled, the application window will remain permanently hidden once audio starts playing.
9+
410
## [1.0.1] – 2025-07-27
511
### Added
612
- A binary has been added to /bin for quick and simple testing.

README.md

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ This program receives stereo audio data over UDP (e.g., RTP stream) and outputs
44

55
The program automatically detects whether packets are being received:
66
- If packets arrive → Audio is played.
7-
- If no audio packets or only silent ones are received for 5 seconds → Audio output stops, window is hidden.
7+
- If no audio packets or only silent ones are received for 5 seconds → Audio output stops.
88
- For maximum quality, no codec is used – the audio is transmitted uncompressed.
99
- 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.
1014

1115
---
1216

@@ -17,6 +21,19 @@ The program automatically detects whether packets are being received:
1721
- ALSA installed
1822
- Network connection for receiving UDP packets
1923

24+
---
25+
26+
## 🧪 Test Setup
27+
28+
The example test setup for development and verification was as follows:
29+
30+
- **Sender**: Raspberry Pi 4 playing YouTube videos in a browser, connected via **2.4 GHz Wi-Fi** to a router.
31+
- **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.
33+
34+
This setup demonstrated stable low-latency streaming under typical home network conditions.
35+
36+
---
2037

2138
## ▶️ Usage
2239

@@ -29,31 +46,39 @@ If not yet installed, install `ffmpeg`:
2946
sudo apt install ffmpeg
3047
```
3148

32-
To transmit system audio, start the sender with the following command:
33-
```bash
34-
ffmpeg -f pulse -i default \
35-
-acodec copy -f rtp \
36-
-fflags nobuffer -flags low_delay \
37-
-max_delay 0 -flush_packets 1 \
38-
-rtbufsize 0 -avioflags direct \
39-
-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 1 \
40-
rtp://192.168.1.1:5010
41-
```
49+
To transmit system audio use the provided startup file `StartFFmpegTransmitter.sh`.
4250

43-
- `192.168.1.1` is the IP address of the receiver → adjust accordingly!
44-
- `5010` is the port number → freely selectable, must match the receiver
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.
54+
55+
---
4556

4657
### 📥 Receiver
4758

4859
Simply start the receiver:
4960
```bash
5061
./udp_player
5162
```
52-
5363
A window will appear and automatically start playing audio when UDP packets are received.
5464

5565
---
5666

67+
## 🎯 Optimization Notes
68+
69+
The audio latency is a **parameter of the receiver application** and can be set in its configuration.
70+
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.
74+
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.
79+
80+
---
81+
5782
## 🔊 If the audio is too quiet …
5883

5984
This may occur if the receiver volume is set too low.
@@ -65,7 +90,9 @@ This may occur if the receiver volume is set too low.
6590
amixer set 'Master' 100% unmute
6691
```
6792

93+
---
94+
6895
## 📝 License
6996

7097
This project is licensed under the MIT License.
71-
98+

bin/StartFFmpegTransmitter.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
IP_Address_Receiver="192.168.192.123"
4+
Port=5010
5+
6+
lxterminal -e /usr/bin/ffmpeg -f pulse -i default -acodec copy \
7+
-f rtp -fflags nobuffer -flags low_delay -max_delay 0 \
8+
-flush_packets 1 \
9+
rtp://$IP_Address_Receiver:$Port

bin/udp_player

67.8 KB
Binary file not shown.

source/StartFFmpegTransmitter.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
IP_Address_Receiver="192.168.192.123"
4+
Port=5010
5+
6+
lxterminal -e /usr/bin/ffmpeg -f pulse -i default -acodec copy \
7+
-f rtp -fflags nobuffer -flags low_delay -max_delay 0 \
8+
-flush_packets 1 \
9+
rtp://$IP_Address_Receiver:$Port

source/adjust.bmp

2.3 KB
Binary file not shown.

source/udp_player.conf

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
[network]
12
ip=0.0.0.0
23
port=5010
3-
SizeNetworkbuffer=100000
4-
frequenz=48000
5-
swap=0
6-
alsalatency=28000
4+
buffersize=64000
5+
6+
[audio]
7+
frequency=48000
8+
swap byte=0
9+
10+
[alsa]
11+
latency=20000
12+
13+
[visible]
14+
hide=1

source/udp_player.ctpr

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@
4242
<HasResources Value="True"/>
4343
<ResourceBaseClass Value="Form"/>
4444
</Unit>
45+
<Unit>
46+
<Filename Value="unit2.pas"/>
47+
<FRMtype Value="0"/>
48+
<IsPartOfProject Value="True"/>
49+
<ComponentName Value="Form2"/>
50+
<HasResources Value="True"/>
51+
<ResourceBaseClass Value="Form"/>
52+
<UnitName Value="Unit2"/>
53+
</Unit>
4554
</Units>
4655
</ProjectOptions>
4756
<CompilerOptions>

0 commit comments

Comments
 (0)