Tag: msd_lite

  • EdgeRouter 4 Install msd_lite / msd

    msd_lite

    http://www.netlab.linkpc.net/wiki/en:software:msd:lite

    Deprecated, but recommended!!! You can also use Multi Stream daemon (msd)

    Steps:

    1 Clone code on computer, because my ER-4 reports dpkg errors, due to the outdated debian stretch. Then upload to ER-4

    git clone --recursive https://github.com/rozhuk-im/msd_lite.git
    tar zcvf msd_lite.tar.gz msd_lite
    scp msd_lite.tar.gz ubnt@192.168.1.1:/tmp/

    2 On ER-4, install build-essential, cmake

    For build-essential, read EdgeRouter 4 Build & Install udpxy

    # apt install cmake
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    You might want to run 'apt --fix-broken install' to correct these.
    The following packages have unmet dependencies:
     cmake : Depends: cmake-data (= 3.7.2-1) but it is not going to be installed
             Depends: libarchive13 (>= 3.0.4) but it is not going to be installed
             Depends: libjsoncpp1 (>= 1.7.4) but it is not going to be installed
             Depends: libuv1 (>= 1.4.2) but it is not going to be installed
     dpkg-dev : Depends: xz-utils but it is not going to be installed
    E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
    
    
    
    # apt install cmake cmake-data  libarchive13 libjsoncpp1 libuv1 

    3 build on ER-4

    tar xvf /tmp/msd_lite.tar.gz
    cd msd_lite
    mkdir build
    cd build
    cmake ..
    make 
    make install

    4 configure and run

    /etc/msd_lite.conf

    
    <?xml version="1.0" encoding="utf-8"?>
    
    <!--
     Sizes in kb, time in seconds
    -->
    
    <!--
    <skt> <rcvLoWatermark>XXXX</rcvLoWatermark> - DOES NOT WORK on Linux!
    man socket(7):
    ...
    The select(2) and poll(2) system calls currently do not respect the SO_RCVLOWAT
    setting on Linux, and mark a socket readable when even a single byte of data is
    available.
    ...
    -->
    
    
    <msd>
    	<log>
    		<file>/var/log/msd_lite.log</file>
    	</log>
    
    	<threadPool>
    		<threadsCountMax>1</threadsCountMax> <!-- 0 = auto -->
    		<fBindToCPU>yes</fBindToCPU> <!-- Bind threads to CPUs. -->
    		<fCacheGetTimeSyscall>yes</fCacheGetTimeSyscall> <!-- Cache gettime() syscalls.. -->
    		<timerGranularity>100</timerGranularity> <!-- 1/1000 sec -->
    	</threadPool>
    
    
    <!-- HTTP server -->
    	<HTTP>
    		<bindList>
    			<bind><address>0.0.0.0:7088</address><fAcceptFilter>y</fAcceptFilter></bind>
    			<bind><address>[::]:7088</address></bind>
    		</bindList>
    
    		<hostnameList> <!-- Host names for all bindings. -->
    			<hostname>*</hostname>
    		</hostnameList>
    	</HTTP>
    
    
    	<hubProfileList> <!-- Stream hub profiles templates. -->
    		<hubProfile>
    			<fDropSlowClients>no</fDropSlowClients> <!-- Disconnect slow clients. -->
    			<fSocketHalfClosed>no</fSocketHalfClosed> <!-- Enable shutdown(SHUT_RD) for clients. -->
    			<fSocketTCPNoDelay>yes</fSocketTCPNoDelay> <!-- Enable TCP_NODELAY for clients. -->
    			<fSocketTCPNoPush>yes</fSocketTCPNoPush> <!-- Enable TCP_NOPUSH / TCP_CORK for clients. -->
    			<precache>4096</precache> <!-- Pre cache size. Can be overwritten by arg from user request. -->
    			<ringBufSize>1024</ringBufSize> <!-- Stream receive ring buffer size. Must be multiple of sndBlockSize. -->
    			<skt>
    				<sndBuf>512</sndBuf> <!-- Max send block size, apply to clients sockets only, must be > sndBlockSize. -->
    				<sndLoWatermark>64</sndLoWatermark>  <!-- Send block size. Must be multiple of 4. -->
    				<congestionControl>htcp</congestionControl> <!-- TCP_CONGESTION: this value replace/overwrite(!) all others cc settings: cc from http req args, http server settings, OS default -->
    			</skt>
    			<headersList> <!-- Custom HTTP headers (sended before stream). -->
    				<header>Pragma: no-cache</header>
    				<header>Content-Type: video/mpeg</header>
    				<header>ContentFeatures.DLNA.ORG: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000</header>
    				<header>TransferMode.DLNA.ORG: Streaming</header>
    			</headersList>
    		</hubProfile>
    	</hubProfileList>
    
    
    	<sourceProfileList> <!-- Stream source profiles templates. -->
    		<sourceProfile>
    			<skt>
    				<rcvBuf>512</rcvBuf> <!-- Multicast recv socket buf size. -->
    				<rcvLoWatermark>48</rcvLoWatermark> <!-- Actual cli_snd_block_min if polling is off. -->
    				<rcvTimeout>2</rcvTimeout> <!-- STATUS, Multicast recv timeout. -->
    			</skt>
    			<multicast> <!-- For: multicast-udp and multicast-udp-rtp. -->
    				<ifName>br0</ifName> <!-- For multicast receive. -->
    			</multicast>
    		</sourceProfile>
    	</sourceProfileList>
    </msd>
    
    

    I only modified the multicast -> ifName to br0.

    RUN

    msd_lite -c /etc/msd_lite.conf -v

    msd

    http://www.netlab.linkpc.net/wiki/software:msd:index

    Same as msd_lite, but powerful.

  • 北京联通猫棒 IPTV

    故事背景:家里拉了很多年的千兆,这两年才从 FTTB 换成 FTTH。但是之前买的千兆套餐不送 IPTV 了,而光改的时候,联通的工作人员帮我改了桥接,但是所有口都绑定了 Internet。现在开通IPTV需要初装费,还要月费,所以我就没开通。本来是不想折腾的,因为实在没空,但是被催了好久猫棒的事情,所以就临时下了个单,花了一天做了些实验。

    (more…)
  • EdgeRouter 4 Build & Install udpxy

    Please DON’T use udpxy, check msd_lite!!!

    Source Code: http://gigapxy.com/download/udpxy/

    # show version
    Version:      v2.0.9-hotfix.7
    Build ID:     5622762
    Build on:     06/15/23 11:31
    Copyright:    2012-2020 Ubiquiti Networks, Inc.
    ...

    Steps:

    1 Configure apt source

    EdgeOS 2.0 is based on debian stretch, outdated.

    # cat /etc/apt/sources.list.d/stretch.list
    deb http://archive.debian.org/debian/ stretch main contrib
    deb http://archive.debian.org/debian/ stretch-updates main contrib
    deb http://archive.debian.org/debian/ stretch-backports main contrib
    
    deb http://archive.debian.org/debian-security/ stretch/updates main

    2 install build-essential

    apt install build-essential

    3 Get source, and build

    wget http://gigapxy.com/download/udpxy/udpxy-src.tar.gz
    tar xvf udpxy-src.tar.gz
    cd udpxy-1.0.25-1/
    make

    Then you will see error like cc not found.

    CC=gcc make

    You’ll see

    gcc: error trying to exec 'as': execvp: No such file or directory

    This is because the binutils package provided by UBNT is almost empty.

    wget -c https://archive.debian.org/debian/pool/main/b/binutils/binutils_2.28-5_mips.deb
    dpkg --unpack binutils_2.28-5_mips.deb

    Backup your config, Install manually.

    Then

    CC=gcc make
    CC=gcc make install