This repository has been archived by the owner on Feb 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* aubuf: add a started flag If the reader thread starts late, the buffer should not be filled over the min value. * docs: add aubuf plots for multicast
- Loading branch information
Showing
6 changed files
with
163 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ ajb.eps | |
underrun.dat | ||
plots | ||
ajb.json | ||
mcplots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#!/bin/bash | ||
|
||
target=192.168.110.192 | ||
netif=eno1 | ||
#target=10.1.0.215 | ||
#netif=enp8s0 | ||
#once=true | ||
|
||
function init_jitter () { | ||
sudo ip link add ifb1 type ifb || : | ||
sudo ip link set ifb1 up | ||
sudo tc qdisc add dev $netif handle ffff: ingress | ||
sudo tc filter add dev $netif parent ffff: u32 match u32 0 0 action mirred egress redirect dev ifb1 | ||
} | ||
|
||
|
||
function enable_jitter() { | ||
echo "ENABLE JITTER ..." | ||
sudo tc qdisc add dev ifb1 root netem delay 100ms 50ms | ||
} | ||
|
||
|
||
function disable_jitter() { | ||
echo "DISABLE JITTER ..." | ||
sudo tc qdisc del dev ifb1 root | ||
} | ||
|
||
|
||
function cleanup_jitter() { | ||
echo "CLEANUP jitter" | ||
sudo tc filter delete dev $netif parent ffff: | ||
sudo tc qdisc delete dev $netif ingress | ||
sudo ip link set ifb1 down | ||
sudo ip link delete ifb1 | ||
} | ||
|
||
|
||
if ! which jq; then | ||
echo "Install jq" | ||
exit 1 | ||
fi | ||
|
||
|
||
trap "disable_jitter; cleanup_jitter; killall -q baresip; kill $tid_fm4" EXIT | ||
|
||
init_jitter | ||
|
||
i=1 | ||
for jbuf in 0 1 3 4; do | ||
for buf in 20 40 60; do | ||
echo "########### jbuf min $jbuf buffer $buf ###############" | ||
|
||
sed -e "s/audio_buffer\s*[0-9]*\-.*/audio_buffer $buf-160/" -i mcconfig/config | ||
sed -e "s/multicast_jbuf_delay\s*[0-9]*\-.*/multicast_jbuf_delay $jbuf-20/" -i mcconfig/config | ||
baresip -f mcconfig > /tmp/b.log 2>&1 & | ||
|
||
sleep 1.5 | ||
|
||
./stream_fm4.sh & | ||
pidfm4=$( pgrep -P $! ) | ||
echo "STARTED STREAM with PID $pidfm4" | ||
|
||
sleep 8 | ||
|
||
enable_jitter | ||
|
||
sleep 8 | ||
disable_jitter | ||
|
||
sleep 16 | ||
|
||
kill $pidfm4 | ||
|
||
echo "/quit" | nc -N localhost 5555 | ||
|
||
sleep 1 | ||
|
||
cat ajb.json | jq -r '.traceEvents[] | select (.ph == "P") | .args.line' > ajb.dat | ||
cat ajb.json | jq -r '.traceEvents[] | select (.ph == "U") | .args.line' > underrun.dat | ||
./ajb.plot | ||
if [ ! -d mcplots ]; then | ||
mkdir mcplots | ||
fi | ||
cp ajb.eps mcplots/jbuf${i}_min${jbuf}_buf_${buf}.eps | ||
i=$(( i+1 )) | ||
|
||
if [ "$once" == "true" ]; then | ||
exit 0 | ||
fi | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<sip:alice@office>;regint=0;ptime=20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#audio_path /usr/local/share/baresip | ||
audio_player pulse, | ||
audio_source pulse, | ||
audio_alert pulse, | ||
audio_level no | ||
audio_buffer 60-160 | ||
audio_buffer_mode adaptive | ||
audio_silence 0.0 | ||
|
||
jitter_buffer_type adaptive | ||
jitter_buffer_delay 0-20 | ||
|
||
module_path /usr/local/lib/baresip/modules | ||
|
||
# UI Modules | ||
module stdio.so | ||
module cons.so | ||
|
||
module g722.so | ||
module g711.so | ||
|
||
module auconv.so | ||
module auresamp.so | ||
|
||
module alsa.so | ||
module pulse.so | ||
module pulse_async.so | ||
|
||
|
||
module_app account.so | ||
module_app menu.so | ||
module_app netroam.so | ||
|
||
|
||
cons_listen 0.0.0.0:5555 # cons - Console UI UDP/TCP sockets | ||
|
||
# Opus codec parameters | ||
opus_bitrate 28000 # 6000-510000 | ||
#opus_stereo yes | ||
#opus_sprop_stereo yes | ||
#opus_cbr no | ||
#opus_inbandfec no | ||
#opus_dtx no | ||
#opus_mirror no | ||
#opus_complexity 10 | ||
#opus_application audio # {voip,audio} | ||
#opus_samplerate 48000 | ||
#opus_packet_loss 10 # 0-100 percent (expected packet loss) | ||
|
||
# Opus Multistream codec parameters | ||
#opus_ms_channels 2 #total channels (2 or 4) | ||
#opus_ms_streams 2 #number of streams | ||
#opus_ms_c_streams 2 #number of coupled streams | ||
|
||
|
||
module_app multicast.so | ||
multicast_jbuf_type adaptive # off, fixed, adaptive | ||
multicast_jbuf_delay 1-20 | ||
multicast_listener 224.0.1.194:5004 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gst-launch-1.0 -q --no-position souphttpsrc location=https://orf-live.ors-shoutcast.at/fm4-q1a ssl-strict=false ! decodebin expose-all-streams=false ! audiorate skip-to-first=true ! audioconvert ! audioresample ! avenc_g722 ! rtpg722pay ! udpsink host=224.0.1.194 port=5004 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters