-
Notifications
You must be signed in to change notification settings - Fork 0
/
Script_DAB+
164 lines (117 loc) · 4.01 KB
/
Script_DAB+
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/bin/bash
echo ...........................................
echo -------------- Dab Mod --------------
echo ...........................................
echo Setting the python lib PATH
export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/bin:/usr/local/bin
# Mod + UHD
FREQ=178352000
DAB_SAMPLE_RATE=3200000
TRANSITION=300000
CUTOFF=600000
GAIN_HF=20
DIGITAL_GAIN=30u
# MUX
DAB_MUX_BR=96
MUX_PROTECTION=3
language=15 # english=9, french=15
# Buffer
BUFFER_MUX=32m
BUFFER_FLUX=300k
# Player
LOOP=1000000000000000000000
# crc_dab+
DAB_BITRATE=${DAB_MUX_BR}
RADIO_FLUX_1=/home/radiog/Documents/MP3/flux-1.mp3
RADIO_NAME_1="Flux-1"
RADIO_label_1="c'est la Radio 1"
RADIO_FLUX_2=/home/radiog/Documents/MP3/flux-2.mp3
RADIO_NAME_2="Flux-2"
RADIO_LABEL_2="c'est la Radio 2"
RADIO_FLUX_3=/home/radiog/Documents/MP3/flux-3.mp3
RADIO_NAME_3="Flux-3"
RADIO_LABEL_3="c'est la Radio 3"
RADIO_FLUX_4=/home/radiog/Documents/MP3/flux-4.mp3
RADIO_NAME_4="Flux-4"
RADIO_LABEL_4="c'est la Radio 4"
RADIO_FLUX_5=/home/radiog/Documents/MP3/flux-5.mp3
RADIO_NAME_5="Flux-5"
RADIO_LABEL_5="c'est la Radio 5"
RADIO_FLUX_6=/home/radiog/Documents/MP3/flux-6.mp3
RADIO_NAME_6="Flux-6"
RADIO_LABEL_6="c'est la Radio 6"
RADIO_FLUX_7=/home/radiog/Documents/MP3/flux-7.mp3
RADIO_NAME_7="Flux-7"
RADIO_LABEL_7="c'est la Radio 7"
RADIO_FLUX_8=/home/radiog/Documents/MP3/flux-8.mp3
RADIO_NAME_8="Flux-8"
RADIO_LABEL_8="c'est la Radio 8"
RADIO_FLUX_9=/home/radiog/Documents/MP3/flux-9.mp3
RADIO_NAME_9="Flux-9"
RADIO_LABEL_9="c'est la Radio 9"
echo KILL session + rm FIFO
killall mpg123
killall toolame
killall CRC-DabMux
killall netcat
killall mbuffer
killall crc-dabmod
kill $(ps aux | grep python /usr/local/bin/coinwap_uhd_full3.py | awk '{ print $2 }')
#kill $(ps aux | grep python /usr/local/bin/simple_sender.py | awk '{ print $2 }')
#killall python /usr/local/bin/coinwap_uhd_full3.py
echo SUP FIFO
rm -f ./fifoer/fifo*
sleep 1
echo Creating FIFO
for id in 1 2 3 4 5 6 7 8 9; do
[ -e fifo$id ] || mkfifo -m 664 fifoer/fifo$id
done
sleep 1
echo playing radios
#for id in 1; do
for id in 1 2 3 4 5 6 7 8 9; do
echo "Reading Radio ${id}"
RADIO_FLUX_STR="RADIO_FLUX_${id}"
RADIO_FLUX=${!RADIO_FLUX_STR}
#RADIO_FLUX=${RADIO_FLUX_1}
FIFO="./fifoer/fifo$id"
echo "using radioflux : ${RADIO_FLUX} and fifo : ${FIFO}"
crc-dabplus -i souphttpsrc://location=${RADIO_FLUX} -g -m -c 2 -b ${DAB_BITRATE} -r 48 -o file:///dev/stdout |mbuffer -m 100k -P 100 >${FIFO} &
#mpg123 -r 48000 --loop ${LOOP} -s ${RADIO_FLUX} |toolame -s 48 -D 4 -b ${TOOLAME_BITRATE} /dev/stdin ${FIFO} &
done
#/dev/stdout |mbuffer -m ${BUFFER_FLUX} -P 25 >
sleep 3
#exit 0
echo starting Dab-mux
CRC-DabMux -L "SDN" \
-F ./fifoer/fifo1 -k -b ${DAB_MUX_BR} -i 1 -p ${MUX_PROTECTION} \
-F ./fifoer/fifo2 -k -b ${DAB_MUX_BR} -i 2 -p ${MUX_PROTECTION} \
-F ./fifoer/fifo3 -k -b ${DAB_MUX_BR} -i 3 -p ${MUX_PROTECTION} \
-F ./fifoer/fifo4 -k -b ${DAB_MUX_BR} -i 4 -p ${MUX_PROTECTION} \
-F ./fifoer/fifo5 -k -b ${DAB_MUX_BR} -i 5 -p ${MUX_PROTECTION} \
-F ./fifoer/fifo6 -k -b ${DAB_MUX_BR} -i 6 -p ${MUX_PROTECTION} \
-F ./fifoer/fifo7 -k -b ${DAB_MUX_BR} -i 7 -p ${MUX_PROTECTION} \
-F ./fifoer/fifo8 -k -b ${DAB_MUX_BR} -i 8 -p ${MUX_PROTECTION} \
-F ./fifoer/fifo9 -k -b ${DAB_MUX_BR} -i 9 -p ${MUX_PROTECTION} \
-S -L ${RADIO_NAME_1} -C -i 1 \
-S -L ${RADIO_NAME_2} -C -i 2 \
-S -L ${RADIO_NAME_3} -C -i 3 \
-S -L ${RADIO_NAME_4} -C -i 4 \
-S -L ${RADIO_NAME_5} -C -i 5 \
-S -L ${RADIO_NAME_6} -C -i 6 \
-S -L ${RADIO_NAME_7} -C -i 7 \
-S -L ${RADIO_NAME_8} -C -i 8 \
-S -L ${RADIO_NAME_9} -C -i 9 \
-O fifo:///dev/stdout|\
crc-dabmod -f -g1 -r${DAB_SAMPLE_RATE} |\
# mbuffer -m ${BUFFER_MUX} -P 25 |\
#python /usr/local/bin/simple_sender.py -f ${FREQ} -r ${DAB_SAMPLE_RATE} --rfgain ${GAIN_HF} --dgain ${DIGITAL_GAIN}
python /usr/local/bin/coinwap_uhd_full3.py -f ${FREQ} -r ${DAB_SAMPLE_RATE} -g ${GAIN_HF} --enable-filter=1
#FREQ=178352000
#DAB_SAMPLE_RATE=3200000
#TRANSITION=300000
#CUTOFF=600000
#GAIN_HF=20
#DIGITAL_GAIN=30u
#exit 0