diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-02-22 16:28:37 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-02-22 16:29:07 +0100 |
commit | 220549b9980f1e15c1299084fb06a0df4ab5f2cf (patch) | |
tree | 65fec643551902f5b9d68fed22224a487d273d0b | |
parent | 26065b4193006401f78a4afdf4e19cbd1db6c593 (diff) | |
download | dabmux-220549b9980f1e15c1299084fb06a0df4ab5f2cf.tar.gz dabmux-220549b9980f1e15c1299084fb06a0df4ab5f2cf.tar.bz2 dabmux-220549b9980f1e15c1299084fb06a0df4ab5f2cf.zip |
Update configuration and compilation for new EDI UDP packet interleaver
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | doc/advanced.mux | 12 | ||||
-rw-r--r-- | src/DabMux.cpp | 17 | ||||
-rw-r--r-- | src/zmq2edi/zmq2edi.cpp | 12 |
4 files changed, 22 insertions, 23 deletions
diff --git a/Makefile.am b/Makefile.am index fc7f64a..cbffd95 100644 --- a/Makefile.am +++ b/Makefile.am @@ -160,8 +160,6 @@ odr_dabmux_SOURCES =src/DabMux.cpp \ lib/edioutput/AFPacket.cpp \ lib/edioutput/AFPacket.h \ lib/edioutput/EDIConfig.h \ - lib/edioutput/Interleaver.cpp \ - lib/edioutput/Interleaver.h \ lib/edioutput/PFT.cpp \ lib/edioutput/PFT.h \ lib/edioutput/TagItems.cpp \ @@ -208,8 +206,6 @@ odr_zmq2edi_SOURCES = src/zmq2edi/zmq2edi.cpp \ lib/edioutput/AFPacket.cpp \ lib/edioutput/AFPacket.h \ lib/edioutput/EDIConfig.h \ - lib/edioutput/Interleaver.cpp \ - lib/edioutput/Interleaver.h \ lib/edioutput/PFT.cpp \ lib/edioutput/PFT.h \ lib/edioutput/TagItems.cpp \ diff --git a/doc/advanced.mux b/doc/advanced.mux index 3aa3a22..16c9bd2 100644 --- a/doc/advanced.mux +++ b/doc/advanced.mux @@ -440,12 +440,16 @@ outputs { ; Transportation". fec 2 - ; Interleave fragments from several ETI frames so as to reduce the + ; Spread and interleave fragments from several EDI frames so as to reduce the ; probability of errors when several UDP packets are lost in bursts. ; This comes at the cost of larger overall latency between multiplexing - ; and modulation. This latency is given in milliseconds, and rounded - ; to nearest multiple of 24ms. Set to 0 to disable the interleaver. - interleave 0 + ; and modulation. + ; + ; Configure the packet spreader/interleaver through a percentage: + ; 0% send all fragments at once, + ; 100% spread over 24ms, + ; >100% spread and interleave. Default 95% + packet_spread 95 ; Length of a RS chunk, can be overridden ;default=207 diff --git a/src/DabMux.cpp b/src/DabMux.cpp index 4265412..70eee69 100644 --- a/src/DabMux.cpp +++ b/src/DabMux.cpp @@ -362,18 +362,17 @@ int main(int argc, char *argv[]) edi_conf.fec = pt_edi.get<unsigned int>("fec", 3); edi_conf.chunk_len = pt_edi.get<unsigned int>("chunk_len", 207); - double interleave_ms = pt_edi.get<double>("interleave", 0); - if (interleave_ms != 0.0) { - if (interleave_ms < 0) { - throw runtime_error("EDI output: negative interleave value is invalid."); + int spread_percent = pt_edi.get<int>("packet_spread", 95); + if (spread_percent != 0) { + if (spread_percent < 0) { + throw std::runtime_error("EDI output: negative packet_spread value is invalid."); } - auto latency_rounded = lround(interleave_ms / 24.0); - if (latency_rounded * 24 > 30000) { - throw runtime_error("EDI output: interleaving set for more than 30 seconds!"); - } + edi_conf.fragment_spreading_factor = (double)spread_percent / 100.0; - edi_conf.latency_frames = latency_rounded; + if (edi_conf.fragment_spreading_factor > 30000) { + throw std::runtime_error("EDI output: interleaving set for more than 30 seconds!"); + } } edi_conf.tagpacket_alignment = pt_edi.get<unsigned int>("tagpacket_alignment", 8); diff --git a/src/zmq2edi/zmq2edi.cpp b/src/zmq2edi/zmq2edi.cpp index 614723b..bd5a3ae 100644 --- a/src/zmq2edi/zmq2edi.cpp +++ b/src/zmq2edi/zmq2edi.cpp @@ -64,7 +64,7 @@ static void usage() cerr << " -x Drop frames where for which the wait time would be negative, i.e. frames that arrived too late." << endl; cerr << " -P Disable PFT and send AFPackets." << endl; cerr << " -f <fec> Set the FEC." << endl; - cerr << " -i <interleave> Configure the interleaver with given interleave percentage: 0% send all fragments at once, 100% spread over 24ms, >100% spread and interleave. Default 95%\n"; + cerr << " -i <spread> Configure the UDP packet spread/interleaver with given percentage: 0% send all fragments at once, 100% spread over 24ms, >100% spread and interleave. Default 95%\n"; cerr << " -D Dump the EDI to edi.debug file." << endl; cerr << " -v Enables verbose mode." << endl; cerr << " -a <alignement> Set the alignment of the TAG Packet (default 8)." << endl; @@ -273,13 +273,13 @@ int start(int argc, char **argv) break; case 'i': { - int interleave_percent = std::stoi(optarg); - if (interleave_percent != 0) { - if (interleave_percent < 0) { - throw std::runtime_error("EDI output: negative interleave value is invalid."); + int spread_percent = std::stoi(optarg); + if (spread_percent != 0) { + if (spread_percent < 0) { + throw std::runtime_error("EDI output: negative spread value is invalid."); } - edi_conf.fragment_spreading_factor = (double)interleave_percent / 100.0; + edi_conf.fragment_spreading_factor = (double)spread_percent / 100.0; if (edi_conf.fragment_spreading_factor > 30000) { throw std::runtime_error("EDI output: interleaving set for more than 30 seconds!"); } |