Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: [Howto] Install DLNA media servers for Oleg firmware

  1. #1

    [Howto] Install DLNA media servers for Oleg firmware

    After you've installed basic optware to the router using e.g. the Raas image directly or indirectly using my tutorial DLNA could be the next step.

    A router with 128MB RAM (RT-N16, WL-500gP or WL-500W with RAM upgrade) is recommended if you plan to run many other programs as well.

    If you don't know what DLNA is just check the Wiki.

    The basic idea is that media servers (like the router) provide media to media player (like your TV, media player etc.) controlled by controller (like your PDA, mobile etc.)
    There are many different options, the most popular being: mediatomb, minidlna and twonky.
    You can install all, and disable what you don't like.

    mediatomb (special thanks to rathalian and ignatz)
    Original thread

    Just copy-paste as such:
    Code:
    cd /opt/share/file; [ ! -f magic.old ] && mv magic magic.old
    ipkg update; ipkg install readline mediatomb
    mkdir -p /opt/etc/mediatomb
    mkdir -p /usr/local/root/.mediatomb
    flashfs save && flashfs commit && flashfs enable
    sed -i 's/MT_USER="root"/MT_USER="admin"/' /opt/etc/mediatomb.conf
    sed -i 's/MT_ENABLE=false/MT_ENABLE=true/' /opt/etc/default/mediatomb
    cd /opt/share/mediatomb
    cat sqlite3.sql | sqlite3 mediatomb.db
    mv mediatomb.db /opt/etc/mediatomb/
    /opt/etc/init.d/S90mediatomb start
    /bin/ps | grep mediatomb
    MediaTomb web interface: http://192.168.1.1:50500/

    More about MediaTomb: http://mediatomb.cc/

    minidlna (special thanks to shantanugoel)
    Original thread

    If you prefer not to compile it, fetch my compiled version and extract it on the router. minidlna.tar.gz.

    Copy-paste the following script and it will do everything (build also if you did not download the above binary version, however it can take half an hour in case of slow router):
    Code:
    #!/bin/sh
    #written by ecaddict, distributed (conveyed) under GPL version 3 or any later version
    
    MDIR=/mnt/protected/Storage
    DDIR=/opt/var/cache/minidlna
    STARTS=/opt/etc/init.d/S90minidlna
    BDIR=/mnt/dev/minidlna
    #user editable part end
    
    EXSD=/bin/sed
    DCONF=/opt/etc/minidlna.conf
    DBIN=/opt/sbin/minidlna
    LDIR=/opt/var/log
    
    ipkg update
    ipkg install libvorbis libogg libid3tag libexif libjpeg ffmpeg flac
    
    if [ ! -x ${DBIN} ] || [ ! -f /opt/etc/minidlna.conf ]; then
      ipkg install buildroot optware-devel unzip
      ipkg remove wget
      ipkg install wget-ssl
      mkdir -p ${BDIR} && cd ${BDIR}
      wget --no-check-certificate https://github.com/shantanugoel/minidlna-asus/zipball/asus
      unzip asus && rm asus
      cd shantanugoel-minidlna*
      make
      export INSTALLPREFIX=/opt
      export DESTDIR=/opt
      make install
    fi
    
    mkdir -p ${MDIR}
    mkdir -p ${DDIR}
    mkdir -p ${LDIR}
    ${EXSD} -i 's%^media_dir=.*%media_dir='''${MDIR}'''%' ${DCONF}
    ${EXSD} -i 's%^#db_dir.*%db_dir='''${DDIR}'''%' ${DCONF}
    ${EXSD} -i 's%^#log_dir.*%log_dir='''${LDIR}'''%' ${DCONF}
    
    cat > ${STARTS} << __EOF__
    #!/bin/sh
    #written by ecaddict, distributed (conveyed) under GPL version 3 or any later version
    
    CONF=${DCONF}
    EXDL=${DBIN}
    
    NAME="\${EXDL##*/}"
    OPTS="-f \${CONF}"
    
    if [ -z "\$1" ] ; then
        case \${0##*/} in
            S??*) rc="start" ;;
            K??*) rc="stop" ;;
            *) rc="usage" ;;
        esac
    else
        rc="\$1"
    fi
    
    case "\$rc" in
        start)
            if [ ! -x \${EXDL} ];then
              echo -e "\\033[1;31mMinidlna is missing: "\$EXDL"\\033[0m"
              exit 1
            fi
            if [ ! -f \${CONF} ];then
              echo -e "\\033[1;31mConfig file "\$CONF" is missing\\033[0m"
              exit 2
            fi
            if [ -n "\$(pidof \$NAME)" ]; then
              echo -e "\\033[1;33m\$NAME runs already\\033[0m"
              exit 3
            fi
            echo "Starting \$NAME"
            \${EXDL} \${OPTS}
            ;;
        stop)
            if [ -n "\$(pidof \$NAME)" ]; then
                echo "Stopping \$NAME"
                killall \$NAME 2> /dev/null
            fi
            ;;
        restart)
            "\$0" stop
            sleep 5
            "\$0" start
            ;;
        *)
            echo "Usage: \$0 (start|stop|restart|usage)"
            ;;
    esac
    __EOF__
    chmod u+x ${STARTS}
    ${STARTS} start
    installm.tar.gz
    My usual single line install:
    Code:
    cd /tmp && wget -O installm.tar.gz "http://wl500g.info/attachment.php?attachmentid=8471&d=1321546056" && tar xvzf installm.tar.gz && ./install.sh  && rm install*
    Config adjustments in /opt/etc/minidlna.conf

    It has no web IF but you may try (I have not used it):
    http://minidlnawebmin.sourceforge.net/

    twonkymedia (special thanks to wpte)
    Original thread
    Wiki about install.

    Install script (that you may copy-paste as such):
    Code:
    #!/bin/sh
    #written by ecaddict, distributed (conveyed) under GPL version 3 or any later version
    
    INSTDIR=/opt/twonkymedia
    MDIR=/mnt/protected/Storage
    STARTS=/opt/etc/init.d/S90twonkymedia
    TINST=twonkymedia-asus-6.0.37.zip
    MDTD=${MDIR}/twonkymedia
    #user editable part end
    
    EXSD=/bin/sed
    DBIN=${INSTDIR}/twonkymedia
    DCONF=${INSTDIR}/twonky-config/twonkymedia.ini
    CONFD="${DCONF%\/*}"
    DBDIR=${INSTDIR}/db
    ODDIR=${INSTDIR}/online-data
    STDIR=${INSTDIR}/media-statistics
    CB=${INSTDIR}/cgi-bin
    
    ipkg update
    ipkg install libvorbis libogg libid3tag libexif libjpeg unzip
    #ipkg install flac ffmpeg imagemagick
    
    if [ ! -x "${DBIN}" ]; then
      mkdir -p ${INSTDIR} && cd ${INSTDIR}
      mkdir -p ${DBDIR}; mkdir -p ${CONFD}; mkdir -p ${ODDIR}; mkdir -p ${STDIR}
      mkdir -p ${MDTD}
      TVER=$(echo $TINST | ${EXSD} -n 's/[^0-9]*\(.*\).zip/\1/p')
      wget http://www.twonkyforum.com/downloads/${TVER}/${TINST}
      unzip twonkymedia-asus-6.*.zip
      rm -f readme.txt twonkymedia-asus-6.*.zip nas* install.nas
      chmod +x twonkym* cgi-bin/* plugins/* resources/*
      echo "/opt/bin" > ${CB}/ffmpeg.location
      echo "/opt/bin" > ${CB}/convert.location
      echo "/opt/bin" > ${CB}/flac.location
    fi
    
    cat > ${DCONF} << __EOF__
    contentbase=/
    contentdir=+A|${MDIR}
    dbdir=${DBDIR}
    onlinedir=${ODDIR}
    mediastatisticsdir=${STDIR}
    servermanagedmusicdir=${MDTD}
    servermanagedpicturedir=${MDTD}
    servermanagedvideodir=${MDTD}
    friendlyname=Twonky Asus
    httpport=9000
    enableweb=2
    scantime=60
    maxmem=5000
    startupmb=0
    norescale=1
    platform=Asus router
    suppressmenu=divAutoShare
    ip=$(nvram get lan_ipaddr)
    __EOF__
    
    cat > ${STARTS} << __EOF__
    #!/bin/sh
    #written by ecaddict, distributed (conveyed) under GPL version 3 or any later version
    
    SDIR=${INSTDIR}
    CONF=${DCONF}
    EXDL=${DBIN}
    
    NAME="\${EXDL##*/}"
    OPTS="-D -inifile \${CONF}"
    
    if [ -z "\$1" ] ; then
        case \${0##*/} in
            S??*) rc="start" ;;
            K??*) rc="stop" ;;
            *) rc="usage" ;;
        esac
    else
        rc="\$1"
    fi
    
    case "\$rc" in
        start)
            if [ ! -x \${EXDL} ];then
              echo -e "\\033[1;31mTwonkymedia is missing: "\$EXDL"\\033[0m"
              exit 1
            fi
            if [ ! -f \${CONF} ];then
              echo -e "\\033[1;31mConfig file "\$CONF" is missing\\033[0m"
              exit 2
            fi
            if [ -n "\$(pidof \$NAME)" ]; then
              echo -e "\\033[1;33m\$NAME runs already\\033[0m"
              exit 3
            fi
            echo "Starting \$NAME"
            cd \${SDIR} && \${EXDL} \${OPTS} 
            ;;
        stop)
            if [ -n "\$(pidof \$NAME)" ]; then
                echo "Stopping \$NAME"
                killall \$NAME 2> /dev/null
            fi
            ;;
        restart)
            "\$0" stop
            sleep 5
            "\$0" start
            ;;
        *)
            echo "Usage: \$0 (start|stop|restart|usage)"
            ;;
    esac
    __EOF__
    chmod u+x ${STARTS}
    ${STARTS} start
    installt.tar.gz
    My usual single line install:
    Code:
    cd /tmp && wget -O installt.tar.gz "http://wl500g.info/attachment.php?attachmentid=8451&d=1320263226" && tar xvzf installt.tar.gz && ./install.sh && rm install*
    Config adjustment in: /opt/twonkymedia/twonky-config/twonkymedia.ini
    It has a rather slow web interface during media scan, but it works:
    http://192.168.1.1:9000

    It's possible to start and run all 3 at the same time, however most probably you don't need to and it can also use quite some memory and CPU time (even with powerful routers like the RT-N16 with 128MB RAM).
    After tried what works for you, you can disable automatic start by renaming the /opt/etc/init.d/S90... script to DS90... (as only services starting with S... started). stop/start to the scripts work for manual stop/start.

    Unfortunately I cannot answer which works for you as it depends on your player and your preferences.

    Enjoy!
    Last edited by ecaddict; 18-11-2011 at 08:48. Reason: minidlna fixes

  2. #2
    reserved for continuation

  3. #3
    Does someone know how to correct typo I've made in the title?

  4. #4
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    Quote Originally Posted by ecaddict View Post
    Does someone know how to correct typo I've made in the title?
    What is the typo?
    perhaps as mod I'm able to fix it

    slow twonky web interface? :s
    perhaps it is while it's still scanning for media...
    apart from that it is smooth for me
    Last edited by wpte; 28-10-2011 at 16:53.

  5. #5
    Intall DLNA -> Install DLNA

    Thank you if you can fix it.

    Maybe you're right, it was still scanning media.

    Btw. when I start twonkymedia there is a zombie left, e.g.:
    Code:
    17265 ?        Z      0:00      \_ [mediafusion-int] <defunct>
    Search in the net shows that it's considered normal for Linux version (I don't think so); does it happen also when you start it? Is there any way to prevent it?

  6. #6
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    Quote Originally Posted by ecaddict View Post
    Intall DLNA -> Install DLNA

    Thank you if you can fix it.

    Maybe you're right, it was still scanning media.

    Btw. when I start twonkymedia there is a zombie left, e.g.:
    Code:
    17265 ?        Z      0:00      \_ [mediafusion-int] <defunct>
    Search in the net shows that it's considered normal for Linux version (I don't think so); does it happen also when you start it? Is there any way to prevent it?
    fixed

    I have that too... but since it does not use any cpu time (or nearly none) over hours of time it doesn't affect the performance significantly

  7. #7

    Smile

    Mod: please don't include the entire how-to as a quote...

    Thak you very well for these scripts :-)

    I have TV Samsung and this brand have many problems with some Media Servers.

    I tried install MediaTomb. It works great, but I dont see it on my Samsung TV.

    Then I tried MiniDLNA. I see it on TV, but not content of my library.
    In log I see:

    inotify.c:189: warn: WARNING: Could not read inotify max_user_watches! Hopefully it is enough to cover 0 current directories plus any new ones added.

    What is wrong?

    Thank you.

    Ludek
    Last edited by wpte; 25-11-2011 at 18:07. Reason: Removed quote of the entire how-to

  8. #8
    Are you sure that your media files are located in the directory that's indicated in the minidlna config file, /opt/etc/minidlna.conf parameter media_dir?

    minidlna works with Samsung TV very well.

    Btw, can you please avoid quoting the entire tutorial in your post (editing even after the post is possible)?

  9. #9
    Quote Originally Posted by ecaddict View Post
    Are you sure that your media files are located in the directory that's indicated in the minidlna config file, /opt/etc/minidlna.conf parameter media_dir?

    minidlna works with Samsung TV very well.

    Btw, can you please avoid quoting the entire tutorial in your post (editing even after the post is possible)?
    I tried use all combination of path.
    After command DF I see this for disk with my movies
    /dev/discs/disc0/part3 /tmp/mnt/disc0_3
    I used first and second form too. I used /tmp/harddisk

    For all free types of writing location command CD work.

    I use default SAMBA. In one forum I red something about this error and SAMBA 3. Which SAMBA use you?

    Thank you.

    Ludek

  10. #10
    I use Samba3 but probably that's not the issue here.

    df -h command should show /mnt for the "Mounted on" part (this is the case if you installed optware based on my tutorial or using the tutorial from Raas; /tmp/harddisk is not used by me).
    What it shows currently for you is something like it would be auto mounted and not via using /etc/fstab (cat /etc/fstab).

    Anyhow, as the files are there, you should find them (e.g. cd / && find -name *.avi or whatever media files you store there) and set the correct directory in /opt/etc/minidlna.conf.

    You can see what's currently configured with the following command:
    cat /opt/etc/minidlna.conf | grep media_dir

  11. #11
    Hi Ecaddict, could you please help me in configuring Twonky to let play Mkv files? On my samsung television when i try to open this kind of file it says "unsupported format"!
    Thank you for all your nice tutorials

  12. #12
    Playing mkv minidlna is the best option (I know for sure that it works with Samsung TV). Also meditomb has some issues with it due to e.g. missing <map from="mkv" to="video/mpeg"/> from /opt/etc/mediatomb/config.xml.

    I don't know what's wrong with Twonky.

  13. #13

    minidlna + Samsung TV -> media format not supported

    I installed the minidlna from the https://github.com/ and I also tried to compile minidlna (Version 1.0.22) for asus wl-500gp router and tried it with Samsung UE40D7000 TV. However, for any media (photo, video, music) I always get the message that the media format is not supported. Would you know how to fix it?

  14. #14
    The reason could be the auto mounted disk and not via using /etc/fstab. I did not paid attention to that because everything else was working well. I can even see thumbnails of some pictures but they cannot be opened - the message that media format not supported appears.
    How can I disable the automounting function of the router?
    Thank you!

  15. #15
    In debug mode I got the error:
    Code:
    [2012/07/22 13:36:56] upnphttp.c:1795: info: Serving DetailID: 24 [/tmp/mnt/disc0_3/public/filmy/Camera/DSC07862.jpg]
    [2012/07/22 13:36:56] upnphttp.c:1194: debug: sendfile error :: error no. 89 [Function not implemented]

Page 1 of 2 12 LastLast

Similar Threads

  1. Essential Firmware Questions
    By vladk2k in forum WL-500gP Firmware Discussion
    Replies: 9
    Last Post: 14-10-2009, 12:10
  2. Sony TV with DLNA support
    By zerg in forum WL-500gP Firmware Discussion
    Replies: 2
    Last Post: 09-06-2009, 14:50
  3. New Oleg firmware 1.9.2.7-9 problems?
    By wpte in forum WL-500gP Firmware Discussion
    Replies: 11
    Last Post: 18-04-2008, 00:34
  4. I can't intall firmware
    By SgobbiT in forum WL-500g Q&A
    Replies: 1
    Last Post: 25-12-2006, 20:08
  5. twonky media server, network drive with oleg firmware
    By black_bottom in forum WL-HDD Q&A
    Replies: 3
    Last Post: 22-03-2006, 08:15

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •