Code Monkey home page Code Monkey logo

minisatip's Introduction

Coverity Scan Build Status

Welcome to Minisatip

Minisatip is a multi-threaded satip server version 1.2 that runs under Linux and it was tested with DVB-S, DVB-S2, DVB-T, DVB-T2, DVB-C, DVB-C2, ATSC and ISDB-T cards. More details about supported hardware: Supported_Hardware.md

The protocol specification can be found at: docs/satip_specification_version_1_2_2.pdf
(original file downloaded from http://satip.info/sites/satip/files/resource/satip_specification_version_1_2_2.pdf and now offline).

It is very lightweight (designed for embedded systems with memory and processing constrains), does not need any additional libraries for basic functionality and can be used by existing satip clients like: Tvheadend, DVBViewer, vdr, VideoLAN or Android/iOS applications. Minisatip can act as a satip client as well in order to connect to satip servers from different networks.

The application is designed to stream the requested data to multiple clients (even with one dvb card) in the same time while opening different pids.

It is tested on x86_64, x86, ARM and MIPS platforms and it requires DVBAPI 5. Supported protocols are RTSP (both tcp and udp), HTTP (port 8080) and SSDP (as specified in the SAT>IP documentation). On top of that, it supports dvbapi protocol implemented by oscam (requires dvbcsa library) to decrypt channels using an official subscription and support dvbca protocol (requires libssl-dev library) for dvb cards with CA hardware. In order to enable/disable features, please edit the Makefile.

The application shows also a status page by default at the address: http://IP:8080
The latest binaries for embedded platforms: https://minisatip.org/forum/binaries

Contact

Please use https://minisatip.org/forum/ for any question or join Slack

In order to speed up the investigation of an issue, please provide the full log and a link to the application that is not working.

If you like minisatip and you want to support the development of the project please make a donation: https://paypal.me/minisatip

Usage:

(Message automatically generated from minisatip --help)

minisatip version 1.2.~4b5ed89, compiled in Feb 22 2023 08:21:17, with s2api version: 050B

	./minisatip [-[fgtzE]] [-a x:y:z] [-b X:Y] [-B X] [-H X:Y] [-d A:C-U ] [-D device_id] [-e X-Y,Z] [-i prio] 
	[-[uj] A1:S1-F1[-PIN]] [-m mac] [-P port] [-l module1[,module2]] [-v module1[,module2]] 
	[-o [~]oscam_host:dvbapi_port[,offset] [-p public_host] [-r remote_rtp_host] [-R document_root] [-s [*][DELSYS:][FE_ID@][source_ip/]host[:port] 
	[-u A1:S1-F1[-PIN]] [-L A1:low-high-switch] [-w http_server[:port]] 
 	[-x http_port] [-X xml_path] [-y rtsp_port] [-I name_service]

Help
-------

* -4 : Force TCP sockets to use IPv6

* -a --adapters x:y:z simulate x DVB-S2, y DVB-T2 and z DVB-C adapters on this box (0 means auto-detect)
	* eg: -a 1:2:3  
	- it will report 1 dvb-s2 device, 2 dvb-t2 devices and 3 dvb-c devices 

* -G --disable-ssdp disable SSDP announcement
 
* -b --buffer X:Y : set the app adapter buffer to X Bytes (default: 376000) and set the kernel DVB buffer to Y Bytes (default: 5775360) - both multiple of 188
	* eg: -b 18800:18988

* -B X : set the app socket write buffer to X KB. 
	* eg: -B 10000 - to set the socket buffer to 10MB

* --client-send-buffer X : set the socket write buffer for client connections to X KB. 
	- The default value is 0, corresponding to use the kernel default value
	* eg: --satip-receive-buffer  100 - to set the socket buffer to 100KB
	* eg: --satip-receive-buffer 1024 - to set the socket buffer to 1MB

* -z --cache-dir dir : set the app cache directory to dir. The directory will be created if it doesn't exist. 
	* defaults to /var/cache/minisatip 

* -d --diseqc ADAPTER1:COMMITTED1-UNCOMMITTED1[,ADAPTER2:COMMITTED2-UNCOMMITTED2[,...]
	* The first argument is the adapter number, second is the number of committed packets to send to a Diseqc 1.0 switch, third the number of uncommitted commands to sent to a Diseqc 1.1 switch
	The higher number between the committed and uncommitted will be sent first.
	* eg: -d 0:1-0  (which is the default for each adapter).
	- note: * as adapter means apply to all adapters
	- note: * before committed number enables fast-switch (only voltage/tone)
	- note: @ before committed number sets 'Any Device' diseqc address (0x00)
	- note: . before committed number sets 'LNB' diseqc address (0x11)

* -q --diseqc-timing ADAPTER1:BEFORE_CMD1-AFTER_CMD1-AFTER_REPEATED_CMD1-AFTER_SWITCH1-AFTER_BURST1-AFTER_TONE1[,...]
	* All timing values are in ms, default adapter values are: 15-54-15-15-15-0
	- note: * as adapter means apply to all adapters

* -D --device-id DVC_ID: specify the device id (in case there are multiple SAT>IP servers in the network)
 	* eg: -D 4 

* -0 --diseqc-multi ADAPTER1:DISEQC_POSITION[,...]
	* Send diseqc to selected position before other position is set.
	- note: * as adapter means apply to all adapters

* -E Allows encrypted stream to be sent to the client even if the decrypting is unsuccessful
        Duplicating it (-E -E) all undecrypted packets are send as stuffing TS packets. Usefull for regular player clients.
	- note: when pids=all is emulated this pass NULLs too

* -Y --delsys ADAPTER1:DELIVERY_SYSTEM1[,ADAPTER2:DELIVERY_SYSTEM2[,..]] - specify the delivery system of the adapters (0 is the first adapter)	
	* eg: --delsys 0:dvbt,1:dvbs
	- specifies adapter 0 as a DVBT device, adapter 1 as DVB-S, which overrides the system detection of the adapter

* -e --enable-adapters list_of_enabled adapters: enable only specified adapters
	* eg: -e 0-2,5,7 (no spaces between parameters)
	- keep in mind that the first adapters are the local ones starting with 0 after that are the satip adapters 
	if you have 3 local dvb cards 0-2 will be the local adapters, 3,4, ... will be the satip servers specified with argument -s

* -f foreground: otherwise run in background

* -F --logfile log_file: output the debug/log information to  log_file when running in background (option -f not used), default /tmp/minisatip.log

* -g --syslog: use syslog instead stdout for logging, multiple -g - print to stderr as well

* -H --threshold X:Y : set the write time threshold to X (UDP) / Y (TCP)  milliseconds. 
	* eg: -H 5:50 - set thresholds to 5ms (UDP) and 50ms (TCP)

* -I --name-app specificies an alternative Service Name

* -i --priority prio: set the DVR thread priority to prio 

* -k Emulate pids=all when the hardware does not support it, on enigma boxes is enabled by default 

* -l specifies the modules comma separated that will have increased verbosity, 
	logging to stdout in foreground mode or in /tmp/minisatip.log when a daemon
	Possible modules: general,http,socketworks,stream,adapter,satipc,pmt,tables,dvbapi,lock,netceiver,ca,axe,socket,utils,dmx,ssdp,dvb
	* eg: -l http,pmt

* -v specifies the modules comma separated that will have increased debug level (more verbose than -l), 
	* eg: -v http,pmt

* -L --lnb specifies the adapter and LNB parameters (low, high and switch frequency)
	* eg: -L *:9750-10600-11700 - sets all the adapters to use Universal LNB parameters (default)
	* eg: -L *:10750-10750-10750 - sets the parameters for Sky NZ LNB using 10750 Mhz
	* eg: -L 0:10750-10750-10750,1:9750-10600-11700 - adapter 0 has a SKY NZ LNB, adapter 1 has an Universal LNB

* -m --mac xx: simulate xx as local mac address, generates UUID based on mac
	* eg: -m 001122334455 

* -M --multiplier: multiplies the strength and snr of the DVB adapter with the specified values
	* If the snr or the strength multipliers are set to 0, minisatip will override the value received from the adapter and will report always full signal 100% 
	* eg: -M 4-6:1.2-1.3 - multiplies the strength with 1.2 and the snr with 1.3 for adapter 4, 5 and 6
	* eg: -M *:1.5-1.6 - multiplies the strength with 1.5 and the snr with 1.6 for all adapters
	* [%] This symbol forces to read values as percentage
	* [#] This symbol forces to read values as decibels
	* eg: -M *:%1.0-#1.0 - not multiply the strength but force it as percentage and for the snr interpret it as decibels
	* Zero values will disable frontend polling, and this may solve CC errors with some hardware/drivers (eg: -M *:0-0)

* -N --disable-dvb disable DVB adapter detection
 
* -Z --adapter-timeout ADAPTER1,ADAPTER2-ADAPTER4[,..]:TIMEOUT - specify the timeout for the adapters (0 enabled infinite timeout)	
	eg: --adapter-timeout 1-2:30
	- sets the timeouts for adapter 1 and 2 to 30 seconds 
	--adapter-timeout *:0
	- turns off power management for all adapters (recommended instead of --adapter-timeout 0-32:0) 
	- required for some Unicable LNBs 

* -5 --disable-cat ADAPTER1,ADAPTER2-ADAPTER4
	* eg: -5 1-3,4 
	- disable passing the CAT to the DDCI device 1,2,3 and 4 

* -o --dvbapi [~]host:port,offset - specify the hostname and port for the dvbapi server (oscam). Port 9000 is set by default (if not specified) 
	* [~] This symbol at the beginning indicates that in all `pids=all` requests the filtering of unencrypted packets must be disabled (useful when not using -E).
	* eg: -o 192.168.9.9:9000 or -o 192.168.9.9:9999,2  with offset if multiple dvbapi clients use the same server
	192.168.9.9 is the host where oscam is running and 9000 is the port configured in dvbapi section in oscam.conf.
	* eg: -o /tmp/camd.socket 
	/tmp/camd.socket is the local socket that can be used 
* --send-all-ecm Pass all received ECM to the DVBAPI server. Warning: This option may overload your server. Use with caution. Not necessary for regular use.

* -p --playlist url: specify playlist url using X_SATIPM3U header 
	* eg: -p http://192.168.2.3:8080/playlist
	- this will add X_SATIPM3U tag into the satip description xml

* -P  port: use port number to listen for UDP socket in the RTP communication. port + 1000 will be used to listen by the sat>ip client (option -s)
 	* eg: -P 5500 (default): will use for the sat>ip server 5500 + 2*A and 5500 + 2*A + 1, where A is the adapter number. 
				6500 + 2*A and 6500 + 2*A + 1 - will be used by the sat>ip client
 
* -r --remote-rtp  remote_rtp_host: send the rtp stream to remote_rtp_host instead of the ip the connection comes from
 	* eg: -r 192.168.7.9
 
* -R --document-root directory: document root for the minisatip web page and images

* -s --satip-servers [~][*][DELSYS:][FE_ID@][source_ip/]host[:port] - specify the remote satip host and port with delivery system DELSYS, it is possible to use multiple -s 
	* [~] When using this symbol at start the `pids=all` call is replaced with `pids=0-20`
	* [*] Use TCP if -O is not specified and UDP if -O is specified
	* DELSYS - can be one of: dvbs, dvbs2, dvbt, dvbt2, dvbc, dvbc2, isdbt, atsc, dvbcb ( - DVBC_ANNEX_B ) [default: dvbs2]
	* host - the server of the satip server
	* port - rtsp port for the satip server [default: 554]
	* FE_ID - will be determined automatically
	* eg: -s 192.168.1.2 -s dvbt:192.168.1.3:554 -s dvbc:192.168.1.4
	- specifies 1 dvbs2 (and dvbs)satip server with address 192.168.1.2:554
	- specifies 1 dvbt satip server  with address 192.168.1.3:554
	- specifies 1 dvbc satip server  with address 192.168.1.4:554
	* eg: -s dvbt:[email protected]/192.168.1.2:555
	- specifies 1 dvbt adapter to satip server with address 192.168.1.2, port 555. The client will use fe=2 (indicating adapter 2 on the server) and will connect from IP address 192.168.1.100
	address 192.168.1.100 needs to be assigned to an interface on the server running minisatip.
	This feature is useful for AVM FRITZ!WLAN Repeater
	
* -6 --satip-xml <URL> Use the xml retrieved from a satip server to configure satip adapters 
	eg: --satip-xml http://localhost:8080/desc.xml 

* -O --satip-tcp Use RTSP over TCP instead of UDP for data transport 

* --satip-receive-buffer X : set the socket read buffer for connecting to SAT>IP servers to X KB. 
	- The default value is 0, corresponding to use the kernel default value
	* eg: --satip-receive-buffer  350 - to set the socket buffer to 350KB
	* eg: --satip-receive-buffer 1024 - to set the socket buffer to 1MB

* -S --slave ADAPTER1,ADAPTER2-ADAPTER4[,..]:MASTER - specify slave adapters	
	* Allows specifying bonded adapters (multiple adapters connected with a splitter to the same LNB)
	* This feature is used by FBC receivers and AXE to specify the source input of the adapter
	Only one adapter needs to be master all others needs to have this parameter specified
	eg: -S 1-2:0
	- specifies adapter 1 to 2 as slave, in this case adapter 0 is the master that controls the LNB
	- the slave adapter will not control the LNB polarity or band, but it will just change the internal frequency to tune to a different transponder
	- if there is no adapter using this link, the slave will use master adapters frontend to change the LNB polarity and band
	eg: -S 2-7:0 (default for DVB-S2 FBC), adapter 0 and 1 are masters, 2-7 slave and linked to input 0 (A)
	- all 8 adapters use physical input A to tune
	eg: -S 2-4:0,5-7:1
	- adapters 2,3,4 use physical input A to tune, while 1,5,6,7 uses input B to tune, adapter 0 and 1 are masters

* -t --cleanpsi clean the PSI from all CA information, the client will see the channel as clear if decrypted successfully

* -T --threads: enables/disable multiple threads (reduces memory consumption) (default: ENABLED)

* -u --unicable unicable_string: defines the unicable adapters (A) and their slot (S), frequency (F) and optionally the PIN for the switch:
	* The format is: A1:S1-F1[-PIN][,A2:S2-F2[-PIN][,...]]
	eg: 2:0-1284[-1111]
	* When * character is used before frequency, force 13V only for setup

* -j --jess jess_string - same format as -u 

* -w --http-host http_server[:port]: specify the host and the port (if not 80) where the xml file can be downloaded from [default: default_local_ip_address:8080] 
	* eg: -w 192.168.1.1:8080 

* -x --http-port port: port for listening on http [default: 8080]
	* eg: -x 9090 

* -X --xml PATH: the path to the xml that is provided as part of the satip protocol	
	* by default desc.xml is provided by minisatip without needing an additional file, 
	however satip.xml is included if it needs to be customized

* -y --rtsp-port rtsp_port: port for listening for rtsp requests [default: 554]
	* eg: -y 5544 
	- changing this to a port > 1024 removes the requirement for minisatip to run as root
* -1 --demux-dev [1|2|3]: the protocol used to get the data from demux
	* 0 - use dvrX device 
	* 1 - use demuxX device 
	* 2 - use dvrX device and additionally capture PSI data from demuxX device 
	* 3 - use demuxX device and additionally capture PSI data from demuxX device 
* -V --bind address: address for listening (RTSP + SSDP)
* -U --bind-http address: address for listening (HTTP)
* -J --bind-dev device: device name for binding (all services)
        * beware that only works with 1 device. loopback may not work!

* -A --virtual-diseqc mapping_string: absolute source mapping for virtual diseqc mode
	* The format is: SRC1[-END1]:AD1:DISEQC1[,SRC2:INP2:DISEQC2]
       * SRC: satellite position requested by clients (src argument for SAT>IP request minus 1, range: 0-63) (MAX_ADAPTERS 64)
       * END: end of the range for the position requested by clients (end argument for SAT>IP request minus 1, range: 0-63) (MAX_ADAPTERS 64)
       * ADAP: internal adapter (see -a and -e) (range: 0-63) (MAX_SOURCES 64)
       * DISEQC: target diseqc position of the adapter (range: 0-15) (or more if your adapter supports it)
	   * eg: 13E,19.2E on inputs 0&1 and 23.5E,28.2E on inputs 2&3:
		-A 0:0:0,0:1:0,1:0:0,1:1:1,2:2:0,2:3:0,3:2:1,3:2:2
	   * eg: 13E,19.2E on adapter 0 and 23.5E,28.2E on adapter 2&3 (source 0,1):
		-A 0-1:0:0,2-3:1:0
	* Note: Option -A is not compatible with clients requesting fe= (tvheadend)

* -3 --ca-pin mapping_string: set the pin for CIs
	* The format is: ADAPTER1:PIN,ADAPTER2-ADAPTER4:PIN
	* eg: 0:1234,2-3:4567 

* -C --ci mapping_string: disable CI+ mode for specified adapters
	* The format is: ADAPTER1:PIN,ADAPTER2-ADAPTER4
			* eg : 0,2-3

* -c --ca-channels adapter_list:maximum_number_of_channels_supported: Specify the number of channels supported by the CAM and override the CAIDs
	* The format is: ADAPTER1:[*]MAX_CHANNELS[-CAID1[-CAID2]...,ADAPTER2:MAX_CHANNELS[-CAID3[-CAID4]...] 
		 * before the MAX_CHANNELS enable 2 PMTs inside of the same CAPMT to double the number of decrypted channels
			* eg : 0:*1-100

The DDCI adapters 0 will support maximum of 1 CAPMT (2 channels because of *) and will use CAID1. If CAID is not specified it will use CAMs CAIDs
Official CAMs support 1 or 2 channels, with this option this is extended to 2 or 4
By default every CAM supports 1 channels

How to compile:

./configure

Configures minisatip for the current system (use ./configure --help for options)

To cross compile, use something like (static compilation), considering that mips-openwrt-linux-musl-gcc is the gcc executable for that platform:

./configure --host=mips-openwrt-linux-musl --enable-static

To compile the application:

make

To add custom compilation flags you can use for example:

make EXTRA_CFLAGS="-DNEEDS_SENDMMSG_SHIM"

The above command is useful if you're getting errors like sendmmsg(): errno 38: Function not implemented (usually only concerns really old systems).

To make a debug build (useful if minisatip crashes and you want to diagnose the issue):

make debug

Building a Debian package:

dpkg-buildpackage -b -us -uc

Examples:

  • In order to listen to a radio after minisatip is started open the following URL in your favorite media player:

    • on Hotbird 13E: http://MINISATIP_HOST:8080/?msys=dvbs&freq=11623&pol=v&sr=27500&pids=0,10750,254
    • Astra 19.2E: http://MINISATIP_HOST:8080/?msys=dvbs&freq=12266&pol=h&sr=27500&pids=0,851
  • Television FTA programs:

    • Astra 19.2E, Kika HD: http://MINISATIP_HOST:554/?src=1&freq=11347&pol=v&ro=0.35&msys=dvbs2&mtype=8psk&plts=on&sr=22000&fec=23&pids=0,17,18,6600,6610,6620,6630
  • msys can be one of: dvbs, dvbs2, dvbt, dvbt2, dvbc, dvbc2, atsc, isdbt, dvbcb ( - DVBC_ANNEX_B )

minisatip's People

Contributors

9000h avatar ast261 avatar bccrew avatar catalinii avatar darinatoda avatar dmarion avatar docgalaxyblock avatar dpeddi avatar heitbaum avatar jalle19 avatar kellerman avatar lars18th avatar ljalves avatar localhosthack0r avatar lucianm avatar m-reimer avatar marillat avatar melias122 avatar mildsunrise avatar mkauf avatar nautilus7 avatar neheb avatar nemon avatar nosp7m avatar okmikel avatar peos3 avatar perexg avatar reelcoder avatar shaunschembri avatar yuri666 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minisatip's Issues

lower/upper case Content-type

minisatip.c:481 should be Content-Type
minisatip.c:599 should be Content-Type
minisatip.c:610 should be Content-Type
minisatip.c:612 should be Content-Type

compile with -Wall

dvb.c:579:5: warning: implicit declaration of function 'toupper' [-Wimplicit-function-declaration]

#include <ctype.h> will fix it

dvb.c:555:2: warning: enumeration value 'SYS_UNDEFINED' not handled in switch [-Wswitch]
dvb.c:555:2: warning: enumeration value 'SYS_DVBC_ANNEX_B' not handled in switch [-Wswitch]

 switch (tp->sys)

missing default: adding that will make compiler happy

dvb.c:521:9: warning: unused variable 'tt' [-Wunused-variable]
dvb.c:444:28: warning: unused variable 'event' [-Wunused-variable]
dvb.c:439:11: warning: unused variable 'bandwidth_hz' [-Wunused-variable]
dvb.c:436:14: warning: unused variable 's' [-Wunused-variable]
dvb.c:435:6: warning: unused variable 'i' [-Wunused-variable]
dvb.c:434:6: warning: unused variable 'rc' [-Wunused-variable]
dvb.c: In function 'dvb_delsys':
dvb.c:713:6: warning: unused variable 'ds' [-Wunused-variable]
dvb.c: In function 'detect_dvb_parameters':
dvb.c:794:2: warning: value computed is not used [-Wunused-value]
dvb.c:872:4: warning: implicit declaration of function 'map_float' [-Wimplicit-function-declaration]
dvb.c: In function 'get_signal':
dvb.c:1028:28: warning: unused variable 'ev' [-Wunused-variable]
dvb.c: At top level:
dvb.c:138:20: warning: 'fe_bandwidth_tab' defined but not used [-Wunused-variable]
dvb.c:161:20: warning: 'fe_hierarchy_tab' defined but not used [-Wunused-variable]

to much CRLF or useless trailing 0

minisatip.c:345 on the end of the string ( 2 times)
minisatip.c:346 on the end of the string
minisatip.c:653 on the end of the string + trailing 0
minisatip.c:693 on the trailing 0

ssdp

SERVER: Linux/1.0 UPnP/1.1 IDL4K/1.2

may change IDL4K/1.2 to minisatip/version

feature request: unicable for dvb-s

would be nice to have unicable EN50494 and maybe also EN50607/JESS support like the octonet in minisatip, this would help people without legacy SAT plugs

unused variables

in dvb.h

define SYSTEM_DVBS 1

define SYSTEM_DVBS2 2

define SYSTEM_DVBT 3

are unused

http close missing

there is probably something missing in regards to the http protocol like

HTTP/1.0 200 OK\r\nConnection: close\r\n

SAT>IP Spec changes

Hi there is a new Version as mentioned out at SES

http://www.satip.info/sites/satip/files/resource/satip_specification_release_notes_version_1_2_2.txt
http://www.satip.info/sites/satip/files/resource/satip_specification_version_1_2_2.pdf

From the release notes:
would be a nice feature:
Section 3.4.1 added possibility for a SAT>IP server to provide a URL to a Channel List (local or remote)

may important:
Editorial
Section 3.3.2 added missing ssdp:byebye to the NTS header value

http mime type

the spec says

3.6.2 HTTP Streaming
The SAT>IP server shall also implement HTTP as a mandatory media transport protocol. The HTTP header shall contain the following MIME type: "video/MP2T".

compile warnings

I have some warnings during compile here

gcc -ggdb -fPIC -c -o minisatip.o minisatip.c
minisatip.c: In function 'hexDump':
minisatip.c:221:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
minisatip.c: In function 'read_rtsp':
minisatip.c:435:56: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
minisatip.c:441:5: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
minisatip.c: In function 'posix_signal_handler':
minisatip.c:703:3: warning: #warning No arch defined [-Wcpp]
minisatip.c: In function 'mymalloc':
minisatip.c:779:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
minisatip.c: In function 'myfree':
minisatip.c:789:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
gcc -ggdb -fPIC -c -o socketworks.o socketworks.c
gcc -ggdb -fPIC -c -o stream.o stream.c
gcc -ggdb -fPIC -c -o dvb.o dvb.c
gcc -ggdb -fPIC -c -o adapter.o adapter.c
gcc -ggdb -fPIC -o minisatip minisatip.o socketworks.o stream.o dvb.o adapter.o -lpthread -lrt
root@yavdr:/home/yavdr/satip/minisatip-master# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

missing space

strream.c:57 there is a space missing after o=- and I'm not sure if negative values here are a issue

from the spec

v=0
o=- 5678901234 7890123456 IN IP4 192.168.128.5
s=SatIPServer:1 4
t=0 0

“o=” gives the originator of the session “-“ IN for internet and the IP address of the
server. The session-id and session-version values shall be present but are not used currently.

satip server test script

maybe someone has time to make a script to test the RTSP engine against the spec
here are a free tool which could make this a easy task

describre

stream.c:69

should it be not be a=inactive here?

loop on close sid?

this was with DVBViever Lite
you may can reproduce it by click the stop button when watching a channel

[Thu Jan 15 00:04:57.634 2015]: starting init_hw 1
[Thu Jan 15 00:04:57.634 2015]: detect_dvb_parameters (S)-> addpids=18
[Thu Jan 15 00:04:57.634 2015]: detect_dvb_parameters (E) -> src=-1, fe=-1, freq=-1, sr=-1, pol=-1, ro=-1, msys=-1, mtype=-1, pltf=-1, bw=-1, inv=-1, pids=NULL - apids=18 - dpids=NULL
[Thu Jan 15 00:04:57.634 2015]: Setup stream 0 parameters, sock_id 6, handle 14
[Thu Jan 15 00:04:57.634 2015]: copy_dvb_param start -> src=1, fe=0, freq=11954000, sr=27500000, pol=H, ro=0, msys=5, mtype=0, pltf=1, bw=8000000, inv=2, pids=0, apids=NULL, dpids=NULL
[Thu Jan 15 00:04:57.634 2015]: copy_dvb_parameters -> src=1, fe=0, freq=11954000, sr=27500000, pol=H, ro=0, msys=5, mtype=0, pltf=1, bw=8000000, inv=2, pids=0, apids=18, dpids=NULL
[Thu Jan 15 00:04:57.634 2015]: Play for stream 0, adapter -1, sock_id 6 handle 14
[Thu Jan 15 00:04:57.634 2015]: get free adapter -1 - a[0] => e:1 m:-1 sid_cnt:0 f:0

[Thu Jan 15 00:04:57.634 2015]: Got adapter 0 on socket 6
[Thu Jan 15 00:04:57.634 2015]: set adapter 0 for stream 0 m:0 s:1
[Thu Jan 15 00:04:57.634 2015]: setting DVB parameters for adapter 0 - master_sid 0 sid 0 old f:0
[Thu Jan 15 00:04:57.634 2015]: deleting pids on adapter 0, sid -1, pids=NULL
[Thu Jan 15 00:04:57.634 2015]: deleting pids on adapter 0, sid -1, pids=NULL
[Thu Jan 15 00:04:57.634 2015]: copy_dvb_param start -> src=0, fe=0, freq=0, sr=0, pol=, ro=3, msys=6, mtype=0, pltf=2, bw=8000000, inv=2, pids=NULL, apids=NULL, dpids=NULL
[Thu Jan 15 00:04:57.634 2015]: copy_dvb_parameters -> src=1, fe=0, freq=11954000, sr=27500000, pol=H, ro=0, msys=5, mtype=0, pltf=1, bw=8000000, inv=2, pids=0, apids=18, dpids=NULL
[Thu Jan 15 00:04:57.634 2015]: found already existing pid 18 on pos 0 flags 2
[Thu Jan 15 00:04:58.581 2015]: tunning to 11954000(1354000) sr:27500000 fec:FEC_3_4 delsys:SYS_DVBS mod:QPSK rolloff:ROLLOFF_35 pilot:PILOT_OFF
[Thu Jan 15 00:04:58.581 2015]: setting filter on PID 18 for fd 16
[Thu Jan 15 00:04:58.582 2015]: reply -> 14:
RTSP/1.0 200 OK
Cseq: 3
Transport: RTP/AVP;unicast;client_port=52042-52043;source=192.168.178.101;server_port=5500-5501
Session:00619d60;timeout=30
com.ses.streamID: 1

[Thu Jan 15 00:04:58.830 2015]: read RTSP (from handle 14 sock_id 6): PLAY rtsp://192.168.178.101:554/stream=1?addpids=210,220,0,200,230 RTSP/1.0
CSeq: 4
Session: 00619d60

[Thu Jan 15 00:04:58.830 2015]: starting init_hw 1
[Thu Jan 15 00:04:58.830 2015]: detect_dvb_parameters (S)-> addpids=210,220,0,200,230
[Thu Jan 15 00:04:58.830 2015]: detect_dvb_parameters (E) -> src=-1, fe=-1, freq=-1, sr=-1, pol=-1, ro=-1, msys=-1, mtype=-1, pltf=-1, bw=-1, inv=-1, pids=NULL - apids=210,220,0,200,230 - dpids=NULL
[Thu Jan 15 00:04:58.830 2015]: Setup stream 0 parameters, sock_id 6, handle 14
[Thu Jan 15 00:04:58.830 2015]: copy_dvb_param start -> src=1, fe=0, freq=11954000, sr=27500000, pol=H, ro=0, msys=5, mtype=0, pltf=1, bw=8000000, inv=2, pids=NULL, apids=NULL, dpids=NULL
[Thu Jan 15 00:04:58.830 2015]: copy_dvb_parameters -> src=1, fe=0, freq=11954000, sr=27500000, pol=H, ro=0, msys=5, mtype=0, pltf=1, bw=8000000, inv=2, pids=NULL, apids=210,220,0,200,230, dpids=NULL
[Thu Jan 15 00:04:58.830 2015]: Play for stream 0, adapter 0, sock_id 6 handle 14
[Thu Jan 15 00:04:58.830 2015]: setting DVB parameters for adapter 0 - master_sid 0 sid 0 old f:11954000
[Thu Jan 15 00:04:58.830 2015]: copy_dvb_param start -> src=1, fe=0, freq=11954000, sr=27500000, pol=H, ro=0, msys=5, mtype=0, pltf=1, bw=8000000, inv=2, pids=0, apids=210,220,0,200,230, dpids=NULL
[Thu Jan 15 00:04:58.830 2015]: copy_dvb_parameters -> src=1, fe=0, freq=11954000, sr=27500000, pol=H, ro=0, msys=5, mtype=0, pltf=1, bw=8000000, inv=2, pids=NULL, apids=210,220,0,200,230, dpids=NULL
[Thu Jan 15 00:04:58.830 2015]: not tunning for SID 0 (do_tune=0, master_sid=0)
[Thu Jan 15 00:04:58.830 2015]: setting filter on PID 210 for fd 17
[Thu Jan 15 00:04:58.830 2015]: setting filter on PID 220 for fd 18
[Thu Jan 15 00:04:58.830 2015]: setting filter on PID 0 for fd 19
[Thu Jan 15 00:04:58.830 2015]: setting filter on PID 200 for fd 20
[Thu Jan 15 00:04:58.830 2015]: setting filter on PID 230 for fd 21
[Thu Jan 15 00:04:58.830 2015]: reply -> 14:
RTSP/1.0 200 OK
Cseq: 4
Transport: RTP/AVP;unicast;client_port=52042-52043;source=192.168.178.101;server_port=5500-5501
Session:00619d60;timeout=30
com.ses.streamID: 1

[Thu Jan 15 00:04:58.197 2015]: get_signal took 143 ms for adapter 0 handle 9 (status: 1, ber: 0, strength:0, snr: 48200)
[Thu Jan 15 00:04:59.639 2015]: bandwidth 617KB/s, total bandwidth: 0 MB, HD: 0 MB, SD: 0 MB, Other: 0 MB, notify: 0
[Thu Jan 15 00:05:00.649 2015]: bandwidth 744KB/s, total bandwidth: 1 MB, HD: 0 MB, SD: 1 MB, Other: 0 MB, notify: 0
[Thu Jan 15 00:05:01.660 2015]: bandwidth 735KB/s, total bandwidth: 2 MB, HD: 0 MB, SD: 2 MB, Other: 0 MB, notify: 0
[Thu Jan 15 00:05:02.670 2015]: bandwidth 708KB/s, total bandwidth: 2 MB, HD: 0 MB, SD: 2 MB, Other: 0 MB, notify: 0
[Thu Jan 15 00:05:03.680 2015]: bandwidth 699KB/s, total bandwidth: 3 MB, HD: 0 MB, SD: 3 MB, Other: 0 MB, notify: 0
[Thu Jan 15 00:05:04.691 2015]: bandwidth 753KB/s, total bandwidth: 4 MB, HD: 0 MB, SD: 4 MB, Other: 0 MB, notify: 0
[Thu Jan 15 00:05:05.701 2015]: bandwidth 744KB/s, total bandwidth: 5 MB, HD: 0 MB, SD: 4 MB, Other: 0 MB, notify: 0
[Thu Jan 15 00:05:05.070 2015]: ssdp_reply -> 192.168.178.112
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Thu Jan 15 00:05:05.070 2015
EXT:
LOCATION: http://192.168.178.101:8080/desc.xml
SERVER: Linux/1.0 UPnP/1.1 IDL4K/1.2
ST: urn:ses-com:device:SatIPServer:1
USN: uuid:11223344-9999-0000-b7ae-00224d9d3805::urn:ses-com:device:SatIPServer:1
BOOTID.UPNP.ORG: 7
CONFIGID.UPNP.ORG: 0
DEVICEID.SES.COM: 1

[Thu Jan 15 00:05:05.070 2015]: ssdp_reply -> 192.168.178.112
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Thu Jan 15 00:05:05.070 2015
EXT:
LOCATION: http://192.168.178.101:8080/desc.xml
SERVER: Linux/1.0 UPnP/1.1 IDL4K/1.2
ST: urn:ses-com:device:SatIPServer:1
USN: uuid:11223344-9999-0000-b7ae-00224d9d3805::urn:ses-com:device:SatIPServer:1
BOOTID.UPNP.ORG: 8
CONFIGID.UPNP.ORG: 0
DEVICEID.SES.COM: 1

[Thu Jan 15 00:05:05.070 2015]: ssdp_reply -> 192.168.178.112
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Thu Jan 15 00:05:05.070 2015
EXT:
LOCATION: http://192.168.178.101:8080/desc.xml
SERVER: Linux/1.0 UPnP/1.1 IDL4K/1.2
ST: urn:ses-com:device:SatIPServer:1
USN: uuid:11223344-9999-0000-b7ae-00224d9d3805::urn:ses-com:device:SatIPServer:1
BOOTID.UPNP.ORG: 9
CONFIGID.UPNP.ORG: 0
DEVICEID.SES.COM: 1

[Thu Jan 15 00:05:05.070 2015]: ssdp_reply -> 192.168.178.112
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Thu Jan 15 00:05:05.070 2015
EXT:
LOCATION: http://192.168.178.101:8080/desc.xml
SERVER: Linux/1.0 UPnP/1.1 IDL4K/1.2
ST: urn:ses-com:device:SatIPServer:1
USN: uuid:11223344-9999-0000-b7ae-00224d9d3805::urn:ses-com:device:SatIPServer:1
BOOTID.UPNP.ORG: 10
CONFIGID.UPNP.ORG: 0
DEVICEID.SES.COM: 1

[Thu Jan 15 00:05:05.072 2015]: ssdp_reply -> 192.168.178.112
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Thu Jan 15 00:05:05.072 2015
EXT:
LOCATION: http://192.168.178.101:8080/desc.xml
SERVER: Linux/1.0 UPnP/1.1 IDL4K/1.2
ST: urn:ses-com:device:SatIPServer:1
USN: uuid:11223344-9999-0000-b7ae-00224d9d3805::urn:ses-com:device:SatIPServer:1
BOOTID.UPNP.ORG: 11
CONFIGID.UPNP.ORG: 0
DEVICEID.SES.COM: 1

[Thu Jan 15 00:05:05.072 2015]: ssdp_reply -> 192.168.178.112
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Thu Jan 15 00:05:05.072 2015
EXT:
LOCATION: http://192.168.178.101:8080/desc.xml
SERVER: Linux/1.0 UPnP/1.1 IDL4K/1.2
ST: urn:ses-com:device:SatIPServer:1
USN: uuid:11223344-9999-0000-b7ae-00224d9d3805::urn:ses-com:device:SatIPServer:1
BOOTID.UPNP.ORG: 12
CONFIGID.UPNP.ORG: 0
DEVICEID.SES.COM: 1

[Thu Jan 15 00:05:05.076 2015]: sockets_add: handle 22 (type 1) returning socket index 7 [192.168.178.112:50367]
[Thu Jan 15 00:05:05.086 2015]: read HTTP from 22 sid: -1: GET /desc.xml HTTP/1.0
Host: 192.168.178.101:8080
Keep-Alive: 300
Connection: keep-alive
User-Agent: Mozilla/4.0 (compatible; Synapse)

[Thu Jan 15 00:05:05.086 2015]: starting init_hw 1
[Thu Jan 15 00:05:05.087 2015]: starting init_hw 1
[Thu Jan 15 00:05:05.087 2015]: reply -> 22:
HTTP/1.0 200 OK
Cseq: 0
Content-type: text/xml
Content-Length: 1026

11
urn:ses-com:device:SatIPServer:1minisatip
catahttp://github.com/catalinii/minisatip
long user-friendly title minisatip0100
http://github.com/catalinii/minisatip 0100
uuid:11223344-9999-0000-b7ae-00224d9d3805Universal Product Code image/format
horizontal pixels vertical pixelscolor depthURL to icon
http://github.com/catalinii/minisatip
<satip:X_SATIPCAP xmlns:satip="urn:ses-com:satip">DVBS2-2,DVBT-0/satip:X_SATIPCAP

[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
[Thu Jan 15 00:05:05.088 2015]: select_and_execute[7]: Close on socket 22 (sid:-1) from 192.168.178.112:50367 - type http failure 0:Success
....

No RTCP packet type 204

This relates maybe to the missing signal quality, lock status on the client side like the android signal meter tool

The SAT>IP specification specifies the delivery of RTCP packets together with the RTP packets. Those RTCP packets of type 204 contain the status information of the associated stream.
Exampe: ver1.2;src=1; tuner1,240,1,7,112,,dvbc,,,,6900,34;pids=0,16,17,18,20
This also includes the status information (e.g. signal quality, lock status, etc.) of the tuner.

this is the client side:
https://code.google.com/p/satip/source/browse/satip/satip_rtp.c?r=a72d5083b2a54c2611bb2039cda0a076500442f5#52

Use as SAT>IP Client?

Hi,

thanks for this cool software. i have read in the readme that it also can emulate DVB-S Cards on a system and connect to the Server part. Is it also possible to use the client part to connect to a normal SAT>IP Server like the Inverto iLNB?

Thanks in Advance

cannot terminate minisatip

Hi,
minisatip works as far as expected, but i'am not able to terminate it:

satip ~ # pidof minisatip
1773
satip ~ # kill -9 1773
satip ~ # pidof minisatip
1773
satip ~ #

cosmetic: missing Status code 455

Status code 455 – Method Not Valid in This State

it's probably not needed at the moment, there is no multicast atm :-)

there are probably more missing

Spec
3.5.14 Status Code Definitions

log time stamp

Hello,

thank you for the first linux sat>IP server!

I have some issues, will catch up with the issues later, so would it be possible to change the run time stamp to real time stamp?
This is because the -l option is very verbose and the real time stamp would make debugging much easier.
You don't need to change it, if you don't like, just pass me the the time stamp location in the source code and I will create a diff for my own.

And please go on with this great developing, linux needs a sat>IP server daemon.

Kind regards

vdr.tuxnet

opts.config_id

may add opts.config_id = 1 to minisatip.c and xml for future and easy use

Log into Syslog?

Is it possible to make minisatip able to log into the syslog?

BTW: The Parameter "-l" is not explained in Readme.txt.

code cleanup for multicast addr

cosmetic issue

minisatip.c
opts.disc_host = "239.255.255.250";
"HOST: 239.255.255.250:1900\r\n"
stream.c
strcpy (p->dest, "239.255.255.250");

describe correct mtype

can you please add the correct msys name to:

adapter.c:635

sprintf (dad, "ver=1.0;src=%d;tuner=%d,%d,%d,%d,%d,%c,dvbs,,,,%d,;pids=",

so that dvbs2, dvbt2 etc is correct

it may needs another function like modulation_string()

no issue oftopic

only to collect info here
there is a slightly different implementation on the server side out called Big2Small by Ali STB's

http://www.satelliteguys.us/xen/threads/trying-to-stream-video-from-amiko-mini-hd-se-to-windows.344995/

Big2Small is using port 554 and 'GET' style request parameters to specify what I requested to watch. In this case it was NBC West on C-Band.

rtsp://192.168.2.101:554/?alisatid=16&freq=3780&pol=v&msys=dvbs2&mtype=8psk&ro=0.35&plts=on&sr=29999&fec=0&camode=0&vpid=520&apid=781,782,783,784&ttxpid=8191&subtpid=8191&pmt=267&prognumber=12&pids=520,781,782,783,784,8191,8191,520,267

Finally, Big2Small starts playing the stream by sending this:

rtsp://192.168.2.101:554/stream=1

versions number issue

    if (t->sys == SYS_DVBS || t->sys == SYS_DVBS2)
            sprintf (dad, "ver=1.1;src=%d;tuner=%d,%d,%d,%d,%d,%c,dvbs,,,,%d,;pids=",

DVB-S should have ver=1.0
DVB-T should have ver=1.1
DVB-C should have ver=1.2

pids=all is handled but whats about pids=none

from the spec

Please note that when no signal is being received, the signal is being lost, or no PID is available (also e.g. when “pids=none”), the SAT>IP server shall nevertheless issue an empty RTP packet at least every 100ms (accompanied by an RTCP announcement stream).

check: RTP port

only for verify

One for RTP; one for RTCP. By convention, the RTP port is should be even.

variable wording

in stream.h/c is a variable https which sounds like https:// but its not, I know this is real cosmetic.

channel scan with Panasonic TV client did not work

I did a quick test with my Pana TV and the client is not able to find channels, dvbviewer lite is working.

[Thu Jan 15 18:12:30.564 2015]: ssdp_reply -> 192.168.178.124
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Thu Jan 15 18:12:30.564 2015
EXT:
LOCATION: http://192.168.178.101:8080/desc.xml
SERVER: Linux/1.0 UPnP/1.1 IDL4K/1.2
ST: urn:ses-com:device:SatIPServer:1
USN: uuid:11223344-9999-0000-b7ae-00224d9d3805::urn:ses-com:device:SatIPServer:1
BOOTID.UPNP.ORG: 114
CONFIGID.UPNP.ORG: 0
DEVICEID.SES.COM: 1

[Thu Jan 15 18:12:35.187 2015]: sockets_add: handle 9 (type 1) returning socket index 4 [192.168.178.124:22932]
[Thu Jan 15 18:12:35.189 2015]: read HTTP from 9 sid: -1: GET /desc.xml HTTP/1.1
User-Agent: Panasonic MIL DLNA CP UPnP/1.0 DLNADOC/1.50
Host: 192.168.178.101:8080
X-PANASONIC-Registration: NTVBUzc1MF9TZXJpZXMA
X-PANASONIC-DMP-Profile: MPEG_PS_PAL JPEG_SM PV_DIVX_DIV3 PV_DIVX_DIV4 PV_DIVX_DIVX PV_DIVX_DX50 PV_DRM_DIVX_DIV3 PV_DRM_DIVX_DIV4 PV_DRM_DIVX_DIVX PV_DRM_DIVX_DX50

[Thu Jan 15 18:12:35.189 2015]: starting init_hw 0
[Thu Jan 15 18:12:35.189 2015]: trying to open [0] adapter 0 and frontend 0
[Thu Jan 15 18:12:35.189 2015]: opened DVB adapter 0 fe:10 dvr:11
[Thu Jan 15 18:12:35.189 2015]: Done setting DVR buffer to 5775360 bytes
[Thu Jan 15 18:12:35.189 2015]: deleting pids on adapter 0, sid -1, pids=NULL
[Thu Jan 15 18:12:35.205 2015]: sockets_add: handle 11 (type 5) returning socket index 5 [0.0.0.0:0]
[Thu Jan 15 18:12:35.205 2015]: done opening adapter 0 fe_sys 6
[Thu Jan 15 18:12:35.205 2015]: trying to open [1] adapter 0 and frontend 1
[Thu Jan 15 18:12:35.206 2015]: opened DVB adapter 1 fe:12 dvr:14
[Thu Jan 15 18:12:35.206 2015]: Done setting DVR buffer to 5775360 bytes
[Thu Jan 15 18:12:35.206 2015]: deleting pids on adapter 1, sid -1, pids=NULL
[Thu Jan 15 18:12:35.222 2015]: sockets_add: handle 14 (type 5) returning socket index 6 [0.0.0.0:0]
[Thu Jan 15 18:12:35.222 2015]: done opening adapter 1 fe_sys 6
[Thu Jan 15 18:12:35.222 2015]: done init_hw 1
[Thu Jan 15 18:12:35.222 2015]: starting init_hw 1
[Thu Jan 15 18:12:35.222 2015]: reply -> 9:
HTTP/1.0 200 OK
Cseq: 0
Content-type: text/xml
Content-Length: 1026

11
urn:ses-com:device:SatIPServer:1minisatip
catahttp://github.com/catalinii/minisatip
long user-friendly title minisatip0100
http://github.com/catalinii/minisatip 0100
uuid:11223344-9999-0000-b7ae-00224d9d3805Universal Product Code image/format
horizontal pixels vertical pixelscolor depthURL to icon
http://github.com/catalinii/minisatip
<satip:X_SATIPCAP xmlns:satip="urn:ses-com:satip">DVBS2-2,DVBT-0/satip:X_SATIPCAP

[Thu Jan 15 18:12:35.227 2015]: select_and_execute[4]: Close on socket 9 (sid:-1) from 192.168.178.124:22932 - type http failure 0:Success
[Thu Jan 15 18:12:35.227 2015]: sockets_del: 4 -> handle 9, sid -1
[Thu Jan 15 18:12:35.227 2015]: Closing stream -1
[Thu Jan 15 18:12:35.227 2015]: sockets_del: 4 Last open socket is at index 6 current_handle 9
[Thu Jan 15 18:12:35.227 2015]: Delete socket 4 done: sid -1
[Thu Jan 15 18:12:37.491 2015]: ssdp_reply -> 192.168.178.124
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Thu Jan 15 18:12:37.491 2015
EXT:
LOCATION: http://192.168.178.101:8080/desc.xml
SERVER: Linux/1.0 UPnP/1.1 IDL4K/1.2
USN: uuid:11223344-9999-0000-b7ae-00224d9d3805::urn:ses-com:device:SatIPServer:1
BOOTID.UPNP.ORG: 115
CONFIGID.UPNP.ORG: 0
DEVICEID.SES.COM: 1

[Thu Jan 15 18:12:37.491 2015]: ssdp_reply -> 192.168.178.124
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Thu Jan 15 18:12:37.491 2015
EXT:
LOCATION: http://192.168.178.101:8080/desc.xml
SERVER: Linux/1.0 UPnP/1.1 IDL4K/1.2
ST: urn:ses-com:device:SatIPServer:1
USN: uuid:11223344-9999-0000-b7ae-00224d9d3805::urn:ses-com:device:SatIPServer:1
BOOTID.UPNP.ORG: 116
CONFIGID.UPNP.ORG: 0
DEVICEID.SES.COM: 1

SNR BER value ...

I would like to suggest a small change
I believe BER is not needed

and propose to change the calc. to

   *strength =  *strength >> 8;
    *snr =  *snr >> 12;

then it looks like this with my card
get_signal took 144 ms for adapter 0 handle 9 (status: 1, ber: 0, strength:189, snr: 12)

dvbc2 support

unfortunatly I cannot test this no hardware/signal :-(

but as we do have dvbc in place the differences a small in the specs

some parameters are defenetly different c2tft,plp,ds
a=fmtp:33 ver=1.2;tuner=,,,,,,,,,,
,,;pids=,…,

for tune a channel the delsys property for dvbc2 need to be set

DTV_STREAM_ID,.u.data = PLP

PLP = 16

if catalinii will add it may someone can with access to dvbc2 can test

handling of bootid

it's may cosmetic in this stage of the code but it's missing.

the Spec says
The BOOTID.UPNP.ORG value shall increase each time that the device first announces on the network. It shall be stored in non-volatile memory

so it may got stored in a file or the handling could be done via cli option

offtopic: future use

serverside encryption is missing in the spec but implemted by DD octonet and dvbviewer RS

if we get a x_pmt parameter which is not in the spec but introduced by DD, we can adopt this also

x_pmt parameter with PMT pid=x should be used for the TuningDetail selection

clients recognise the if the feature is there or not on the OctopusNet so we can emulate this if needed.

in debviewer RS
UseTCP =

0 = No CI,

1 = Any CI (x_pmt  Session-Start and encrypted channel)

2 = CI #1 (x_pmt for encrypted channel Sendern, x_ci=1)

3 = CI #2 (x_pmt for encrypted channel Sendern, x_ci=2)

?src=1&freq=11303&pol=h&msys=dvbs&sr=22000&pids=0,107,1920,1925,1921,1922,1923&x_pmt=107

VLC did not play

as we know VDR satip plugin and dvbviewer/DD-TV is working VLC is not unfortunatly

here are a log
Starting minisatip version 0.1.3, dvbapi version: 0504
[Sun Jan 18 19:20:12.000 2015]: New UDP socket 3 bound to 0.0.0.0:1900
[Sun Jan 18 19:20:12.001 2015]: setting multicast for 239.255.255.250
[Sun Jan 18 19:20:12.001 2015]: New UDP socket 4 bound to 239.255.255.250:1900
[Sun Jan 18 19:20:12.001 2015]: New UDP socket 7 bound to 0.0.0.0:5500
[Sun Jan 18 19:20:12.001 2015]: New UDP socket 8 bound to 0.0.0.0:5501
[Sun Jan 18 19:20:12.001 2015]: sockets_add: handle 3 (type 0) returning socket index 0 [0.0.0.0:0]
[Sun Jan 18 19:20:12.001 2015]: sockets_add: handle 4 (type 0) returning socket index 1 [0.0.0.0:0]
[Sun Jan 18 19:20:12.001 2015]: sockets_add: handle 5 (type 2) returning socket index 2 [0.0.0.0:0]
[Sun Jan 18 19:20:12.001 2015]: sockets_add: handle 6 (type 2) returning socket index 3 [0.0.0.0:0]
[Sun Jan 18 19:20:12.001 2015]: starting init_hw 0
[Sun Jan 18 19:20:12.002 2015]: trying to open [0] adapter 0 and frontend 0
adapter.c:103 allocation_wrapper malloc returns 0x108ccf0
[Sun Jan 18 19:20:12.002 2015]: opened DVB adapter 0 fe:9 dvr:10
[Sun Jan 18 19:20:12.003 2015]: Done setting DVR buffer to 5775360 bytes
[Sun Jan 18 19:20:12.003 2015]: deleting pids on adapter 0, sid -1, pids=NULL
[Sun Jan 18 19:20:12.535 2015]: sockets_add: handle 10 (type 5) returning socket index 4 [0.0.0.0:0]
[Sun Jan 18 19:20:12.535 2015]: done opening adapter 0 fe_sys 1
[Sun Jan 18 19:20:12.535 2015]: trying to open [1] adapter 1 and frontend 0
adapter.c:103 allocation_wrapper malloc returns 0x108f100
[Sun Jan 18 19:20:12.535 2015]: opened DVB adapter 1 fe:11 dvr:12
[Sun Jan 18 19:20:12.536 2015]: Done setting DVR buffer to 5775360 bytes
[Sun Jan 18 19:20:12.536 2015]: deleting pids on adapter 1, sid -1, pids=NULL
[Sun Jan 18 19:20:12.591 2015]: sockets_add: handle 12 (type 5) returning socket index 5 [0.0.0.0:0]
[Sun Jan 18 19:20:12.591 2015]: done opening adapter 1 fe_sys 6
[Sun Jan 18 19:20:12.591 2015]: trying to open [2] adapter 2 and frontend 0
adapter.c:103 allocation_wrapper malloc returns 0x1091510
[Sun Jan 18 19:20:12.591 2015]: opened DVB adapter 2 fe:13 dvr:14
[Sun Jan 18 19:20:12.592 2015]: Done setting DVR buffer to 5775360 bytes
[Sun Jan 18 19:20:12.592 2015]: deleting pids on adapter 2, sid -1, pids=NULL
[Sun Jan 18 19:20:12.619 2015]: sockets_add: handle 14 (type 5) returning socket index 6 [0.0.0.0:0]
[Sun Jan 18 19:20:12.619 2015]: done opening adapter 2 fe_sys 16
[Sun Jan 18 19:20:12.619 2015]: done init_hw 1
Initializing with 3 devices
[Sun Jan 18 19:20:12.820 2015]: ssdp_discovery fd: 3 -> NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=1800
LOCATION: http://192.168.178.133:8080/desc.xml
NT: upnp:rootdevice
NTS: ssdp:alive
SERVER: Linux/1.0 UPnP/1.1 IDL4K/1.2
USN: uuid:11223344-9999-0000-b7ae-0040caa2c79d::upnp:rootdevice
BOOTID.UPNP.ORG: 6
CONFIGID.UPNP.ORG: 0
DEVICEID.SES.COM: 9

[Sun Jan 18 19:20:21.438 2015]: sockets_add: handle 16 (type 1) returning socket index 7 [192.168.178.112:51086]
[Sun Jan 18 19:20:21.447 2015]: read RTSP (from handle 16 sock_id 7): OPTIONS rtsp://192.168.178.133:554/?freq=338.000&msys=dvbc&sr=6900&mtype=256qam&pids=0,100,101,104,102,103,106 RTSP/1.0
CSeq: 2
User-Agent: LibVLC/2.2.0-rc1 (LIVE555 Streaming Media v2014.07.25)

[Sun Jan 18 19:20:21.448 2015]: reply -> 16 (CL:0) :
RTSP/1.0 200 OK
Cseq: 2
Public: OPTIONS, DESCRIBE, SETUP, PLAY, TEARDOWN

[Sun Jan 18 19:20:21.449 2015]: read RTSP (from handle 16 sock_id 7): DESCRIBE rtsp://192.168.178.133:554/?freq=338.000&msys=dvbc&sr=6900&mtype=256qam&pids=0,100,101,104,102,103,106 RTSP/1.0
CSeq: 3
User-Agent: LibVLC/2.2.0-rc1 (LIVE555 Streaming Media v2014.07.25)
Accept: application/sdp

[Sun Jan 18 19:20:21.449 2015]: starting init_hw 1
[Sun Jan 18 19:20:21.449 2015]: starting init_hw 1
[Sun Jan 18 19:20:21.449 2015]: starting init_hw 1
[Sun Jan 18 19:20:21.449 2015]: reply -> 16 (CL:69) :
RTSP/1.0 200 OK
Cseq: 3
Public: OPTIONS, DESCRIBE, SETUP, PLAY, TEARDOWN
Content-Length: 69

v=0
o=--1 -1 IN IPV4 192.168.178.133
s=SatIPServer:1 1 1 1
t=0 0

[Sun Jan 18 19:20:21.451 2015]: select_and_execute[7]: Close on socket 16 (sid:-1) from 192.168.178.112:51086 - type rtsp failure 0:Success
[Sun Jan 18 19:20:21.451 2015]: sockets_del: 7 -> handle 16, sid -1
[Sun Jan 18 19:20:21.451 2015]: Closing stream -1
[Sun Jan 18 19:20:21.451 2015]: sockets_del: 7 Last open socket is at index 6 current_handle 16
[Sun Jan 18 19:20:21.451 2015]: Delete socket 7 done: sid -1
[Sun Jan 18 19:20:21.454 2015]: sockets_add: handle 16 (type 1) returning socket index 7 [192.168.178.112:51089]
[Sun Jan 18 19:20:21.454 2015]: read RTSP (from handle 16 sock_id 7): OPTIONS rtsp://192.168.178.133:554 RTSP/1.0

Not a complete request RTSP_request read_bytes=45 ends with: 2E300D0A
[Sun Jan 18 19:20:21.456 2015]: read RTSP (from handle 16 sock_id 7): CSeq: 1
User-Agent: RealMedia Player Version 6.0.9.1235 (linux-2.0-libc6-i386-gcc2.95)
ClientChallenge: 9e26d33f2984236010ef6253fb1887f7
PlayerStarttime: [28/03/2003:22:50:23 00:00]
CompanyID: KnKV4M4I/B2FjJ1TToLycw==
GUID: 00000000-0000-0000-0000-000000000000
RegionData: 0
ClientID: Linux_2.4_6.0.9.1235_play32_RN01_EN_586

[Sun Jan 18 19:20:41.394 2015]: select_and_execute[7]: Close on socket 16 (sid:-1) from 192.168.178.112:51089 - type rtsp failure 0:Success
[Sun Jan 18 19:20:41.394 2015]: sockets_del: 7 -> handle 16, sid -1
[Sun Jan 18 19:20:41.394 2015]: Closing stream -1
[Sun Jan 18 19:20:41.394 2015]: sockets_del: 7 Last open socket is at index 6 current_handle 16
[Sun Jan 18 19:20:41.394 2015]: Delete socket 7 done: sid -1
[Sun Jan 18 19:20:49.767 2015]: ssdp_reply fd: 3 -> 192.168.178.120
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Sun Jan 18 19:20:49.767 2015
EXT:
LOCATION: http://192.168.178.133:8080/desc.xml
SERVER: Linux/1.0 UPnP/1.1 IDL4K/1.2
ST: urn:ses-com:device:SatIPServer:1
USN: uuid:11223344-9999-0000-b7ae-0040caa2c79d::urn:ses-com:device:SatIPServer:1
BOOTID.UPNP.ORG: 6
CONFIGID.UPNP.ORG: 0
DEVICEID.SES.COM: 9

[Sun Jan 18 19:20:49.767 2015]: ssdp_reply fd: 3 -> 192.168.178.120
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Sun Jan 18 19:20:49.767 2015
EXT:
LOCATION: http://192.168.178.133:8080/desc.xml
SERVER: Linux/1.0 UPnP/1.1 IDL4K/1.2
ST: urn:ses-com:device:SatIPServer:1
USN: uuid:11223344-9999-0000-b7ae-0040caa2c79d::urn:ses-com:device:SatIPServer:1
BOOTID.UPNP.ORG: 6
CONFIGID.UPNP.ORG: 0
DEVICEID.SES.COM: 9

^Cselect_and_execute: select() error: Interrupted system call
[Sun Jan 18 19:20:50.807 2015]: sockets_del: 6 -> handle 14, sid 2
[Sun Jan 18 19:20:50.807 2015]: closing DVR socket -1 pos 6 aid 2
[Sun Jan 18 19:20:50.807 2015]: closing adapter 2 -> fe:13 dvr:14
[Sun Jan 18 19:20:50.807 2015]: deleting pids on adapter 2, sid -1, pids=NULL
[Sun Jan 18 19:20:50.807 2015]: sockets_del: 6 -> handle -1, sid 2
[Sun Jan 18 19:20:50.807 2015]: done closing adapter 2
[Sun Jan 18 19:20:50.808 2015]: sockets_del: 6 Last open socket is at index 5 current_handle 14
[Sun Jan 18 19:20:50.808 2015]: sockets_del: 5 -> handle 12, sid 1
[Sun Jan 18 19:20:50.808 2015]: closing DVR socket -1 pos 5 aid 1
[Sun Jan 18 19:20:50.808 2015]: closing adapter 1 -> fe:11 dvr:12
[Sun Jan 18 19:20:50.808 2015]: deleting pids on adapter 1, sid -1, pids=NULL
[Sun Jan 18 19:20:50.808 2015]: sockets_del: 5 -> handle -1, sid 1
[Sun Jan 18 19:20:50.808 2015]: done closing adapter 1
[Sun Jan 18 19:20:50.808 2015]: sockets_del: 5 Last open socket is at index 4 current_handle 12
[Sun Jan 18 19:20:50.808 2015]: sockets_del: 4 -> handle 10, sid 0
[Sun Jan 18 19:20:50.808 2015]: closing DVR socket -1 pos 4 aid 0
[Sun Jan 18 19:20:50.808 2015]: closing adapter 0 -> fe:9 dvr:10
[Sun Jan 18 19:20:50.808 2015]: deleting pids on adapter 0, sid -1, pids=NULL
[Sun Jan 18 19:20:50.808 2015]: sockets_del: 4 -> handle -1, sid 0
[Sun Jan 18 19:20:50.808 2015]: done closing adapter 0
[Sun Jan 18 19:20:50.809 2015]: sockets_del: 4 Last open socket is at index 3 current_handle 10
[Sun Jan 18 19:20:50.809 2015]: sockets_del: 3 -> handle 6, sid -1
[Sun Jan 18 19:20:50.809 2015]: sockets_del: 3 Last open socket is at index 2 current_handle 6
[Sun Jan 18 19:20:50.809 2015]: sockets_del: 2 -> handle 5, sid -1
[Sun Jan 18 19:20:50.809 2015]: sockets_del: 2 Last open socket is at index 1 current_handle 5
[Sun Jan 18 19:20:50.809 2015]: sockets_del: 1 -> handle 4, sid -1
[Sun Jan 18 19:20:50.809 2015]: sockets_del: 1 Last open socket is at index 0 current_handle 4
adapter.c:692 allocation_wrapper free called with argument 0x108ccf0 - done free
adapter.c:692 allocation_wrapper free called with argument 0x108f100 - done free
adapter.c:692 allocation_wrapper free called with argument 0x1091510 - done free
root@yavdr2:/usr/src/satip/minisatip-master#

enhancement: LOG

would it be make sense to add FILE,LINE to the macro

and maybe also a LOG_PREFIX like minisatip

missing DTV_ENUM_DELSYS in dvb headers

maybe it's a good idea to add some comments regarding Kernel and DVBAPIVERSION to build on.

and may catch this also in the code like:

define DVBAPIVERSION (DVB_API_VERSION << 8 | DVB_API_VERSION_MINOR)

if DVBAPIVERSION < 0x0500

error minisatip requires Linux DVB driver API version 5.0 or higher!

endif

if DVBAPIVERSION < 0x0505

define DTV_ENUM_DELSYS 44

endif

ssdp_defend

it would be handy to have a cli option in addition to the default for the DEVICEID as long there is no ssdp_defend implemented to avoid double DEVICEID's on the same network.

enhancement: dvb adpater

I would be nice to have a cli option to specify the adapter number or a list of adapters which should be used by minisatip. If you may have some other applications running on the same machine then this is a issue.

TEARDOWN

is this right to close before sent out?

else if (strncmp (arg[0], "TEARDOWN", 8) == 0)

{
close_stream (s->sid);
http_response (s->sock, "RTSP", 200, NULL, NULL, cseq);
}

to less CRLF

minisatip.c:453 after com.ses.streamID
minisatip.c:459 after com.ses.streamID

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.