File: README.txt

package info (click to toggle)
mumudvb 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,336 kB
  • sloc: ansic: 15,555; python: 199; sh: 131; makefile: 86; php: 28
file content (1091 lines) | stat: -rw-r--r-- 45,755 bytes parent folder | download
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
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
MuMuDVB - README
================
Brice Dubost <mumudvb@braice.net>
Version 2.0.0

[NOTE]
An HTML version of this file is availaible on http://www.mumudvb.net[MuMuDVB's website].


Presentation
------------

Description
~~~~~~~~~~~

MuMuDVB (Multi Multicast DVB) is a program that redistributes streams from DVB or ATSC (Digital Television) on a network (also called IPTV) using
multicasting or HTTP unicast.It supports satellite, terrestrial and cable TV, in clear or scrambled channels and run on PC as well as several embedded platforms.
It is intended to multicast (the stream is sent once and the network equipments split the data for the different clients) a whole DVB transponder (set of channels sent on the same carrier frequency) by assigning
each channel a different multicast group. It detects the different services present as well as their important parameters for streaming, rewrite the main DVB tables to show clients only the right stream in each group. 

History : MuMuDVB is originally a modification of dvbstream that http://www.crans.org[cr@ns] made to stream TV in a few hundred rooms.


Website
~~~~~~~

http://mumudvb.braice.net[MuMuDVB main site]


Authors and contacts
--------------------

.Upstream author
- mailto:mumudvb@braice.net[Brice Dubost]

.Contributions
- mailto:manu@REMOVEMEcrans.ens-cachan.fr[Manuel Sabban] (getopt)
- mailto:glondu@REMOVEMEcrans.ens-cachan.fr[Stéphane Glondu] (man page, debian package)
- Special thanks to Dave Chapman (dvbstream author and contributor)
- Pierre Gronlier, Sébastien Raillard, Ludovic Boué, Romolo Manfredini, Matthias Šubik, Krzysztof Ostrowski
- Others, please see git logs


.Mailing list:
- mailto:mumudvb-dev@REMOVEMElists.crans.org[MuMuDVB mailing list]
- https://lists.crans.org/listinfo/mumudvb-dev[MuMuDVB mailing list information and subscription]

[NOTE]
When contacting about an issue, please join the output of MuMuDVB in verbose mode ("-vvv" on the command line) and any other information that could be useful.


Contents and features
---------------------

Features overview
~~~~~~~~~~~~~~~~~

- Stream channels from a transponder on different multicast IPs
- Support for scrambled channels (if you don't have a CAM you can use sasc-ng, but check if it's allowed in you country/by your broadcaster)
- Support for automatic configuration i.e channels discovery and follow changes, see <<autoconfiguration,Autoconfiguration>> section
- Generation of SAP announces, see <<sap,SAP>> section
- Support of DVB-S2, DVB-S, DVB-C, DVB-T and ATSC
- Possibility to partially rewrite the stream for better compatibility with set-top boxes and some clients. See <<pat_rewrite,PAT Rewrite>>, <<sdt_rewrite,SDT Rewrite>> and <<pmt_rewrite,PMT rewrite>> sections.
- Support for HTTP unicast see <<unicast,http unicast>> section
- Support for RTP headers (only for multicast)
- CAM menu access while streaming (using a web/AJAX interface - see WEBSERVICES.txt and CAM_menu_interface.png for screenshot)
- Software descrambling through oscam dvbapi and libdvbcsa
- Flexible configuration mechanism using templates
- Support for embedded platforms based on UCLIBC and ANDROID


Installation
------------

From sources
~~~~~~~~~~~~

From a snapshot
^^^^^^^^^^^^^^^

If you downloaded a snapshot, you will have to generate the auto(conf make etc ...) files. In order to do this you will need the autotools, automake, gettext and libtool and, type in the folder of MuMuDVB

----------------
autoreconf -i -f
----------------

Then you have a source which can be installed as a release package.

From a release package
^^^^^^^^^^^^^^^^^^^^^^

[NOTE]
If you want to compile for OpenWRT, please follow http://ocsovszki-dorian.blogspot.co.uk/2014/01/tl-wdr4900-openwrt-dvb-t-with-ite9135.html[OpenWRT tutorial]

In order to install MuMuDVB type:

---------------------------------
$ ./configure [configure options]
$ make
# make install
---------------------------------

The `[configure options]` specific to MuMuDVB are:

---------------------------------------------------------------------
  --enable-cam-support    CAM support (default enabled)
  --enable-scam-support   SCAM support (default enabled) (see note below)
  --enable-coverage       build for test coverage (default disabled)
  --enable-duma           Debbuging DUMA library (default disabled)
  --enable-android        Support for Android (default disabled)
---------------------------------------------------------------------

[NOTE]
If you want to compile MuMuDVB with clang/llvm, you have to install llvm-gcc and add  `CC=llvm-gcc LD=llvm-ld` or `CC=clang LD=llvm-ld` to your `[configure options]`.

You can have a list of all the configure options by typing

--------------------
$ ./configure --help
--------------------

