summaryrefslogtreecommitdiffstats
path: root/doc/advanced.mux
blob: c3e216a4293908a9a0b8694146647113d781da68 (plain)
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
; This is an advanced configuration example for ODR-DabMux,
; that documents more options that the simple example.mux

; More information about the usage of the tools is available
; in the guide, which can be found on the
; www.opendigitalradio.org website.
;
; The format is called INFO format, and defined by boost property_tree:
; http://www.boost.org/doc/libs/1_41_0/doc/html/boost_propertytree/parsers.html#boost_propertytree.parsers.info_parser

; It consists of six mandatory sections, whose relative order in this
; file are of no importance.

; The general section defines global multiplex parameters.
general {
    ; the DAB Transmission mode (values 1-4 accepted)
    dabmode 1

    ; the number of ETI frames to generate (set to 0 to get an unlimited number)
    nbframes 10

    ; boolean fileds can accept either false or true as values:

    ; Enable logging to syslog
    syslog false

    ; Write the SCCA field useful for the Factum ETI analyser
    writescca false

    ; Enable timestamp definition necessary for SFN
    ; This also enables time encoding using the MNSC.
    tist false

    ; The management server is a simple TCP server that can present
    ; statistics data (buffers, overruns, underruns, etc)
    ; which can then be graphed a tool like Munin
    ; The doc/stats_dabmux_multi.py tool is a suitable
    ; plugin for that.
    ; If the port is zero, or the line commented, the server
    ; is not started.
    managementport 12720
}

remotecontrol {
    ; enable the telnet remote control server on the given port
    ; This server allows you to read and define parameters that
    ; some features export. It is only accessible from localhost.
    ; Set the port to 0 to disable the server
    telnetport 12721

    ; the remote control server makes use of the unique identifiers
    ; for the subchannels, services and components. Make sure you
    ; chose them so that you can identify them.
}

; Some ensemble parameters
ensemble {
    id 0x4fff ; you can also use decimal if you want
    ecc 0xec ; Extended Country Code

    local-time-offset auto  ; autmatically calculate from system local time
                            ; or
    ;local-time-offset 1    ; in hours, supports half-hour offsets

    international-table 1 ; See TS 101 756 clause 5.7
                          ; 1 corresponds to the PTy used in RDS
                          ; 2 corresponds to program types used in north america

    ; all labels are maximum 16 characters in length
    label "OpenDigitalRadio"
    ; The short label is built from the label by erasing letters, and cannot
    ; be longer than 8 characters. If omitted, it will be truncated from the
    ; label
    shortlabel "ODR"

    ; Announcement settings for FIG0/19.
    announcements {
        test_announcement {
            cluster 1
            flags {
                Traffic true
            }

            subchannel sub-fu
        }
    }
}

; Definition of DAB services
services {
    ; Each service has it's own unique identifier, that is
    ; used throughout the configuration file and for the RC.
    srv-fu {
        id 0x8daa
        label "Funk"
        shortlabel "Fu"
        pty 0
        language 0
        ; also supports id

        ; List of announcement switching flags signalled in FIG 0/18
        ; This lists all possible announcements. If one is left out, it is disabled.
        announcements {
            Alarm false
            Traffic true
            Travel false
            Warning false
            News false
            Weather false
            Event false
            Special false
            ProgrammeInfo false
            Sports false
            Finance false

            ; a comma separated list of clusters in which the service belongs to
            clusters "1,2"
        }
    }
    srv-lu {
        id 0x8dab
        label "Luschtig"
        ; pty, language, shortlabel and id can be omitted, and will take default values
    }
    srv-ri {
        id 0x8dac
        label "rick"
    }

}

