forked from boatbod/op25
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README-rpi3-liquidsoap
115 lines (93 loc) · 4.39 KB
/
README-rpi3-liquidsoap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
How to Install OP25 and LiquidSoap on a Raspberry Pi3 Raspbian Stretch
----------------------------------------------------------------------
These high level instructions will lead you through installing op25 and liquidsoap
on any Debian based Linux system. It is geared towards the Raspberry Pi3B which is
inexpensive but yet just powerful enough to receive, decode and stream P25 trunked
radio system utilizing either Phase 1 or Phase 2 audio codecs.
It is possible to configure and use op25 with other streaming software (such as Darkice)
but this setup has the advantage of completely avoiding use of the ALSA sound subsystem
with has proven itself to be someway quirky and prone to problems particularly when using
the loopback driver (aloop).
There are many refinements which should be made to these instructions, particularly how
to configure liquidsoap and op25 to properly auto-start at boot time.
1. Install op25
---------------
sudo apt-get install git
cd ~
git clone https://github.com/boatbod/op25
cd op25
./install.sh
2. Install GNUPlot-X11 (optional)
-----------------------
sudo apt-get install gnuplot-x11
3. Install liquidsoap
---------------------
sudo apt-get install liquidsoap liquidsoap-plugin-all
4. Install PulseAudio (optional, but preferred over alsa for local audio)
---------------------
sudo apt-get install pulseaudio pulseaudio-utils
5. Install Icecase (optional)
-----------------------------
sudo apt-get install icecast2
Follow prompts and set up appropriate passwords
Edit /etc/icecast/icecast.xml and define your mount point(s):
sudo vi /etc/icecast2/icecast.xml
<!-- You may have multiple <listener> elements -->
<listen-socket>
<port>8000</port>
<shoutcast-mount>/op25</shoutcast-mount>
</listen-socket>
5. Configure op25
-----------------
Set up rx.py command line options, trunk.tsv, meta.json and other files necessary to
make a working instance of op25. Edit op25.liq to configure local sound options and/or
streaming to icecast server.
6. Run op25 and liquidsoap
--------------------------
Terminal #1:
cd ~/op25/op25/gr-op25_repeater/apps
./rx.py --nocrypt --args "rtl=0" --gains 'lna:36' -S 57600 -q 0 -d 0 -v 1 -2 -T trunk.tsv -V -w -M meta.json 2> stderr.2
Terminal #2:
cd ~/op25/op25/gr-op25_repeater/apps
./op25.liq
Terminal #3: (optional log window)
cd ~/op25/op25/gr-op25_repeater/apps
tail -f stderr.2
7. Making liquidsoap and op25 start automatically at boot
---------------------------------------------------------
Automatically starting liquidsoap and op25 at boot time is best handled using
the systemd services manager "systemctl". Two service scripts are required, and
although examples are provided, these should best be edited/customized to match
your exact environment. As written they assume /home/pi is the home directory
which may or may not be the case...
Another factor to consider is that op25 should only be auto-started at boot
time when it has been configured for the http terminal type. Auto-starting
the default curses terminal is not going to be successful.
First copy the two service files into /etc/systemd/system:
sudo cp ~/op25/op25/gr-op25_repeater/apps/op25-liq.service /etc/systemd/system
sudo cp ~/op25/op25/gr-op25_repeater/apps/op25-rx.service /etc/systemd/system
Next enable and then start the two services:
sudo systemctl enable op25-liq op25-rx
sudo systemctl start op25-liq op25-rx
You can subsequently stop the services by issuing the following command:
systemctl stop op25-rx
or
systemctl stop op25-rx op25-liq
8. Icecast2 low-latency setups (optional)
---------------------------------------
Buffering may cause the stream to lag behind the metadata.
To decrease latency for low-latency environments, such as
highspeed networks, edit /etc/icecast2/icecast.xml to
disable Icecast2 burst-on-connect and reduce burst-size.
sudo vi /etc/icecast2/icecast.xml
<!-- If enabled, this will provide a burst of data when a client
first connects, thereby significantly reducing the startup
time for listeners that do substantial buffering. However,
it also significantly increases latency between the source
client and listening client. For low-latency setups, you
might want to disable this. -->
<burst-on-connect>0</burst-on-connect>
<!-- same as burst-on-connect, but this allows for being more
specific on how much to burst. Most people won't need to
change from the default 64k. Applies to all mountpoints -->
<burst-size>0</burst-size>