[NOTE]
The CAM support depends on libdvben50221, libucsi (from linuxtv's dvb-apps). The configure script will detect automatically the presence of these libraries and deactivate the CAM support if one of them is not present.
In the case of fedora, the dvb-apps package does not contains the headers, you have to install it manually following the instructions here : http://www.linuxtv.org/wiki/index.php/LinuxTV_dvb-apps[LinuxTv DVB-apps page] 

[NOTE]
The SCAM support depends on libdvbcsa from videolan. The configure script will detect automatically the presence of these libraries and deactivate the SCAM support if one of them is not present. It needs also trunk version of oscam to get control words. Oscam configuration is described below in section concerning software descrambling v2 inside mumudvb. 

[NOTE]
The decoding of long channel names for autoconfiguration in ATSC depends on libucsi (from linuxtv's dvb-apps). The configure script will detect automatically the presence of this library and deactivate the long channel name support if it is not present. The full autoconfiguration will still work with ATSC but the channel names will be the short channels names (7 characters maximum)

[NOTE]
If you want to compile the doc i.e. generate HTML files using asciidoc, type `make doc`. The rendering for the tables will work with asciidoc 8.4.4 (can work with lower version but not tested).

In order to install starting scripts (debian flavor) type:

------------------------------------------------------------
# cp scripts/debian/etc/default/mumudvb /etc/default/mumudvb
# cp scripts/debian/etc/init.d/mumudvb /etc/init.d/mumudvb
------------------------------------------------------------

[NOTE]
It is advised to create a system user for MuMuDVB, e.g. : `_mumudvb`, you have to add this user to the video group and make the directory `/var/run/mumudvb` RW by this user. By doing this, you'll be able to get all the features of MuMuDVB.


From Debian package
~~~~~~~~~~~~~~~~~~~

If you want to install a version which is not in your repositories, you can install it by hand by typing:

----------------------
# dpkg -i mumudvb*.deb
----------------------

Otherwise you can use aptitude/synaptic as usual

Usage
-----

The documentation for configuration file syntax is in `doc/README_CONF.txt` (link:README_CONF.html[HTML version]).

Usage:

--------------------------------------
mumudvb [options] -c config_file
mumudvb [options] --config config_file
--------------------------------------

Possible options are:

------------------------------------------------------------------
-d, --debug
	Don't deamonize and print messages on the standard output.

-s, --signal
	Print signal strenght every 5 seconds

-t, --traffic
	Print the traffic of the channels every 10 seconds

-l, --list-cards
	List the DVB cards and exit

--card
	The DVB card to use (overrided by the configuration file)

--server_id
	The server id (for autoconfiguration, overrided by the configuration file)

-h, --help
	Show help

-v
	More verbose (add for more)

-q
	More quiet (add for less)

--dumpfile
	Debug option : Dump the stream into the specified file
------------------------------------------------------------------

Signal: (see kill(1))
------------------------------------------------------------------
    SIGUSR1: switch the signal strenght printing
    SIGUSR2: switch the traffic printing
    SIGHUP: flush the log files
------------------------------------------------------------------

[[autoconfiguration]]
Autoconfiguration
-----------------

MuMuDVB is able to find the channels in the transponder, their PIDs (Program IDentifiers), names, and Logical channel numbers.

Without autoconfiguration, you have to set the transponder parameters, and for each channel, the multicast ip, the name and the PIDs (PMT, audio, video, teletext etc...)

If the channel list or the PIDs are changed, MuMuDVB will automatically update the channels.

In autoconfiguration MuMuDVB will try to detect everything and keep the user set parameters fixed. So you can tune manually only things which are relevant for your usage like the multicast IP.
You can also use templates to generate multicast IP or other parameters.

We will review autoconfiguration starting without personalization then the cases when you want to change specific parameters for a (several) channel(s).

Pure autoconfiguration 
~~~~~~~~~~~~~~~~~~~~~~

This is the easiest way to use MuMuDVB.

Use this when you want to stream a full transponder or a subset of a transponder (using autoconf_sid_list).

[NOTE]
You don't have to specify any channel in autoconfiguration except if you need to specify special parameters.

In this mode, MuMuDVB will find for you the different channels, their name and their PIDs (PMT, PCR, Audio, Video, Subtitle, Teletext and AC3).

In order to use autoconfiguration you have to:
- Set the tuning parameters to your config file
- Add `autoconfiguration=full` to your config file
- You don't have to set any channels
- For a first use don't forget to put the `-d` parameter when you launch MuMuDVB:
   e.g. `mumudvb -d -c your_config_file`

.Example config file for satellite at frequency 11.296GHz with horizontal polarization
----------------------
freq=11296
pol=h
srate=27500
autoconfiguration=full
----------------------

The channels will be streamed over the multicasts ip addresses 239.100.c.n where c is the card number (0 by default) and n is the channel number.

If you don't use the common_port directive, MuMuDVB will use the port 1234.

[NOTE]
By default, SAP announces are activated if you use autoconfiguration. To disable them put `sap=0` in your config file.
By default, SDT rewriting is activated if you use autoconfiguration. To disable it put `rewrite_sdt=0` in your config file.
By default, PAT rewriting is activated if you use autoconfiguration. To disable it put `rewrite_pat=0` in your config file.


[NOTE]
If you want to select the services to stream, you can use the `autoconf_sid_list` option which allows to specify the service identifier of the channels you want to be configured.

[NOTE]
A detailled, documented example configuration file can be found in `doc/configuration_examples/autoconf_full.conf`

Templates and autoconfiguration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Name
++++

By default the name of the channel will be the name of the service defined by the provider. If you want more flexibility you can use a template.

For example, if you use `autoconf_name_template=%number-%name` The channels name will be in the form : 

- `1-CNN`
- `2-Euronews`


There is different keywords available:

[width="80%",cols="2,8",options="header"]
|==================================================================================================================
|Keyword |Description 
|%name | The name given by the provider 
|%number | The MuMuDVB channel number 
|%lang | The channel primary language
|%card | The DVB card number
|%tuner | The tuner number
|%server| The server number specified by server_id or the command line 
|%lcn | The logical channel number (channel number given by the provider). Your provider have to stream the LCN. The LCN will be displayed with three digits including 0. Ex "002". If the LCN is not detected, %lcn will be replaced by an empty string.
|%2lcn | Same as above but with a two digits format
|%sid| The channel service id (decimal for the port, hexadecimal for ipv6)
|%sid_hi| The channel service id. The two higher bits (between 0 and 255)
|%sid_lo| The channel service id. The two lower bits (between 0 and 255)
|==================================================================================================================


Other options: Ip, port
+++++++++++++++++++++++

You can also use templates for specifying the ip addresses or the port, for example if you want to use the service identifier (unique channel number in the transponder) in your ip address, you can use `autoconf_ip4=239.42.%sid_hi.%sid_lo`.
Maybe you will notice different transponders having different channels with the same service identifier, you can then use other template to make your IP unique `autoconf_ip4=239.10*%server+%card.%sid_hi.%sid_lo`.


Please refer to `doc/README_CONF.txt` (link:README_CONF.html[HTML version]) in the section "Autoconfiguration parameters" to see which options accept which templates

Other keywords can be easily added if necessary, please contact if you have particular needs.



Advanced autoconfiguration
~~~~~~~~~~~~~~~~~~~~~~~~~~

If the autodection mechanisms of Autoconfiguration are not suiting your needs, for example you need special IP for your channels or special names, you can force manually all channel parameters. The channel parameters specified by the user will not be overriden by autoconfiguration.

The channels are identified in DVB by their service identifier (SID), so you will need to specify this number to allow MuMuDVB know which channel you are refering too.

Some examples to show you the possibilities: 

Specific IP
^^^^^^^^^^^

For example you need to specify a particular IP address for the channel with the service identifier 517, you can use the following configuration file

-------------------------------------
freq=506000
autoconfiguration=full

new_channel
service_id=517
ip=239.42.42.42
-------------------------------------

The IP address of all the other channels will be attributed using the default scheme, or the template you can define using autoconf_ip4,autoconf_ip6

Extra channels
^^^^^^^^^^^^^^

You can also use this personalization to add specific channels, with the following example you will obtain all detected channels plus one extra which is the one you specified.

-------------------------------------
freq=506000
autoconfiguration=full

new_channel
name=my dump channel
ip=239.42.42.42
pids=8192
-------------------------------------

Specific channels with specific IP
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This mode can be combined with autoconf_sid_list if you want to restrict the channels autodetected, in the following example we want to stream two channels and specify their IPs

-------------------------------------
freq=506000
autoconfiguration=full
autoconf_sid_list=516 517

new_channel
service_id=516
ip=239.42.42.1

new_channel
service_id=517
ip=239.42.42.2
-------------------------------------


[[sap]]
SAP announces
-------------

SAP (Session Announcement Protocol) announces are made for the client to know which channels are streamed and what is their name and address. It avoids to give to the client the list of the multicast ip addresses.

VLC and most of set-top boxes are known to support them.

MuMuDVB will automatically generate and send SAP announces if asked to in the config file or if you are in full autoconfiguration mode.

The SAP announces will be only sent for alive channels. When a channel goes down, MuMuDVB will stop sending announces for this channel, until it goes back.


Asking MuMuDVB to generate SAP announces
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For sending SAP announces you have to add `sap=1` to your config file. The other parameters concerning the sap announces are documented in the `doc/README_CONF.txt` file (link:README_CONF.html[HTML version]).

SAP announces and full autoconfiguration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you use full autoconfiguration, you can use the keyword '%type' in the sap_default_group option. This keyword will be replaced by the type of the channel: Television or Radio.

.Example
If you put `sap_default_group=%type`, you will get two sap groups: Television and Radio, each containing the corresponding services.


Configuring the client to get the SAP announces
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


VLC > 2.0.0
^^^^^^^^^^^

SAP announces are enabled by default, you will find them in the local network left submenu of the playlist

VLC < 2.0.0
^^^^^^^^^^^

Click on the "Settings" menu, then on "add interface" and choose SAP playlist. Then open you playlist, the SAP announces should appear automatically.




VLC > 0.8.2 && VLC < 2.0.0
^^^^^^^^^^^^^^^^^^^^^^^^^^
You have to enter the settings, choose advanced settings. The SAP announces are in playlist->service discovery.

Don't forget to save the settings.

You should have now a SAP section in your playlist.




[[unicast]]
HTTP Unicast
------------

In addition to multicast, MuMuDVB also supports HTTP unicast. This make you able to use MuMuDVB on networks wich doesn't support multicast.

There is one listening connection, the channel is selected via the HTTP path, see further.

And you can have listening sockets per channel, in this case the client will always get the same channel independantly of the path.

[NOTE]
Be careful with unicast, it can eat a lot of bandwith. Think about limitting the number of clients.

[NOTE]
If you don't want the (always here) multicast traffic to go on your network set `multicast=0`

Activate HTTP unicast
~~~~~~~~~~~~~~~~~~~~~

To enable HTTP unicast you have to set the option `unicast`. By default MuMuDVB will listen on all your interfaces for incoming connections.

You can also define the listening port using `port_http`. If the port is not defined, the default port will be 4242.

Activate "per channel" listening socket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can create listening connections only for a channel. In this case, when a client connect to this socket he will alway get the same channel independantly of the HTTP path.

If you use full autoconfiguration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You need to set the option `autoconf_unicast_start_port` which define what is the output port for the first discovered channel (for the following channels the port will be incremented).


If you don't use full autoconfiguration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For the channels for which you want to have a listening unicast socket you have to set the option `unicast_port` which define the listening port of the socket



Client side, the different methods to get channels
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[[playlist]]
Using a playlist
^^^^^^^^^^^^^^^^

MuMuDVB generates m3u playlists.

If you server is listening on the ip 10.0.0.1 and the port 4242,

-------------------------------------
vlc http://10.0.0.1:4242/playlist.m3u
-------------------------------------

[NOTE]
In this playlist the channels will be announced with URLs type `/bysid/` (see below), if you want a playlist for single channel sockets, use the URL `/playlist_port.m3u`.

[NOTE]
Playlists for multicast are also generated, they are accessible using the following names: "playlist_multicast.m3u" and "playlist_multicast_vlc.m3u"


Single channel socket
^^^^^^^^^^^^^^^^^^^^^

If the client connect to a single client socket he will get the associated channel independantly of the path.

If you server is listening on the ip 10.0.0.1 and the port for the channel is 5000,

-------------------------
vlc http://10.0.0.1:5000/
-------------------------

Get the channel by number
^^^^^^^^^^^^^^^^^^^^^^^^^

You can ask the channel by the channel number (starting at 1).

If you server is listening on the ip 10.0.0.1 and the port 4242,

------------------------------------
vlc http://10.0.0.1:4242/bynumber/3
------------------------------------

will give you the channel number 3. This works also with xine and mplayer.

Get the channel by service id
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You can ask the channel by the service id.

If you server is listening on the ip 10.0.0.1 and the port 4242,

----------------------------------
vlc http://10.0.0.1:4242/bysid/100
----------------------------------

will give you the channel with the service id 100, or a 404 error if there is no channel with this service id. This works also with xine and mplayer.

Get the channel by name
^^^^^^^^^^^^^^^^^^^^^^^

You can ask the channel by the channel name.
The search is case insensitive. If your channel name contains spaces, replace them by '-' character.

If you server is listening on the ip 10.0.0.1 and the port 4242,

----------------------------------------------------
vlc http://10.0.0.1:4242/byname/your-tv-station-name
----------------------------------------------------

will give you the channel with name "Your TV station name". This works also with xine and mplayer.

Get the channels list
^^^^^^^^^^^^^^^^^^^^^

If you server is listening on the ip 10.0.1 and the port 4242,

To get the channel list (in basic html) just enter the address `http://10.0.0.1:4242/channels_list.html` in your web browser.

To get the channel list (in JSON) just enter the address `http://10.0.0.1:4242/channels_list.json` in your web browser.

HTTP unicast and monitoring
~~~~~~~~~~~~~~~~~~~~~~~~~~~

This HTTP connection can be used to monitor MuMuDVB.

Monitoring information is avalaible in JSON format (http://en.wikipedia.org/wiki/JSON) vis the following urls `/monitor/signal_power.json` and `/monitor/channels_traffic.json`

It's quite easy to add new informations to these files if needed.

Monitoring
----------

You can use http://mmonit.com/monit/[Monit] to monitor MuMuDVB an restart it when it experiences problems (MuMuDVB kill himself when big issues appear).

You have to install the init scripts (automatic if you used the Debian package) and add the following lines to your `/etc/monit/services` file:

----------------------------------------------------------------------
check process mumudvb with pidfile /var/run/mumudvb/mumudvb_adapter0_tuner0.pid
    start program = "/etc/init.d/mumudvb start"
    stop program = "/etc/init.d/mumudvb stop"
----------------------------------------------------------------------

[NOTE]
The 0 have to be replaced by the DVB card number if you have multiples cards.

For more detailled information, refer to the http://mmonit.com/monit/[Monit Website].

MuMuDVB usually run for many days without problems, but with monit you are safe. Monit is also able to send e-mails in case of problems.


Scrambled channels support
--------------------------

Important note : check the contract with your broadcaster to see if you are allowed to stream the scrambled channels you're subscribed to.

Hardware descrambling
~~~~~~~~~~~~~~~~~~~~~

MuMuDVB supports scrambled channels via hardware descrambling i.e. a CAM (Conditionnal Access Module). It can ask the CAM to descramble multiple channels if the CAM supports it (Aston Pro, or PowerCam Pro are known to work with multiple channels).

If you are limited by the number of PIDs the can can decrypt simultaneously, it is possible to ask the CAM to decrypt only the audio and video. This feature is not implemented, please ask if you need it.

[NOTE]
The hardware descramblig uses almost no CPU, all the descrambling is made by the CAM.

[NOTE]
MuMuDVB doesn't query the CAM before asking for descrambling. The query is not reliable. Most of CAMs answer a menu when the descrambling is not possible and MuMuDVB will display it on the standard error.

The information concerning the CAM is stored in '''/var/run/mumudvb/caminfo_adapter%d_tuner%d''' where %d is the DVB card number.

.Example contents of '''/var/run/mumudvb/caminfo_carte%d''' 
----------------------------------------------------
CAM_Application_Type=01
CAM_Application_Manufacturer=02ca
CAM_Manufacturer_Code=3000
CAM_Menu_String=PowerCam_HD V2.0
ID_CA_Supported=0100
ID_CA_Supported=0500
----------------------------------------------------

[NOTE]
In case of issues with some king of CAMs the libdvben50221 could have to be patched:
http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/29866[Link to the patch]

How to ask MuMuDVB for descrambling?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.You are using autoconfiguration :

Just add `cam_support=1` to your config file

.You are not using autoconfiguration
 * Add `cam_support=1` to your config file (before the channels)
 * For each scrambled channel add the `pmt_pid` option. This option is made for MuMuDVB to know wich PID is the PMT PID wich will be used to ask for descrambling



Hardware CAM issues
~~~~~~~~~~~~~~~~~~~

Some hardware CAM are not directly connected to the tuner, one can choose the stream sent to the CAM. This can make the work slightly more complicated to run the CAM since you have to ensure the right stream is sent to the CAM.


Digital Devices Cine CT V6
^^^^^^^^^^^^^^^^^^^^^^^^^^

We always use cards and hardware from Digital Devices(http://www.digitaldevices.de/).
        - Octopus CI
        - Cine S2 V6.5

After a lot of problem with MuMuDVB and the CI card we found out, that the hardware wasn't detected by MuMuDVB.
The folder /dev/dvb looked like :

----------------------------------------
        - Adapter0
        - Adapter1
        - Adapter2
        - Adapter3
----------------------------------------

`/dev/dvb/Adapter0` and Adapter1 had the following content:


----------------------------------------
demux0  dvr0  frontend0  net0
----------------------------------------

`/dev/dvb/Adapter2` and Adapter3 had the following content:

----------------------------------------
sec0    ca0
----------------------------------------

So there was no connection between the tuner and the CI.

So we tried to load the driver of the card with a different parameter to get everything into one single folder.

-----------------------------------------
sudo modprobe ddbridge adapter_alloc = 3
-----------------------------------------

Result:

/dev/dvb/ includes only adapter0

Content of adapter0:

-----------------------------------------
ca0  demux0  dvr0  frontend0  net0  sec0
ca1  demux1  dvr1  frontend1  net1  sec1
-----------------------------------------

After that we had to pipe the stream from the frontend truth the CI modul.
This part is still very buggy and we don't know exactly how that works.

------------------------------------------------------------
sudo echo "02 02" > /sys/class/ddbridge/ddbridge0/redirect
sudo echo "03 03" > /sys/class/ddbridge/ddbridge0/redirect
------------------------------------------------------------


At the moment we have the problem that we can use only one tuner. :(

Here you can see some more information about this problem

http://www.spinics.net/lists/linux-media/msg39494.html



Software descrambling v1
~~~~~~~~~~~~~~~~~~~~~~~~

Important note : this solution is not allowed by some provider contracts.

MuMuDVB has been reported to work with software descrambling solutions like sascng + newcs + dvbloopback.

In this case  you don't need to set the `cam_support` option. Just ajust the `card` option to fit with your virtual dvbloopback card. 

If you use these solutions, see <<reduce_cpu,reduce MuMuDVB CPU usage>> section.

Some information on how to configure SASC-NG
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The following informations have been given by MuMuDVB users on the MuMuDVB-dev mailing list

When the channels are not sucessfully descrambled (channel down in MuMuDVB) the following options are reported to improve the situation

--------------------------------------------------
--sid-nocache --buffer 8M --sid-filt=200 -D
--------------------------------------------------

You can try also the option --sid-allpid
It seems to happend with transponders with a lot of channels (TV or RADIO channels).
 


Scrambling status
~~~~~~~~~~~~~~~~~

The scrambling status is stored together with the streamed channel list. 

.Example
----------------------------------------------
239.100.0.7:1234:ESCALES:PartiallyUnscrambled
239.100.0.8:1234:Fit/Toute l'Histoire:PartiallyUnscrambled
239.100.0.9:1234:NT1:PartiallyUnscrambled
239.100.0.10:1234:ACTION:PartiallyUnscrambled
239.100.0.11:1234:MANGAS:PartiallyUnscrambled
239.100.0.12:1234:ENCYCLOPEDIA:PartiallyUnscrambled
239.100.0.13:1234:XXL PL:PartiallyUnscrambled
239.100.0.14:1234:France 5:HighlyScrambled
239.100.0.16:1234:LCP:FullyUnscrambled
239.100.0.17:1234:VIDEOCLICK:FullyUnscrambled
----------------------------------------------

 * FullyUnscrambled : less than 5% of scrambled packets
 * PartiallyUnscrambled : between 5% and 95% of scrambled packets
 * HighlyScrambled : more than 95% of scrambled packets


Software descrambling v2
~~~~~~~~~~~~~~~~~~~~~~~~

Important note : this solution is not allowed by some provider contracts.

MuMuDVB now has support for software descrambling on its own, to do that you'll need to have trunk version of oscam and libdvbcsa installed.
To enable you have to add to global options 
scam_support=1
on program options add
oscam=1
Other setting are documented at `doc/README_CONF.txt` (link:README_CONF.html[HTML version]), there is also a configuration example available at `configuration_examples/oscam.conf`

If channel has a lot of bandwidth it may be needed to extend ring buffer size. 

If cw's don't get in time defined as decsa delay(default 500000us=0.5s), you may try to extend it (decsa_delay max is 10000000, and send_delay should be lower than decsa_delay, because we can't send descrambled packets befor they're being descrambled) for example:
------------------------------
	decsa_delay=3500000
	send_delay=4500000
------------------------------

note that bigger delays in ring buffer may need also extending ring buffer size

In debug mode number of packets in the buffer is reported and buffer overflow is detected, you should use that to tweak your delays and ring buffer size. In http state.xml number of packets in the buffer is also reported.


[NOTE]
Use the latest version of oscam from trunk, older versions did not have support for pc dvbapi. Instructions how to compile are on http://streamboard.de.vu:8001/wiki/crosscompiling

[NOTE] 
When using oscam with more than 16 channels adjust macro definition `MAX_DEMUX` (line below) on oscam header `module-dvbapi.h` to number of your channels
------------------------------
#define MAX_DEMUX 16
------------------------------

[NOTE]
When using multiple channels per card (more than (ecm_change_time)/(2*card_response_time)), you may get timeouts on oscam on mumudvb startup, it's because on startup oscam asks card for two cw's at the same time.
It should get right after a while.
Currently there is no solution for that bug.

Some information on how to configure oscam
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In the `oscam.conf` file add the following options
------------------------------
        [dvbapi]
        enabled = 1
        au = 1
        boxtype = pc
        user = mumudvb
        pmt_mode = 4
        request_mode = 1
------------------------------


[[pat_rewrite]]
PAT (Program Allocation Table) Rewriting
-----------------------------------------

This feature is mainly intended for set-top boxes. This option will announce only the streamed channel in the Program Allocation Table instead of all transponder channels. Computer clients parse this table and decode the first working program. Set-top boxes usually try only the first one which give usually a blank screen in most of the channels. 

To enable PAT rewriting, add `rewrite_pat=1` to your config file. This feature consumes few CPU, since the rewritten PAT is stored in memory and computed only once per channel.

[NOTE]
PAT rewrite can fail (i.e. doesn't solve the previous symptoms) for some channels if their PMT pid is shared. In this case you have to add the `service_id` option to the channel to specify the service id.

[[sdt_rewrite]]
SDT (Service Description Table) Rewriting
-----------------------------------------

This option will announce only the streamed channel in the Service Description Table instead of all transponder channels. Some clients parse this table and can show/select ghost programs if it is not rewritten (even if the PAT is). This can rise to a random black screen.

To enable SDT rewriting, add `rewrite_sdt=1` to your config file. This feature consumes few CPU, since the rewritten SDT is stored in memory and computed only once per channel.

[NOTE]
If you don't use full autoconfiguration, SDT rewrite needs the `service_id` option for each channel to specify the service id.

[[pmt_rewrite]]
PMT (Program Map Table) Rewriting
-----------------------------------------

This option must be used if you don't stream all PIDs for a channel. It's useful for separating one channel with multiple audio streams (multiple languages) into separate channels.

Without PMT rewrite, players can get confused due to missing streams, especially if the first PID in the table is not streamed, and the playback may fail. However, teletext PID can usually be dropped safely without rewriting PMT, as it's the last PID in the table.

To enable PMT rewriting, add `rewrite_pmt=1` to your config file.

[NOTE]
PMT rewrite will work only if PIDs are set manually. If they are autodetected, everything will be streamed so there's no need to rewrite the PMT.



EIT PID (Event Information Table) Sorting
-----------------------------------------

This option will make MuMuDVB stream only the EIT packets corresponding to the streamed channel instead of all transponder channels. Some clients parse this table and can show/select ghost programs (even if the PAT and the SDT are rewritten).

The EIT PID contains the description of the current program and the future programs. It is used to build the Electronic Program Guide.

To enable EIT sorting, add `sort_eit=1` to your config file. 

[NOTE]
If you don't use full autoconfiguration, EIT sorting needs the `service_id` option for each channel to specify the service id.

[[reduce_cpu]]
Reduce MuMuDVB CPU usage
------------------------

Normally MuMuDVB reads the packets from the card one by one and ask the card if there is data avalaible between each packets (poll). But often the cards have an internal buffer. Because of this buffer, some pollings are useless. These pollings eat some CPU time.

To reduce CPU usage, one solution is to try to read several packets at the same time. To do this use the option `dvr_buffer_size`.

.Example
------------------
dvr_buffer_size=40
------------------

To see if the value you put is too big or to low, run MuMuDVB in verbose mode, the average number of packets received at the same time will be shown every 2 minutes. If this number if below your buffer size, it is useless to increase it. 

The CPU usage reduction can be between 20% and 50%.

[[threaded_read]]
Data reading using a thread
---------------------------

In order to make MuMuDVB more robust (at the cost of a slight CPU consumption increase), MuMuDVB can read the data from the card using a thread. This make the data reading "independant" of the rest of the program.

In order to enable this feature, use the option `dvr_thread`.

This reading uses two buffers: one for the data just received from the card, one for the data treated by the main program. You can adjust the size of this buffers using the option `dvr_thread_buffer_size`. The default value  (5000 packets of 188 bytes) should be sufficient for most of the cases. 

The message "Thread trowing dvb packets" informs you that the thread buffer is full and some packets are dropped. Increase the buffer size will probably solve the problem.


[[ipv6]]
IPv6
----

MuMuDVB supports IPv6 multicasting. It is not enabled by default you have to activate it using the multicast_ipv6 option

To "enjoy" multicasting you need a switch which supports the http://en.wikipedia.org/wiki/Multicast_Listener_Discovery[Multicast Listener Discovery] protocol.

IPv6 use extensively the concept of http://en.wikipedia.org/wiki/Multicast_address[scoping]. By default MuMuDVB uses the scope "site-local" (ie multicast addresses starting with FF05) the SAP announcements are also sent with this scope. If you need to have more flexibility on this side, please contact.

Here some documentation about IPv6 and multicasting

http://www.cisco.com/en/US/technologies/tk648/tk872/technologies_white_paper0900aecd80260049.pdf[IPv6 Multicast at a Glance - Cisco]

http://www.cisco.com/en/US/technologies/tk648/tk872/technologies_white_paper0900aecd8026003d.pdf[IPv6 Addressing at a Glance - Cisco]


RFCs concerning IPv6 scopes and addressing

http://tools.ietf.org/html/rfc4007[RFC4007]
http://tools.ietf.org/html/rfc4291[RFC4291]

What is MLD snooping (equivalent of IGMP in IPv6) and how to configure it on HP switches
http://cdn.procurve.com/training/Manuals/2900-3500-5400-6200-8200-IPv6-Jan08-7-MLD.pdf[MLD snooping on Procurve]

Support of IPv6 on Cisco switches
http://www.cisco.com/en/US/technologies/collateral/tk648/tk872/tk373/technologies_white_paper_09186a00802219bc_ps6553_Products_White_Paper.html[IPV6 on cisco]

Extract of the previous page
----------------------------------------------------------------------------------
Layer 2 Switches
IPv6 traffic forwarding does not impact Layer 2 LAN switches, since these devices do not need to look at the Layer 3 header to forward an IPv6 frame; thus IPv6 hosts can be transparently attached to the following Cisco products. In addition, Layer 2 switches may integrate dedicated IPv6 features such as native IPv6 network management or MLD snooping (Cisco products marked with "*" in the list).
• Cisco Catalyst Express 500 Series Switch
• Cisco Catalyst 2900XL Series Switch
• Cisco Catalyst 2960 Series (*)
• Cisco Catalyst 3500XL Series Switch
• Cisco Catalyst 3560, 3560-E, 3750 and 3750-E Series Switch (*)
• Cisco Catalyst 4500 Series Switch
• Cisco Catalyst 4500-E Series Switch (*)
• Cisco Catalyst 5000 Series Switch
• Cisco Catalyst 6500 Series Switch (*)
----------------------------------------------------------------------------------

Also
Cisco introduced IPv6 Multicast in Cisco IOS Software Releases 12.0(26)S, 12 .2(18)S, and12.3(2)T. It has been deployed in numerous business-critical IPv6 Multicast networks.

http://www.cisco.com/cisco/web/solutions/small_business/products/routers_switches/300_series_switches/index.html[IPV6 small business switch]

Some useful commands for ipv6 multicast debugging under linux
------------------------------------------
Show the open sockets
netstat -6tulp

See the traffic (on iface eth0)
tcpdump -ni eth0 ip6

See the traffic to a particular address (here the SAP IPv6 announces)
tcpdump -ni eth0 ip6 host FF05::2:7FFE

Read an IPv6 stream with VLC (under linux)
vlc -vvv --ipv6 udp://@\[ff15::1\]:1234

------------------------------------------


MuMuDVB Logs
------------

MuMuDVB can send it's logs to the console, to a file or via syslog. It can also be several of these channels. The formatting of the logs can also be adjusted.

By default, the logs are sent to the console if not daemonized and via syslog otherwise.

If the logs are sent to a file, you can ask MuMuDVB to flush the file using the SIGHUP signal.

For more detail about these features see `doc/README_CONF.txt` (link:README_CONF.html[HTML version]). 



Using MuMuDVB with "particular" clients
---------------------------------------

People were able to use MuMuDVB with various clients, I will report here the tutorials I received for some of them

XBMC (for XBOX originally)
~~~~~~~~~~~~~~~~~~~~~~~~~~

*Description:* XBMC (XBMP really) started as a program for modified XBOX consoles. In the following years, XBMC has grown into a multi-platform, multi-architecture media center that runs on most standard hardware. The hardware and legal limitations of the XBOX were always a concern and the Team has instead focused on running on the hardware that most people already have.

*Website:* http://xbmc.org/

*Tutorial:*
Here`s what You have to do, open Your favorite text editor and write an ip address with the protocol You are using of the particular program and port save it as something.strm. You have to create .strm files for every program You are streaming. Once you have done that fire up WinSCP and connect to the ip address of Your XBMC box if You are using the live version username and password is xbmc xbmc if You have installed the live version then You have provided the username and password during install process. Now copy theoes .strm files to the XBMC box in lets say home folder. Now in XBMC go to the video menu then click add source then click browse and navigate to the home folder and click ok then u have to give the name of that source use what ever You like and click ok and thats it. Go to the video menu You will see that You have a folder named as You named the source open it and You will see all of Yours .strm files click on it and it will start to play the stream from mumudvb. Works weather You are using multicast or unicast.

Thanks to Ivan Cabraja for the tutorial

MythTV
~~~~~~

*Description:* MythTV is a Free Open Source software digital video recorder (DVR) project distributed under the terms of the GNU GPL.

*Website:* http://www.mythtv.org/

*Tutorial:* Configuring Mythtv and mumudvb

Mumudvb Configuration:
^^^^^^^^^^^^^^^^^^^^^^

You need to turn pat rewriting on  (i.e. rewrite_pat=1).

You can use either multicast or udp streaming to mythtv (udp streaming
is achieved by using a non-multicast ip address in the  configuration
file  i.e. ip=192.168.1.100). Http unicast streaming is not supported in
mythtv, but RTSP should be when this is implemented in mumudvb.

The channel name needs to be in the following format "channel number" -
"channel name" (e.g. name=1 - TV One )

Mythtv configuration:
^^^^^^^^^^^^^^^^^^^^^

*Single-transponder*

In mythtv-setup you need to add a new "network recorder" capture card.
Enter the address of the playlist mumudvb provides in the  "M3U URL"
field. This will be something like
http://192.168.2.2:4242/playlist_multicast.m3u
 
You then create a video source as normal, and associate this with the
"Network recorder" capture card via the "input connections" option. 

You then need to carry out a channel scan (while you are associating the
video source or via the channel editor).

The channel scan appears to hang on 0%, but just select finish after a
couple of seconds. This should have loaded the channels defined in the
M3U file into mythtv. 

Relying on the EIT information embedded in the stream does not appear to
work, so you need to load this information from an external xmltv
source. You do this by going into the channel editor and adding the
correct xmltv ID for each channel. Once you have done this you exit out
of mythtv-setup and run something like: mythfilldatabase --file 1
freeview.xml  (where in this case the the xmltv file is called
freeview.xml).

To allow recording and viewing of multiple channels from the one
transponder, you need to add additional (identically configured)
"network recorder" capture cards. For example if you want to be able to
record two channels and watch a third at the same time you need to have
set up a total of three network recorder cards.

*Multiple-Transponders*

if you are streaming channels from several transponders (by using
several instances of mumudvb) you have two options:

1) The obvious thing to do is to define a different network recorder for
each transponder (with the appropriate playlist defined), each
transponder has to be associated with a different video source (assuming
each transponder contains different channels). However, this does not
seem to work well, with regular crashes when changing channels, and it
also requires that you first switch between video sources to be able to
change between channels on different transponders [this may be due to my
lack of skill at configuring mythtv]

2) An easier way is to generate a custom m3u file, that contains the
channels of all the transponders. This also allows you to define the
xmltvid of each channel as well - removing the need to do this manually
in the channel editor. In this case when you set up the network
recorders, you can enter a file path for the location of the m3u file,
as opposed to accessing it via a web-server (e.g.
file///home/nick/channels.m3u ). Once again you simply make multiple
copies of the (identical) network recorder capture card if you want to
record/watch multiple channels.

An example of a m3u file is as follows (in this case the first four
channels defined are from one mumudvb instance, and the last two from
another - of course care has to be taken in configuring the various
mumudvb instances to make sure none of the channels are assigned the
same port etc):


--------------------------------------------------
#EXTM3U
#EXTINF:0,1 - TV1
#EXTMYTHTV:xmltvid=tv1.freeviewnz.tv
udp://192.168.2.101:1233
#EXTINF:0,2 - TV2
#EXTMYTHTV:xmltvid=tv2.freeviewnz.tv
udp://192.168.2.101:1235
#EXTINF:0,6 - TVNZ 6
#EXTMYTHTV:xmltvid=tvnz6.freeviewnz.tv
udp://192.168.2.101:1236
#EXTINF:0,7 - TVNZ 7
#EXTMYTHTV:xmltvid=tvnz7.freeviewnz.tv
udp://192.168.2.101:1237
#EXTINF:0,3 - TV3
#EXTMYTHTV:xmltvid=tv3.freeviewnz.tv
udp://192.168.2.101:1238
#EXTINF:0,4 - c4
#EXTMYTHTV:xmltvid=c4.freeviewnz.tv
udp://192.168.2.101:1239
--------------------------------------------------


Thanks to Nick Graham for the tutorial