Skip to content

Commit 3793f1e

Browse files
author
RaspberryPiFpcHub
committed
v3
1 parent bb35adb commit 3793f1e

File tree

11 files changed

+155
-176
lines changed

11 files changed

+155
-176
lines changed

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The program automatically detects whether packets are being received:
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).
1010
- A separate settings window is available.
11-
- 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.
11+
- If the “Start Minimized” checkbox is selected, the application will start minimized.
1212
- A startup script for an FFmpeg audio sender (`StartFFmpegTransmitter.sh`) is provided. Place it on the desktop and start it with a double-click.
1313

1414
---
@@ -36,19 +36,27 @@ This setup demonstrated stable low-latency streaming under typical home network
3636
## ▶️ Usage
3737

3838
### 📤 Sender (System Audio)
39+
Install `ffmpeg`:
3940

40-
The sender transmits system audio – everything normally played through the speaker.
41-
42-
If not yet installed, install `ffmpeg`:
43-
```bash
4441
sudo apt install ffmpeg
45-
```
4642

47-
To transmit system audio, use the provided startup file `StartFFmpegTransmitter.sh`:
43+
To transmit system audio, use the provided startup script **`StartFFmpegTransmitter.sh`**:
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
50+
51+
Save the file, place it on the desktop, and start it with a double-click.
52+
53+
### 📥 Receiver
54+
55+
Start the player:
56+
57+
./udp_player
4858

49-
- Replace the IP address with the correct address of your receiver.
50-
- Select a port that matches the receiver configuration.
51-
- Place the file on the desktop and start it with a double-click.
59+
A window appears and starts playback automatically when UDP packets arrive.
5260

5361
---
5462

bin/udp_player

-667 KB
Binary file not shown.

bin/udp_player.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ swap byte=0
1111
latency=20000
1212

1313
[visible]
14-
hide=1
14+
hide=0

docs/index.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ It outputs directly to **ALSA**, ensuring **very low latency** – ideal for rea
1717
- Direct **ALSA audio output** for minimal delay
1818
- Developed in **Free Pascal** using **Codetyphon** on **Debian Bookworm**
1919
- **Automatic detection** of incoming packets:
20-
- Packets arrive → audio plays instantly
21-
- No or silent packets for 5 seconds → audio output stops
20+
- Packets arrive → audio plays instantly
21+
- No or silent packets for 5 seconds → audio output stops
2222
- **No codec** → uncompressed audio, maximum quality, minimal processing delay
23-
- Optional **Hide mode**:
24-
- On startup, the window is visible
25-
- If the **Hide** checkbox is enabled, the window auto-minimizes when audio is received and stays hidden until disabled
26-
23+
- On startup, the window is visible
24+
- If the “Start Minimized” checkbox is selected, the application will start minimized.
2725
---
2826

2927
## 💡 Example Test Setup
@@ -38,17 +36,21 @@ Result: Stable low-latency playback in a typical home network.
3836

3937
## ▶️ Usage
4038

41-
### 📤 Sender (FFmpeg example)
4239

40+
### 📤 Sender (System Audio)
4341
Install `ffmpeg`:
4442

4543
sudo apt install ffmpeg
4644

