PDA

Bekijk de volledige versie : [Howto] Install DLNA media servers for Oleg firmware



ecaddict
28-10-2011, 11:25
After you've installed basic optware to the router using e.g. the Raas image directly or indirectly using my tutorial (http://wl500g.info/showthread.php?t=23684)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 (http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance).

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 (http://wl500g.info/showthread.php?t=13963)

Just copy-paste as such:

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 (http://wl500g.info/showthread.php?t=25942)

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

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):

#!/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


8471
My usual single line install:

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 (http://wl500g.info/showthread.php?t=22549)
Wiki about install (http://www.twonkyforum.com/mediawiki/index.php/Asus_Routers_-_Oleg_FW).

Install script (that you may copy-paste as such):

#!/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


8451
My usual single line install:

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!

ecaddict
28-10-2011, 11:28
reserved for continuation

ecaddict
28-10-2011, 12:13
Does someone know how to correct typo I've made in the title?

wpte
28-10-2011, 15:51
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 :)

ecaddict
28-10-2011, 18:52
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.:

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?

wpte
28-10-2011, 19:19
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.:

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 :)

lskarda
25-11-2011, 08:31
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

ecaddict
25-11-2011, 09:19
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)?

lskarda
25-11-2011, 21:44
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

ecaddict
26-11-2011, 09:59
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

tex
26-11-2011, 10:23
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

ecaddict
26-11-2011, 18:07
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.

duvik
06-07-2012, 11:15
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?

duvik
06-07-2012, 23:32
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!

duvik
22-07-2012, 12:49
In debug mode I got the error:

[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]

kolp
12-09-2012, 22:08
Hello I followed the MiniDLNA tutorial and installed eveything, but on the TV under network I see my router but I can't see any of the pictures. Here is the log:

[2012/09/12 18:27:05] minidlna.c:899: warn: Starting MiniDLNA version 1.0.22 [SQLite 3.7.13].
[2012/09/12 18:27:07] 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 ad
[2012/09/12 18:27:07] minidlna.c:991: warn: HTTP listening on port 8200
[2012/09/12 19:13:22] minidlna.c:153: warn: received signal 15, good-bye
[2012/09/12 19:22:59] minidlna.c:899: warn: Starting MiniDLNA version 1.0.22 [SQLite 3.7.13].
[2012/09/12 19:22:59] minidlna.c:991: warn: HTTP listening on port 8200
[2012/09/12 19:22:59] 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 ad
[2012/09/12 19:25:59] minidlna.c:153: warn: received signal 15, good-bye

Here is my config file:

port=8200
network_interface=br0
media_dir=P,/tmp/harddisk/transmission/download/Photos
friendly_name=ASUS
db_dir=/opt/var/cache/minidlna
log_dir=/opt/var/log
album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg
inotify=yes
enable_tivo=no
strict_dlna=no
# default presentation url is http address on port 80
presentation_url=http://152.207.6.1:8200/

# notify interval in seconds. default is 895 seconds.
notify_interval=900

# serial and model number the daemon will report to clients
# in its XML description
serial=12345678
model_number=1

# specify the path to the MiniSSDPd socket
#minissdpdsocket=/var/run/minissdpd.sock

# use different container as root of the tree
# possible values:
# + "." - use standard container (this is the default)
# + "B" - "Browse Directory"
# + "M" - "Music"
# + "V" - "Video"
# + "P" - "Pictures"
# if you specify "B" and client device is audio-only then "Music/Folders" will be used as root
root_container=.

Default mount =
Filesystem Size Used Avail Use% Mounted on
rootfs 3.0M 3.0M 0 100% /
/dev/root 3.0M 3.0M 0 100% /
tmpfs 15M 200K 15M 2% /tmp
/dev/discs/disc1/part2
1.9G 406M 1.4G 23% /opt
/dev/discs/disc0/part3
230G 28G 202G 13% /tmp/mnt/disc0_3

But I read that we should use the mount from fsctab which is /tmp/harddisk/xxx and so forth. I am doing something wrong.

thanks in advance

Sandman
16-03-2014, 17:59
Hello,

I got the same error as kolp one entry above.
My problem is, I see the DLNA Server (my asus router) in the LG TV under Smart Share, but when i click on it I only see Standard Audio/Video/Music Folder which are all empty and which are not on my Router FS...
I tried all possible values for the parameter (the one who is shown in df -h, the one shown in /etc/fstab) but without success... Can someone help me?
Did someone fixed this issue? I badly need this!
Thnx

Sandman
18-03-2014, 17:17
Hi,
as an alternative I try to install mediatomb instead of malfuntioning minidlna.... I tried from Post #1 but I got this error... is olegs download down?

[admin@susi file]$ ipkg update; ipkg install readline mediatomb
Downloading http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/Packages.gz
Bus error
An error ocurred, return value: 1.
Collected errors:
ipkg_download: ERROR: Command failed with return value 138: `wget -q -P /opt/ipkg-xCtvix http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/Packages.gz'
Package readline (6.1-2) installed in /opt/ is up to date.
Installing mediatomb (0.11.0-5) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/mediatomb_0.11.0-5_mipsel.ipk
Bus error
Nothing to be done
An error ocurred, return value: 22.
Collected errors:
ipkg_download: ERROR: Command failed with return value 138: `wget -q -P /opt/ipkg-tNWskZ http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/mediatomb_0.11.0-5_mipsel.ipk'
Failed to download mediatomb. Perhaps you need to run 'ipkg update'?

salle
06-06-2017, 07:40
I recently had to reinstall Optware on my Asus RT-N16 due to an error that happened on my harddrive. After reinstalling Optware, using ecaddict guide for Optware the simple way, I found out that the Twonkyserver 7 guide on the link below is no longer working. I have been in touch with Twonky and they say that they shut down the twonkyforum a few years ago and have no backup of this information.

@wpte If I am not mistaken, I believe you wrote the guide for Twonkyserver 7. You would not happen to still have the guide somewhere?

http://www.twonkyforum.com/mediawiki...ters_-_Oleg_FW

I have found out how to install Twonkymedia 6 and have done that succesfully. However, Twonkymedia 6 does not support mkv-files. All of my movie files are mkv-files with embedded subtitles, which is the only way to get subtitles to work on my LG TV. I am far from an expert on all of this and hope you have time to help me with the guide for Twonkyserver 7.

Best regards
Anders