; The subchannels are defined in the corresponding section.
; supported types are : audio, data, enhancedpacket,
;                       dabplus, packet
;
; Type 'packet' expects to receive data in the format described
; in EN 300 401 Clause 3.5.2.
;
; 'enhancedpacket' mode will calculate FEC for MSC packet mode
; as described in EN 300 401 Clause 5.3.5.
;
; 'data' will read from the source and write it unmodified into
; the MSC.
subchannels {
    sub-fu {
        type audio
        ; example file input
        inputfile "funk.mp2"
        nonblock false
        bitrate 128
        id 10

        ; type audio subchannels automatically use
        ; UEP, unless the bitrate is 8, 16, 24, 40 or 144kbit/s
        ; (EN 300 401 Clause 6.2.1)
        ; this can be overridden with the option protection-profile
        protection-profile EEP_A
        ; supported options: UEP (use only for type audio!)
        ;                    EEP_A (for all bitrates)
        ;                    EEP_B (bitrates multiple of 32kbit/s)

        ; Set the protection level, possible values depend
        ; on the protection profile:
        ; UEP profile: 1 to 5; EEP profiles: 1 to 4
        protection 4
    }
    sub-lu {
        type dabplus
        ; EXPERIMENTAL!
        ; Receive STI-D(LI) carried in STI(PI, X) inside RTP using UDP.
        ; This is intended to be compatible with AVT audio encoders.
        ; EXPERIMENTAL!
        inputfile "sti-rtp://127.0.0.1:32010"
        bitrate 96
        id 3
        protection 3
    }
    sub-ri {
        type dabplus
        ; example file input
        ;inputfile "rick.dabp"
        ; example zmq input:
        ; Accepts connections to port 9000 from any interface.
        ; Use ODR-AudioEnc as encoder
        inputfile "tcp://*:9000"
        bitrate 96
        id 1
        protection 1

        ; ZMQ specific options, mandatory:

        ; Maximum size of input buffer, in AAC frames (24ms)
        ; when this buffer size is reached, some frames will be
        ; discarded to get the size again below this value.
        ; As the present implementation discards entire AAC superframes,
        ; (5 frames = 120ms) the effect will clearly be audible.
        zmq-buffer 40

        ; At startup or after an underrun, the buffer is filled to this
        ; amount of AAC frames before streaming starts.
        zmq-prebuffering 20

        ; In an ideal scenario, where the input rate exactly corresponds
        ; to the rate at which the frames are consumed by dabmux, you
        ; see the buffer level staying around the zmq-prebuffering value.
        ; Network latency jitter can make it temporarily go lower or higher.
        ; Encoder clock drift will make the buffer either slowly fill or
        ; empty, which will create intermittent glitches.


        ; the ZMQ inputs support encryption using the CURVE method.
        ; The multiplexer must have a public and a private key, which
        ; can be shared among several zmq inputs.
        ;
        ; each encoder also has a public and private key, and the
        ; encoder *public* key has to be known to the multiplexer.
        ; Using this system, the multiplexer can be sure that
        ; only the encoder possessing the right secret key can
        ; connect here. This inhibits third parties to hijack the
        ; input.

        ; by default, it is disabled, set encryption to 1 to enable
        encryption true

        ; the multiplexer key pair. Keep these secret.
        secret-key "keys/mux.sec"
        public-key "keys/mux.pub"

        ; The public key from the encoder. Only the encoder you want
        ; to accept must know the corresponding secret key.
        encoder-key "keys/encoder1.pub"

        ; key pairs can be generated using the zmqinput-keygen tool.
    }

    sub-ri2 {
        type audio
        ; for audio types, you can use the ZeroMQ input (if compiled in)
        ; with the following configuration in combination with
        ; Toolame-DAB
        inputfile "tcp://*:9001"
        bitrate 96
        id 1
        protection 1

        ; The options are the same as for dabplus
        zmq-buffer 40
        zmq-prebuffering 20
    }

    ; 'prbs' will generate a pseudorandom bit sequence according to
    ; ETS 300 799 Clause G.2.1. This is useful for testing purposes and
    ; measurement of bit error rate.
    sub-prbs {
       type data

       ; Use the default PRBS polynomial.
       inputfile "prbs://"

       ; To use another polynomial, set it in the url as hexadecimal
       ; The default polynomial is G(x) = x^20 + x^17 + 1, represented as
       ; (1 << 20) + (1 << 17) + (1 << 0) = 0x120001
       ;inputuri "prbs://:0x120001

       bitrate 16
       id 5
       protection 3
   }
}

