Difference between revisions of "ODR-DabMux"

From OpenDigitalRadio
Jump to navigationJump to search
Line 1: Line 1:
CRC-DabMux is the free open source [[DAB multiplexing|DAB Multiplexer]] developed by Communication Research Center (CRC) from Canada. It is used in command line.
+
CRC-DabMux is the free open source [[DAB multiplexing|DAB Multiplexer]] developed by Communication Research Center (CRC) from Canada. It is a command line tool.
  
===More information===
+
CRC have stopped releasing new versions, and the development now continues on [http://github.com/mpbraendli GitHub] with releases available on http://mpb.li
 +
 
 +
==More information==
  
 
Description can be found on http://mmbtools.crc.ca/content/view/39/65/
 
Description can be found on http://mmbtools.crc.ca/content/view/39/65/
  
[http://mmbtools.crc.ca/component/option,com_docman/task,doc_download/gid,25/ Source code is now released] (since September 2008).
+
The last CRC version published is [http://mmbtools.crc.ca/component/option,com_docman/task,doc_download/gid,33/ version 0.3.0.4]
 +
 
 +
==Build information for CRC-DABMUX-0.3.0.4-mpb==
 +
 
 +
 
 +
 
 +
===Prerequisites===
 +
 
 +
You will need boost at least version 1.42. The one from your distribution is probably fine, and if you have installed GNURadio or UHD, you will already have it.
 +
 
 +
If you want to use the zeromq inputs or outputs, you need a recent (4.0.3 is best) version of [http://zeromq.org/ ZeroMQ]. It is probably preferred to install it from source:
 +
 
 +
wget http://download.zeromq.org/zeromq-4.0.3.tar.gz
 +
cd zeromq-4.0.3
 +
./configure
 +
make
 +
sudo make install
 +
 
 +
This will install it into /usr/local
 +
 
 +
CRC-DabMux also depends on [http://www.ka9q.net/code/fec/ libfec from Phil Karn]. On 64-bit machines, the original libfec doesn't compile (" fec.h:267: Error: bad register name `%dil' "). A patched version that compiles on x86_64 (and even on ARM) is available [https://github.com/Opendigitalradio/ka9q-fec/archive/master.zip on GitHub (.zip)]
  
There exists a modified version with more features by [[User:hb9egm|mpb]] on http://github.com/mpbraendli
 
  
===Build information===
+
===Compilation===
 +
Once the prerequisites are installed, do
 +
./configure --with-debug-malloc=no --disable-debug --enable-input-zeromq --enable-output-zeromq
 +
make
 +
sudo make install
  
When building from the source code, be careful to disable debugging, otherwise there will be lot of wasted CPU usage:
+
 
 +
or, if you don't have zeromq:
 
  ./configure --with-debug-malloc=no --disable-debug
 
  ./configure --with-debug-malloc=no --disable-debug
 +
make
 +
sudo make install
  
CRC-DabMux depend on [http://www.ka9q.net/code/fec/ libfec from Phil Karn]. From recent versions of Ubuntu (10.04) or 64bits, libfec has a compilation error (" fec.h:267: Error: bad register name `%dil' ").
+
then you can execute, as a test
 +
crc-dabmux -h
  
Pascal Charest, from CRC, has written a workaround for it that you can find on libfec section of [http://mmbtools.crc.ca/content/view/39/65/ CRC-DABMUX page].
+
When building, be careful to disable debugging, otherwise there will be lot of wasted CPU usage.
 +
 
 +
 
 +
===Compilation from the git repository===
 +
If you cloned the git repository, you might need to call
 +
./bootstrap.sh
 +
to re-generate the autotools scripts and generate the ./configure script
 +
 
 +
After that, it's the same as above
  
Here's a workaround detail, on line 267 from fec.h:
 
Replace
 
__asm__ __volatile__ ("test %1,%1;setpo %0" : "=g"(x) : "r" (x));
 
by
 
__asm__ __volatile__ ("test %1,%1;setpo %0" : "=q"(x) : "q" (x));
 
  
 
===Patch to increase page size===
 
===Patch to increase page size===
Line 46: Line 78:
 
       ReleaseSemaphore(data->semBuffer, 1, NULL);
 
       ReleaseSemaphore(data->semBuffer, 1, NULL);
 
   #else
 
   #else
 
===CRC-DabMux Man page===
 
 
NAME
 
  CRC-DabMux - A software DAB multiplexer
 
 
SYNOPSYS
 
  CRC-DabMux [ensemble] [subchannel1 subchannel2 ...] [service1 component1 [component2 ...] service2 ...] [output1 ...] [-h] [-m mode] [-n nbFrames] [-o] [-V] [-z]
 
 
  Where ensemble = [-i ensembleId] [-L label] [-l sLabel]
 
 
  Where subchannel = -(A | B | D | E | F | M | P | T) inputName [-b bitrate] [-i subchannelId] [-k] [-p protection]
 
 
  Where service = -S [-g language] [-i serviceId] [-L label] [-l sLabel] [-y PTy]
 
 
  Where component = -C [-a address] [-d] [-f figType] [-i subchannelId] [-L label] [-l sLabel] [-t type]
 
 
DESCRIPTION
 
  CRC-DabMux  is  a  software  multiplexer  that generates an ETI stream from
 
  audio and data streams. Because of  its  software  based  architecture,
 
  many  typical DAB services can be generated and multiplexed on a single
 
  PC platform with live or pre-recorded sources.
 
 
  A DAB multiplex configuration is composed of one ensemble. An  ensemble
 
  is  the entity that receivers tune to and process. An ensemble contains
 
  several services. A service is  the  listener-selectable  output.  Each
 
  service  contains  one mandatory service component which is called pri-
 
  mary component. An audio primary component  define  a  program  service
 
  while  a data primary component define a data service. Service can con-
 
  tain additional components which are called secondary components. Maxi-
 
  mum  total  number  of components is 12 for program services and 11 for
 
  data services. A service component is a link to one subchannel (of Fast
 
  Information  Data  Channel).  A  subchannel  is the physical space used
 
  within the common interleaved frame.
 
 
  __________________________________________________
 
  |                  CRC-Ensemble                  |  ENSEMBLE
 
  |__________________________________________________|
 
          |                |                |
 
          |                |                |
 
  _______V______    _______V______    _______V______
 
  | CRC-Service1 |  | CRC-Service2 |  | CRC-Service3 |  SERVICES
 
  |______________|  |______________|  |______________|
 
    |        |        |        | |______        |
 
    |        |        |        |        |        |
 
  __V__    __V__    __V__    __V__    __V__    __V__
 
  | SC1 |  | SC2 |  | SC3 |  | SC4 |  | SC5 |  | SC6 |  SERVICE
 
  |_____|  |_____|  |_____|  |_____|  |_____|  |_____|  COMPONENTS
 
    |        |  _____|        |        |    ____|
 
    |        |  |              |        |  |
 
  __V________V__V______________V________V___V_______  COMMON
 
  | SubCh1 | SubCh9 |  ...  | SubCh3 | SubCh60 | ... |  INTERLEAVED
 
  |________|________|_______|________|_________|_____|  FRAME
 
  Figure 1: An example of a DAB multiplex configuration
 
 
GENERAL OPTIONS
 
  -h                  : get this help
 
  -m                  : DAB mode (default: 2)
 
  -n nbFrames          : number of frames to produce
 
  -o                  : turn on TCP log on port 12222
 
  -V                  : print version information and exit
 
  -z                  : write SCCA field for Factum ETI analyzer
 
 
INPUT OPTIONS
 
  -A                  : set audio service
 
  -A                  : set CRC-Bridge data service
 
  -D                  : set data service
 
  -E                  : set enhanced packet service
 
  -F                  : set DAB+ service
 
  -M                  : set DMB service
 
  -P                  : set packet service
 
  -T                  : set test service
 
  inputName<n>        : name of file for audio and packet service and Udp input address for data service ([address]:port)
 
  -a                  : packet address (default: 0x200 (512))
 
  -b bitrate<n>        : bitrate (in kbits/s) of the subchannel (default: audio 1st frame, data 384, packet 32)
 
  -d                  : turn on datagroups in packet mode
 
  -f figType          : user application type in FIG 0/13 for packet mode
 
  -g language          : Primary service component language: english=9, french=15
 
  -i id<n>            : service|subchannel|serviceComponent id <n> (default: <n>)
 
  -k                  : set non-blocking file input (audio and packet only)
 
  -L label<n>          : label of service <n> (default: CRC-Audio<n>)
 
  -l sLabel<n>        : short label flag of service <n> (default: 0xf040)
 
  -p protection<n>    : protection level (default: 3)
 
  -t type              : audio/data service component type (default: 0)
 
                        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
 
  -y PTy              : Primary service component program type international code
 
 
OUTPUT OPTIONS
 
  -O output            : name of the output in format scheme://[address][:port][/name]
 
                        where scheme is (raw|udp|tcp|file|fifo|simul)
 
  
  
 +
See the manpage for more info:
 
*[[CRC-DabMux man page]]
 
*[[CRC-DabMux man page]]

Revision as of 10:58, 31 January 2014

CRC-DabMux is the free open source DAB Multiplexer developed by Communication Research Center (CRC) from Canada. It is a command line tool.

CRC have stopped releasing new versions, and the development now continues on GitHub with releases available on http://mpb.li

More information

Description can be found on http://mmbtools.crc.ca/content/view/39/65/

The last CRC version published is version 0.3.0.4

Build information for CRC-DABMUX-0.3.0.4-mpb

Prerequisites

You will need boost at least version 1.42. The one from your distribution is probably fine, and if you have installed GNURadio or UHD, you will already have it.

If you want to use the zeromq inputs or outputs, you need a recent (4.0.3 is best) version of ZeroMQ. It is probably preferred to install it from source:

wget http://download.zeromq.org/zeromq-4.0.3.tar.gz
cd zeromq-4.0.3
./configure
make
sudo make install

This will install it into /usr/local

CRC-DabMux also depends on libfec from Phil Karn. On 64-bit machines, the original libfec doesn't compile (" fec.h:267: Error: bad register name `%dil' "). A patched version that compiles on x86_64 (and even on ARM) is available on GitHub (.zip)


Compilation

Once the prerequisites are installed, do

./configure --with-debug-malloc=no --disable-debug --enable-input-zeromq --enable-output-zeromq
make
sudo make install


or, if you don't have zeromq:

./configure --with-debug-malloc=no --disable-debug
make
sudo make install

then you can execute, as a test

crc-dabmux -h

When building, be careful to disable debugging, otherwise there will be lot of wasted CPU usage.


Compilation from the git repository

If you cloned the git repository, you might need to call

./bootstrap.sh

to re-generate the autotools scripts and generate the ./configure script

After that, it's the same as above


Patch to increase page size

Some glitches have been noticed on some machines. They are due to underruns in the FIFO. This patch increases the buffer sizes in the mux. wrning, this patch will also increase the delay. To apply it use, the patch command. (for CRC-DabMux <=0.3.0.4)

--- src/dabInputFifo.cpp.org	2011-09-27 10:08:35.202323204 -0400
+++ src/dabInputFifo.cpp	2011-09-27 10:13:57.638315966 -0400
@@ -169,11 +169,12 @@
     if (data->buffer != NULL) {
         delete data->buffer;
     }
-    if (size == 0) {
-        size = 1024;
-    }
-    data->buffer = new unsigned char[size * 16];
     data->maxSize = size * 16;
+    int minSize = 2*getpagesize();
+    while (data->maxSize < minSize) {
+        data->maxSize += size;
+    }
+    data->buffer = new unsigned char[data->maxSize];
 #ifdef _WIN32
     ReleaseSemaphore(data->semBuffer, 1, NULL);
 #else


See the manpage for more info: