From 61d57ab75ce1c57708dcd8602574301e70932aca Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 24 Feb 2017 11:49:44 +0100 Subject: Update all sorts of small things --- b100-2048.ini | 4 +- b200-2048.ini | 21 ++++++----- b200-30.72.ini | 9 +++-- b200-sync-zmq.ini | 11 ++++-- edi-test.mux | 21 +++++------ edi/crc.py | 2 +- edi/edidebug.py | 28 ++++++-------- minimal.ini | 2 +- test.ini | 16 +++----- zmq-simul.mux | 109 ++++++++++++++++++++++++++++++------------------------ 10 files changed, 116 insertions(+), 107 deletions(-) diff --git a/b100-2048.ini b/b100-2048.ini index f990a2d..1d3cc44 100644 --- a/b100-2048.ini +++ b/b100-2048.ini @@ -28,7 +28,7 @@ gainmode=2 ; Set to 0 to disable CicEqualiser dac_clk_rate=0 -digital_gain=1.0 +digital_gain=0.8 ; Output sample rate rate=2048000 @@ -65,6 +65,6 @@ behaviour_refclk_lock_lost=crash ; Used for SFN with the UHD output [delaymanagement] -synchronous=1 +synchronous=0 offset=2.0 diff --git a/b200-2048.ini b/b200-2048.ini index 92fe43e..04c9162 100644 --- a/b200-2048.ini +++ b/b200-2048.ini @@ -11,10 +11,11 @@ filename=/dev/stderr [input] transport=file -source=/dev/stdin +source=./zmq-simul.eti +loop=0 ;transport=zeromq ;source=tcp://mpb.li:9100 -loop=0 +;max_frames_queued=400 [modulator] ; Gain mode: 0=FIX, 1=MAX, 2=VAR @@ -22,18 +23,18 @@ gainmode=2 ; Transmission mode ; If not defined, take the mode from ETI -;mode=2 +mode=1 ; Set to 0 to disable CicEqualiser dac_clk_rate=0 -digital_gain=1.0 +digital_gain=0.8 ; Output sample rate rate=2048000 [firfilter] -enabled=1 +enabled=0 filtertapsfile=filter/simplefiltertaps.txt [output] @@ -44,12 +45,10 @@ output=uhd filename=/dev/null [uhdoutput] -;device=master_clock_rate=32768000,type=b100 -;txgain=2 device= -master_clock_rate=20480000 +master_clock_rate=32768000 type=b200 -txgain=45 +txgain=50 ;frequency=234208000 channel=13C @@ -63,8 +62,10 @@ pps_source=none ; possible values: ignore, crash behaviour_refclk_lock_lost=crash +max_gps_holdover_time=300 + ; Used for SFN with the UHD output [delaymanagement] synchronous=0 -offset=0.002 +offset=2.0 diff --git a/b200-30.72.ini b/b200-30.72.ini index be0e204..8442888 100644 --- a/b200-30.72.ini +++ b/b200-30.72.ini @@ -9,6 +9,7 @@ telnetport=2121 syslog=0 filelog=0 filename=/dev/stderr +;trace=./test.trace [input] ;transport=file @@ -53,12 +54,12 @@ filename=/dev/null device= master_clock_rate=32768000 type=b200 -txgain=40 +txgain=60 ;frequency=234208000 channel=13C ; possible values : internal, external, MIMO -refclk_source=gpsdo-ettus +refclk_source=gpsdo ; possible values : none, external, MIMO pps_source=gpsdo @@ -71,9 +72,9 @@ max_gps_holdover_time=600 ; Used for SFN with the UHD output [delaymanagement] -synchronous=1 +synchronous=0 -offset=2.0 +offset=0.8 [tii] enable = 0 diff --git a/b200-sync-zmq.ini b/b200-sync-zmq.ini index 60f6611..2ffaabd 100644 --- a/b200-sync-zmq.ini +++ b/b200-sync-zmq.ini @@ -12,9 +12,11 @@ filename=/dev/stderr [input] ;transport=file ;source=/dev/stdin +;loop=0 transport=zeromq -source=tcp://core.mpb.li:9100 -loop=0 +;source=tcp://core.mpb.li:9100 +source=tcp://localhost:9100 +max_frames_queued=8000 [modulator] ; Gain mode: 0=FIX, 1=MAX, 2=VAR @@ -54,11 +56,14 @@ txgain=45 channel=13C ; possible values : internal, external, MIMO -refclk_source=internal +refclk_source=gpsdo ; possible values : none, external, MIMO pps_source=none +# TRY with 0, to disable the check +max_gps_holdover_time=600 + ; behaviour when external clock reference lock lost ; possible values: ignore, crash behaviour_refclk_lock_lost=crash diff --git a/edi-test.mux b/edi-test.mux index 6d835b7..6f31f3a 100644 --- a/edi-test.mux +++ b/edi-test.mux @@ -11,8 +11,6 @@ general { syslog false writescca false tist false - - new_fig_carousel true } remotecontrol { @@ -130,17 +128,17 @@ outputs { destinations { unicast { - destination "10.31.0.120" + destination "127.0.0.1" ;destination "239.20.64.1" - ;source "192.168.2.10" + source "127.0.0.1" sourceport 15321 } - un_autre { - destination "239.20.64.1" - source "10.31.0.121" - sourceport 15322 - ttl 2 - } + ;un_autre { + ; destination "239.20.64.1" + ; source "10.31.0.121" + ; sourceport 15322 + ; ttl 2 + ;} } port 12002 @@ -149,6 +147,7 @@ outputs { ; Enable the PFT subsystem. If false, AFPackets are sent. enable_pft true + interleave 960 ; Save the packets sent over ethernet to the file ./edi.debug dump false @@ -157,7 +156,7 @@ outputs { verbose false ; optional: what kind of alignment to do in the tagpacket - ;tagpacket_alignment 16 + tagpacket_alignment 16 } } diff --git a/edi/crc.py b/edi/crc.py index ad520fc..0cc3404 100644 --- a/edi/crc.py +++ b/edi/crc.py @@ -37,7 +37,7 @@ crc16tab = [ def crc16(data, l_crc=0xffff): for d in data: - #print("crc 0x{:x} 0x{:x}".format(ord(d), l_crc)) + #print("crc 0x{:02x} 0x{:04x}".format(ord(d), l_crc)) l_crc = (l_crc << 8) ^ crc16tab[(l_crc >> 8) ^ ord(d)] l_crc = l_crc & 0xFFFF diff --git a/edi/edidebug.py b/edi/edidebug.py index c41d9a6..9339bdb 100755 --- a/edi/edidebug.py +++ b/edi/edidebug.py @@ -6,7 +6,7 @@ # # The MIT License (MIT) # -# Copyright (c) 2015 Matthias P. Braendli +# Copyright (c) 2017 Matthias P. Braendli # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -26,7 +26,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -from pprint import pprint import io import os import sys @@ -41,16 +40,17 @@ class Printer: self.indent = 0 def pr(self, s): - print(" " * self.indent + s) + sys.stderr.write(" " * self.indent + s + "\n") def hexpr(self, header, seq): if isinstance(seq, str): seq = bytearray(seq) - print(" " * self.indent + + sys.stderr.write(" " * self.indent + header + " ({}): ".format(len(seq)) + - " ".join("{0:02x}".format(el) for el in seq)) + " ".join("{0:02x}".format(el) for el in seq) + + "\n") def inc(self): self.indent += 1 @@ -134,7 +134,7 @@ class EtiData: # EN 300 799 5.3.6 FL = NST + 1 + FICL + sum(subch['STL'] * 2 for subch in self.stc) - print("********** NST {}, FICL {}, stl {}, sum, {}".format( + p.pr("********** NST {}, FICL {}, stl {}, sum, {}".format( NST, FICL, [subch['STL'] for subch in self.stc], sum(subch['STL'] * 2 for subch in self.stc))) @@ -456,7 +456,7 @@ def decode_af(in_data, is_stream=False): crc_ok = crc_calc == crc if crc_flag and crc_ok: - p.pr("CRC ok") + p.pr("CRC ok 0x{0:04x}".format(crc)) elif crc_flag: p.pr("CRC not ok!") p.pr(" CRC: is 0x{0:04x}, calculated 0x{1:04x}".format(crc, crc_calc)) @@ -483,7 +483,7 @@ def tagitems(tagpacket): # length is in bits, because it's more annoying this way if length % 8 != 0: - print("ASSERTION ERROR: length of tagpacket is not multiple of 8: {}".format(length)) + sys.stderr.write("ASSERTION ERROR: length of tagpacket is not multiple of 8: {}".format(length)) length /= 8 tag_value = tagpacket[i+8:i+8+length] @@ -636,19 +636,15 @@ parser.add_argument('-V','--no-rs-verify', help='Do not verify Reed-Solomon enco cli_args = parser.parse_args() -# Check if configuration exist and is readable -if os.path.isfile(cli_args.edi_file) and os.access(cli_args.edi_file, os.R_OK): - print("Use EDI input file {}".format(cli_args.edi_file)) -else: - print("Configuration file {} is missing or is not readable!".format(cli_args.edi_file)) - sys.exit(1) - filename = cli_args.edi_file edi_fd = BufferedFile(filename) eti_fd = None if cli_args.output: - eti_fd = open(cli_args.output, "wb") + if cli_args.output == "-": + eti_fd = sys.stdout + else: + eti_fd = open(cli_args.output, "wb") num_eti = 0 if cli_args.max_frames: diff --git a/minimal.ini b/minimal.ini index 8f98890..79e48e1 100644 --- a/minimal.ini +++ b/minimal.ini @@ -1,6 +1,6 @@ [input] transport=zeromq -source=tcp://core.mpb.li:9100 +source=tcp://localhost:9100 max_frames_queued=400 [output] diff --git a/test.ini b/test.ini index 9e16aa0..d0d3155 100644 --- a/test.ini +++ b/test.ini @@ -1,7 +1,5 @@ -; Sample configuration file for CRC-DABMOD - [remotecontrol] -telnet=0 +telnet=1 telnetport=2121 [log] @@ -20,8 +18,7 @@ loop=0 ;max_frames_queued=400 [modulator] -; Gain mode: 0=FIX, 1=MAX, 2=VAR -gainmode=2 +gainmode=var ; Transmission mode ; If not defined, take the mode from ETI @@ -36,11 +33,10 @@ digital_gain=1.0 rate=2048000 [firfilter] -enabled=0 -filtertapsfile=filter/simplefiltertaps.txt +enabled=1 +;filtertapsfile=filter/simplefiltertaps.txt [output] -; choose output: possible values: uhd, file output=file [zmqoutput] @@ -48,8 +44,8 @@ listen=tcp://*:9200 socket_type=rep [fileoutput] -filename=ofdm.iq -;filename=/dev/null +;filename=ofdm.iq +filename=/dev/null [uhdoutput] ;frequency=234208000 diff --git a/zmq-simul.mux b/zmq-simul.mux index 4953363..2cfbfca 100644 --- a/zmq-simul.mux +++ b/zmq-simul.mux @@ -10,14 +10,14 @@ general { syslog true writescca false - tist true - - new_fig_carousel true + tist false } remotecontrol { ; enable the remote control server telnetport 12721 + + zmqendpoint tcp://*:12722 } ; Some ensemble parameters @@ -79,6 +79,10 @@ services { clusters "1,255" } } + srv-prbs { + label "prbs" + id 0x4041 + } } ; The subchannels are defined in the corresponding section. @@ -102,21 +106,22 @@ subchannels { } sub-label { type audio - inputfile "/home/bram/dab/mmbtools-aux/fip-j-ok.mp2" + inputfile "sti-rtp://:32010" + ;inputfile "/home/bram/dab/mmbtools-aux/fip-j-ok.mp2" ;inputfile "tcp://*:9002" - zmq-buffer 40 - zmq-prebuffering 20 + ;zmq-buffer 40 + ;zmq-prebuffering 20 bitrate 128 id 4 protection 3 } -; sub-data { -; type data -; inputfile "udp://:9003" -; bitrate 16 -; id 5 -; protection 3 -; } + sub-prbs { + type data + inputfile "prbs://" + bitrate 16 + id 5 + protection 3 + } } ; For now, each component links one service to one subchannel @@ -136,53 +141,59 @@ components { service srv-label subchannel sub-label } + + comp-prbs { + service srv-prbs + subchannel sub-prbs + } } ; A list of outputs, in the format ; unique-id "uri" outputs { ;stdout "fifo:///dev/stdout?type=raw" + nullfile "file:///dev/null?type=raw" ;thefile "file://./zmq-simul.eti?type=raw" - ;zmq "zmq+tcp://*:9100" + zmq "zmq+tcp://*:9100" ; This throttles muxing down to nominal rate throttle "simul://" ;net_udp "udp://237.10.0.230:7000?src=10.0.1.125,ttl=10" - ;net_tcp "tcp://0.0.0.0:31000" - -; edi { -; fec 0 -; chunk_len 200 -; -; destinations { -; multicast { -; destination "239.20.64.1" -; ;source "192.168.2.10" -; source "192.168.0.100" -; sourceport 52321 -; ttl 1 -; } -; ;unicast { -; ;destination "192.168.2.2" -; ;} -; } -; -; port 52002 -; -; ; EDI uses the UDP protocol -; -; ; Enable the PFT subsystem. If false, AFPackets are sent. -; enable_pft true -; -; ; Save the packets sent over ethernet to the file ./edi.debug -; dump false -; -; ; show more debugging info -; verbose false -; -; ; optional: what kind of alignment to do in the tagpacket -; tagpacket_alignment 16 -; } + net_tcp "tcp://0.0.0.0:9200" + + edi { + fec 2 + chunk_len 207 + + destinations { + multicast { + destination "239.20.64.1" + ;source "192.168.2.10" + ;source "192.168.0.100" + sourceport 52321 + ttl 1 + } + ;unicast { + ;destination "192.168.2.2" + ;} + } + + port 12000 + + ; EDI uses the UDP protocol + + ; Enable the PFT subsystem. If false, AFPackets are sent. + enable_pft true + + ; Save the packets sent over ethernet to the file ./edi.debug + dump false + + ; show more debugging info + verbose false + + ; optional: what kind of alignment to do in the tagpacket + tagpacket_alignment 16 + } } -- cgit v1.2.3