47-
Start transmitting system audio with the provided script `StartFFmpegTransmitter.sh`.
48-
- Replace the IP address with your receiver’s address
49-
- Choose a matching port
45+
To transmit system audio, use the provided startup script **`StartFFmpegTransmitter.sh`**:
46+
47+
1. Edit the script and replace the IP address with the address of your receiver.
48+
2. Set the port number to match the configuration on the receiver.
49+
3. Make the script executable:
50+
```bash
51+
chmod +x StartFFmpegTransmitter.sh
5052

51-
Double-click the script to start streaming.
53+
Save the file, place it on the desktop, and start it with a double-click.
5254

5355
### 📥 Receiver
5456

source/udp_player

100644100755
-667 KB
Binary file not shown.

source/udp_player.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ swap byte=0
1111
latency=20000
1212

1313
[visible]
14-
hide=1
14+
hide=0

source/udp_player.ctpr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@
6464
</SearchPaths>
6565
<Linking>
6666
<Debugging>
67-
<GenerateDebugInfo Value="False"/>
68-
<RunWithoutDebug Value="True"/>
67+
<UseExternalDbgSyms Value="True"/>
6968
</Debugging>
7069
<Options>
7170
<Win32>

source/udp_player.ctps

Lines changed: 40 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<EditorIndex Value="2"/>
1212
<WindowIndex Value="0"/>
1313
<TopLine Value="14"/>
14-
<CursorPos X="28" Y="6"/>
15-
<UsageCount Value="142"/>
14+
<CursorPos X="16" Y="6"/>
15+
<UsageCount Value="143"/>
1616
<Loaded Value="True"/>
1717
</Unit>
1818
<Unit>
@@ -22,12 +22,11 @@
2222
<ComponentName Value="Form1"/>
2323
<HasResources Value="True"/>
2424
<ResourceBaseClass Value="Form"/>
25-
<IsVisibleTab Value="True"/>
2625
<EditorIndex Value="0"/>
2726
<WindowIndex Value="0"/>
28-
<TopLine Value="65"/>
29-
<CursorPos X="3" Y="70"/>
30-
<UsageCount Value="142"/>
27+
<TopLine Value="360"/>
28+
<CursorPos X="95" Y="362"/>
29+
<UsageCount Value="143"/>
3130
<Loaded Value="True"/>
3231
<LoadedDesigner Value="True"/>
3332
</Unit>
@@ -39,11 +38,12 @@
3938
<HasResources Value="True"/>
4039
<ResourceBaseClass Value="Form"/>
4140
<UnitName Value="Unit2"/>
41+
<IsVisibleTab Value="True"/>
4242
<EditorIndex Value="1"/>
4343
<WindowIndex Value="0"/>
44-
<TopLine Value="64"/>
45-
<CursorPos X="80" Y="68"/>
46-
<UsageCount Value="44"/>
44+
<TopLine Value="21"/>
45+
<CursorPos X="57" Y="70"/>
46+
<UsageCount Value="45"/>
4747
<Loaded Value="True"/>
4848
<LoadedDesigner Value="True"/>
4949
</Unit>
@@ -100,126 +100,90 @@
100100
<UsageCount Value="11"/>
101101
</Unit>
102102
</Units>
103-
<JumpHistory HistoryIndex="29">
104-
<Position>
105-
<Filename Value="unit1.pas"/>
106-
<Caret Line="214" Column="43" TopLine="209"/>
107-
</Position>
108-
<Position>
109-
<Filename Value="unit1.pas"/>
110-
<Caret Line="382" Column="95" TopLine="396"/>
111-
</Position>
112-
<Position>
113-
<Filename Value="unit1.pas"/>
114-
<Caret Line="255" TopLine="252"/>
115-
</Position>
116-
<Position>
117-
<Filename Value="unit1.pas"/>
118-
<Caret Line="285" Column="68" TopLine="281"/>
119-
</Position>
103+
<JumpHistory HistoryIndex="20">
120104
<Position>
121-
<Filename Value="unit1.pas"/>
122-
<Caret Line="117" Column="56" TopLine="106"/>
105+
<Filename Value="unit2.pas"/>
106+
<Caret Line="68" TopLine="56"/>
123107
</Position>
124108
<Position>
125-
<Filename Value="unit1.pas"/>
126-
<Caret Line="140" Column="22" TopLine="129"/>
109+
<Filename Value="unit2.pas"/>
110+
<Caret Line="61" TopLine="56"/>
127111
</Position>
128112
<Position>
129-
<Filename Value="unit1.pas"/>
130-
<Caret Line="147" TopLine="139"/>
113+
<Filename Value="unit2.pas"/>
114+
<Caret Line="62" TopLine="56"/>
131115
</Position>
132116
<Position>
133-
<Filename Value="unit1.pas"/>
134-
<Caret Line="154" Column="66" TopLine="141"/>
117+
<Filename Value="unit2.pas"/>
118+
<Caret Line="63" TopLine="56"/>
135119
</Position>
136120
<Position>
137-
<Filename Value="unit1.pas"/>
138-
<Caret Line="150" Column="50" TopLine="146"/>
121+
<Filename Value="unit2.pas"/>
122+
<Caret Line="64" TopLine="56"/>
139123
</Position>
140124
<Position>
141-
<Filename Value="unit1.pas"/>
142-
<Caret Line="286" Column="25" TopLine="283"/>
125+
<Filename Value="unit2.pas"/>
126+
<Caret Line="65" TopLine="56"/>
143127
</Position>
144128
<Position>
145-
<Filename Value="unit1.pas"/>
146-
<Caret Line="356" Column="29" TopLine="344"/>
129+
<Filename Value="unit2.pas"/>
130+
<Caret Line="66" TopLine="62"/>
147131
</Position>
148132
<Position>
149-
<Filename Value="unit1.pas"/>
150-
<Caret Line="67" Column="26" TopLine="60"/>
133+
<Filename Value="unit2.pas"/>
134+
<Caret Line="67" TopLine="62"/>
151135
</Position>
152136
<Position>
153-
<Filename Value="unit1.pas"/>
154-
<Caret Line="114" Column="30" TopLine="101"/>
137+
<Filename Value="unit2.pas"/>
138+
<Caret Line="68" TopLine="62"/>
155139
</Position>
156140
<Position>
157141
<Filename Value="unit1.pas"/>
158-
<Caret Line="136" Column="28" TopLine="123"/>
142+
<Caret Line="200" Column="10" TopLine="189"/>
159143
</Position>
160144
<Position>
161145
<Filename Value="unit1.pas"/>
162-
<Caret Line="142" Column="7" TopLine="129"/>
146+
<Caret Line="101" Column="20" TopLine="95"/>
163147
</Position>
164148
<Position>
165149
<Filename Value="unit1.pas"/>
166-
<Caret Line="143" Column="18" TopLine="130"/>
150+
<Caret Line="169" Column="20" TopLine="164"/>
167151
</Position>
168152
<Position>
169153
<Filename Value="unit1.pas"/>
170-
<Caret Line="134" Column="21" TopLine="130"/>
154+
<Caret Line="200" Column="12" TopLine="189"/>
171155
</Position>
172156
<Position>
173157
<Filename Value="unit1.pas"/>
174-
<Caret Line="133" TopLine="41"/>
158+
<Caret Line="196" Column="3" TopLine="190"/>
175159
</Position>
176160
<Position>
177161
<Filename Value="unit1.pas"/>
178-
<Caret Line="70" TopLine="64"/>
162+
<Caret Line="359" Column="9" TopLine="353"/>
179163
</Position>
180164
<Position>
181165
<Filename Value="unit1.pas"/>
182-
<Caret Line="212" Column="3" TopLine="200"/>
166+
<Caret Line="50" Column="20" TopLine="44"/>
183167
</Position>
184168
<Position>
185169
<Filename Value="unit1.pas"/>
186-
<Caret Line="112" Column="2" TopLine="104"/>
170+
<Caret Line="198" Column="14" TopLine="197"/>
187171
</Position>
188172
<Position>
189173
<Filename Value="unit1.pas"/>
190-
<Caret Line="243" Column="26" TopLine="238"/>
174+
<Caret Line="91" Column="16" TopLine="85"/>
191175
</Position>
192176
<Position>
193177
<Filename Value="unit1.pas"/>
194-
<Caret Line="66" Column="25" TopLine="59"/>
178+
<Caret Line="161" Column="90" TopLine="151"/>
195179
</Position>
196180
<Position>
197181
<Filename Value="unit1.pas"/>
198-
<Caret Line="236" Column="49" TopLine="228"/>
199-
</Position>
200-
<Position>
201-
<Filename Value="unit2.pas"/>
202-
<Caret Line="66" Column="110"/>
203-
</Position>
204-
<Position>
205-
<Filename Value="unit2.pas"/>
206-
<Caret Line="71" Column="14" TopLine="59"/>
207-
</Position>
208-
<Position>
209-
<Filename Value="unit2.pas"/>
210-
<Caret Line="81" Column="38" TopLine="73"/>
211-
</Position>
212-
<Position>
213-
<Filename Value="unit2.pas"/>
214-
<Caret Line="71" Column="72" TopLine="59"/>
182+
<Caret Line="200" Column="10" TopLine="190"/>
215183
</Position>
216184
<Position>
217185
<Filename Value="unit1.pas"/>
218-
<Caret Line="50" Column="24" TopLine="49"/>
219-
</Position>
220-
<Position>
221-
<Filename Value="unit2.pas"/>
222-
<Caret Line="72" Column="3" TopLine="64"/>
186+
<Caret Line="274" Column="10" TopLine="262"/>
223187
</Position>
224188
</JumpHistory>
225189
<RunParams>

source/unit1.frm

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,44 @@
11
object Form1: TForm1
22
Left = 242
3-
Height = 47
3+
Height = 50
44
Top = 158
5-
Width = 346
5+
Width = 368
66
Caption = 'UDP player'
7-
ClientHeight = 47
8-
ClientWidth = 346
7+
ClientHeight = 50
8+
ClientWidth = 368
9+
DesignTimePPI = 102
910
Position = poDesktopCenter
10-
LCLVersion = '8.6'
11+
LCLVersion = '8.7'
1112
OnClose = FormClose
1213
OnCreate = FormCreate
1314
object Label1: TLabel
14-
Left = 188
15-
Height = 22
16-
Top = 11
17-
Width = 47
15+
Left = 200
16+
Height = 23
17+
Top = 12
18+
Width = 50
1819
Caption = 'Label1'
1920
end
2021
object Button1: TButton
21-
Left = 248
22-
Height = 25
22+
Left = 264
23+
Height = 27
2324
Top = 8
24-
Width = 53
25+
Width = 56
2526
Caption = 'close'
2627
TabOrder = 0
2728
OnClick = Button1Click
2829
end
2930
object Label2: TLabel
30-
Left = 10
31-
Height = 22
32-
Top = 11
33-
Width = 177
31+
Left = 11
32+
Height = 23
33+
Top = 12
34+
Width = 188
3435
Caption = 'in Alsa buffered samples:'
3536
end
3637
object SpeedButton1: TSpeedButton
37-
Left = 309
38-
Height = 25
38+
Left = 328
39+
Height = 27
3940
Top = 8
40-
Width = 30
41+
Width = 32
4142
Glyph.Data = {
4243
36090000424D3609000000000000360000002800000018000000180000000100
4344
2000000000000009000000000000000000000000000000000000000000000000
@@ -120,6 +121,6 @@ object Form1: TForm1
120121
end
121122
object Timer1: TTimer
122123
OnTimer = Timer1Timer
123-
Left = 68
124+
Left = 72
124125
end
125126
end

0 commit comments

Comments
 (0)