; For now, each component links one service to one subchannel
components {
    ; the component unique identifiers are used for the RC.
    comp-fu {
        ; specifies audio -or- packet type, defaults to zero when not given
        ; audio: foreground=0, background=1, multi-channel=2
        ; data: unspecified=0, TMC=1, EWS=2, ITTS=3, paging=4, TDC=5, IP=59, MOT=60, proprietary=61
        type 0

        ; According to specification, you should not define component labels if
        ; the service is only used in one component. The service label is sufficient
        ; in that case.
        ;label "funk"
        ;shortlabel "fu"
        service srv-fu
        subchannel sub-fu

        ; for audio components, the field
        figtype 0x2
        ; defines the User Application Type according to TS 101 756 Table 16:
        ; 0x2   : MOT Slideshow
        ; 0x3   : MOT Broadcast Web Site
        ; 0x4   : TPEG
        ; 0x5   : DGPS
        ; 0x6   : TMC
        ; 0x7   : EPG
        ; 0x8   : DAB Java
        ; 0x44a : Journaline
        ; If not defined, the FIG 0/13 is not transmitted for this component

        ; for packet components, the fields
        ; "user application type in FIG 0/13 for packet mode"
        ;figtype
        ; and the packet address (mandatory)
        ;address
        ; are supported, with the same syntax as in the manpage.
        ; FIG 0/13 is only transmitted when figtype is defined.
        ; The -d option on the command line is:
        ;datagroup (true|false)
        ; and defaults to false. You should normally set
        ;datagroup true
        ; if your packet mode subchannel is tranferring an MOT application such
        ; as EPG or Slideshow.
    }

    ; If a service is used in more than one component, the primary component has to
    ; be placed above the secondary component(s) to ensure that the SCIdS field of FIG0/8
    ; is zero for the primary service component. (New in EN 300 401 V2.1.1)

    comp-lu {
        service srv-lu
        subchannel sub-lu
        figtype 0x2
    }

    comp-ri {
        service srv-ri
        subchannel sub-ri
        figtype 0x2
    }
}

; A list of outputs, in the format
; unique-id "uri"
outputs {
    ; The unique-id can be used by the remote control or the statistics server
    ; to identify the output

    ;supported output types for file and fifo outputs are
    ; raw, framed and streamed
    ;
    ; Please see doc/dab_output_formats.txt
    stdout "fifo:///dev/stdout?type=raw"

    ; Legacy format for ZeroMQ output example. See example.mux
    ; for newer format.
    ;zmq  "zmq+tcp://*:9100"

    ; Throttle output to real-time (one ETI frame every 24ms)
    ;throttle "simul://"

    ; Important! For real-time operation, you need to have exactly one
    ; output that applies back-pressure to ODR-DabMux, otherwise it will run
    ; at the highest possible rate on your system!
    ;
    ; For an output to a pipe, the data consumer at the other end of the pipe
    ; will dictate the multiplexing rate to ODR-DabMux.
    ;
    ; If you use the zmq or EDI outputs, you must also enable a simul:// output!

    ; The edi output has a different syntax
    edi {
        ; EDI uses the UDP protocol. This implementation of EDI does not support
        ; EDI Packet Resend.
        ;
        ; When both EDI and TIST are enabled, ODR-DabMod will download leap-second
        ; information from the IETF website, and cache it to the file
        ; /tmp/odr-dabmux-leap-seconds.cache
        destinations {
            ; The names you give to the destinations have no meaning,
            ; but have to be unique. You can give them meaningful names to help
            ; you identify the outputs.
            example_unicast {
                ; example for unicast EDI over UDP
                ; for unicast EDI, do not set source
                destination "192.168.23.23"
                sourceport  13000
            }
            example_multicast {
                ; example for multicast EDI, the source IP is required
                ; so that the data is sent on the correct ethernet interface
                destination "232.20.10.1"
                source      "192.168.0.50"
                ; The multicast TTL has to be adapted according to your network
                ttl 1

                sourceport  13000
            }

            ; EDI over TCP is not supported
        }

        ; The settings below apply to all destinations
        ; The destination port cannot be set independently for
        ; different outputs because it is encoded in the transport
        ; header of the PFT layer.
        port        12000

        ; Enable the PFT subsystem. If false, AFPackets are sent.
        enable_pft  true

        ; How many lost fragments can be recovered by Reed-Solomon
        ; If set to 0, the PFT subsystem will only do Fragmentation and
        ; Transport, but no Reed Solomon.
        ; See ETSI TS 102 821, Clause 7 "PFT Layer", Figure 10. ODR-DabMux
        ; supports "Fragmentation and Transportation" and "Reed-Solomon and
        ; Transportation".
        fec         2

        ; Interleave fragments from several ETI 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

        ; Length of a RS chunk, can be overriden
        ;default=207
        ;chunk_len   207

        ; Save the packets sent over ethernet to the file ./edi.debug
        dump        false

        ; show more debugging info
        verbose     false

        ; (optional) set the kind of alignment to use in TAG Packets
        ; 0: no padding
        ; 8: pad to eight bytes (default)
        ; above 8: insert *dmy TAG Item to pad to given size in bytes
        ;tagpacket_alignment 8
    }

    ; Other outputs:
    ; TCP listen on port
    ;net "tcp://host:port"
    ; UDP send to host:port, simple example for unicast
    ;net_udp "udp://host:port"
    ; example with source and TTL specification for multicast
    ;net_udp "udp://237.10.0.230:7000?src=10.0.1.125,ttl=1"
    ; RAW (for farsync ETI card)
    ;farsync "raw://device"
}