About

Supporting the site

App Repository‎ > ‎

minidlna-1.0.25

Overview

MiniDLNA requires zlib, libexif, libjpeg, libid3tag, libogg, libFLAC, libvorbis, ffmpeg, libuuid, and SQLite3. We cross-compile all of them and statically link everything for easy deployment.

Please note that the resulting compiled version may attempt to transcode media, as specified by the DLNA protocol. However, given the limitations of the DroboFS CPU, it will most likely cause stutter, or even not work at all. Unfortunately, there is nothing that can be done besides transcoding the media beforehand. Also, keep in mind that this is one of the largest DroboApps to date, given its large number of dependencies. Proceed with caution and patience.

This version uses the latest versions of the dependencies, but more importantly it introduces a new set of compilation flags to reduce memory footprint, given the limited memory available on the FS. The multi-instance patch used in the previous version has been ported to this new release as well.

Preparation

Make sure you have a cross-compiling virtual machine properly setup.

Compilation

export DEST=/mnt/DroboFS/Shares/DroboApps/minidlna
cd ~/code/

wget -O zlib-1.2.7.tar.gz http://zlib.net/zlib-1.2.7.tar.gz
tar zxf zlib-1.2.7.tar.gz
cd zlib-1.2.7
CFLAGS="$CFLAGS -Os -mthumb -ffunction-sections -fdata-sections" LDFLAGS="$LDFLAGS -Wl,--gc-sections" ./configure --prefix=$DEST --static
make clean && make
ZLIB=`pwd`
cd ..

wget -O e2fsprogs-libs-1.42.5.tar.gz http://sourceforge.net/projects/e2fsprogs/files/e2fsprogs/v1.42.5/e2fsprogs-libs-1.42.5.tar.gz
tar zxf e2fsprogs-libs-1.42.5.tar.gz
cd e2fsprogs-libs-1.42.5/
CFLAGS="$CFLAGS -Os -mthumb -ffunction-sections -fdata-sections" LDFLAGS="$LDFLAGS -Wl,--gc-sections" ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --disable-elf-shlibs 
cd lib/uuid/
make clean && make
LIBUUID=`pwd`
cd ../../..

wget -O sqlite-autoconf-3071300.tar.gz http://www.sqlite.org/sqlite-autoconf-3071300.tar.gz
tar zxf sqlite-autoconf-3071300.tar.gz
cd sqlite-autoconf-3071300/
CFLAGS="$CFLAGS -Os -mthumb -ffunction-sections -fdata-sections" LDFLAGS="$LDFLAGS -Wl,--gc-sections" ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --disable-shared
make clean && make
SQLITE=`pwd`
cd ..

wget -O libexif-0.6.21.tar.gz http://sourceforge.net/projects/libexif/files/libexif/0.6.21/libexif-0.6.21.tar.gz
tar zxf libexif-0.6.21.tar.gz 
cd libexif-0.6.21/
CFLAGS="$CFLAGS -Os -mthumb -ffunction-sections -fdata-sections" LDFLAGS="$LDFLAGS -Wl,--gc-sections" ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --disable-shared
make clean && make
LIBEXIF=`pwd`
cd ..

wget -O jpegsrc.v8d.tar.gz http://www.ijg.org/files/jpegsrc.v8d.tar.gz
tar zxf jpegsrc.v8d.tar.gz
cd jpeg-8d/
CFLAGS="$CFLAGS -Os -mthumb -ffunction-sections -fdata-sections" LDFLAGS="$LDFLAGS -Wl,--gc-sections" ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --enable-maxmem=8 --disable-shared
make clean && make
LIBJPEG=`pwd`
cd ..

wget -O libid3tag-0.15.1b.tar.gz http://sourceforge.net/projects/mad/files/libid3tag/0.15.1b/libid3tag-0.15.1b.tar.gz
tar zxf libid3tag-0.15.1b.tar.gz 
cd libid3tag-0.15.1b/
CFLAGS="$CFLAGS -I$ZLIB -Os -mthumb -ffunction-sections -fdata-sections" LDFLAGS="$LDFLAGS -L$ZLIB -Wl,--gc-sections" ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --disable-shared
make clean && make
LIBID3TAG=`pwd`
cd ..

wget -O libogg-1.3.0.tar.gz http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz
tar zxf libogg-1.3.0.tar.gz 
cd libogg-1.3.0/
CFLAGS="$CFLAGS -Os -mthumb -ffunction-sections -fdata-sections" LDFLAGS="$LDFLAGS -Wl,--gc-sections" ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --disable-shared
make clean && make
LIBOGG=`pwd`
cd ..

wget -O libvorbis-1.3.3.tar.gz http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
tar zxf libvorbis-1.3.3.tar.gz 
cd libvorbis-1.3.3/
CFLAGS="$CFLAGS -Os -mthumb -ffunction-sections -fdata-sections" LDFLAGS="$LDFLAGS -L$LIBOGG/src/.libs -Wl,--gc-sections" ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --with-ogg=$LIBOGG --disable-shared
make clean && make
LIBVORBIS=`pwd`
cd ..

wget -O flac-1.2.1.tar.gz http://sourceforge.net/projects/flac/files/flac-src/flac-1.2.1-src/flac-1.2.1.tar.gz
tar zxf flac-1.2.1.tar.gz 
cd flac-1.2.1/
CFLAGS="$CFLAGS -Os -mthumb -ffunction-sections -fdata-sections" CXXFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS -L$LIBOGG/src/.libs -Wl,--gc-sections" ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --with-ogg=$LIBOGG --disable-shared
make clean && make
LIBFLAC=`pwd`
cd ..

wget -O ffmpeg-0.11.1.tar.gz http://www.ffmpeg.org/releases/ffmpeg-0.11.1.tar.gz
tar zxf ffmpeg-0.11.1.tar.gz
cd ffmpeg-0.11.1/
make distclean
./configure --enable-cross-compile --cross-prefix=arm-none-linux-gnueabi- --arch=arm5te --cpu=armv5te --enable-armv5te --target-os=linux --prefix=$DEST --extra-cflags="$CFLAGS -I$ZLIB -mthumb -ffunction-sections -fdata-sections" --extra-cxxflags="$CFLAGS -I$ZLIB -mthumb -ffunction-sections -fdata-sections" --extra-ldflags="$LDFLAGS -L$ZLIB -Wl,--gc-sections" --enable-small --enable-zlib --disable-shared --disable-debug
sed -i -e "s/#define HAVE_ARMV5TE 0/#define HAVE_ARMV5TE 1/g" config.h
sed -i -e "s/\!HAVE_ARMV5TE=yes/HAVE_ARMV5TE=yes/g" config.mak
make
FFMPEG=`pwd`
cd ..

wget -O minidlna_1.0.25_src.tar.gz http://sourceforge.net/projects/minidlna/files/minidlna/1.0.25/minidlna_1.0.25_src.tar.gz
tar zxf minidlna_1.0.25_src.tar.gz 
cd minidlna-1.0.25/
wget -O config.h http://www.droboports.com/app-repository/minidlna-1-0-25/config.h
touch config.h
wget -O minidlna_multi.patch http://www.droboports.com/app-repository/minidlna-1-0-25/multi.patch
patch minidlna.c multi.patch
sed -i -e "s|minidlna:.*|minidlna:\t\$(BASEOBJS) \$(LNXOBJS)|g" Makefile
make clean
make CFLAGS="$CFLAGS -Wall -Os -mthumb -ffunction-sections -fdata-sections -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -I$ZLIB -I$SQLITE -I$LIBUUID -I$LIBEXIF -I$LIBJPEG  -I$LIBID3TAG -I$LIBOGG/include -I$LIBFLAC/include -I$LIBVORBIS/include -I$FFMPEG -I$FFMPEG/libavutil -I$FFMPEG/libavcodec -I$FFMPEG/libavformat" LDFLAGS="$LDFLAGS -L$ZLIB -L$SQLITE/.libs -L$LIBUUID -L$LIBEXIF/libexif/.libs -L$LIBJPEG/.libs -L$LIBID3TAG/.libs -L$LIBOGG/src/.libs -L$LIBFLAC/src/libFLAC/.libs -L$LIBVORBIS/lib/.libs -L$FFMPEG/libavutil -L$FFMPEG/libavcodec -L$FFMPEG/libavformat -Wl,--gc-sections" LIBS="-lsqlite3 -luuid -lexif -ljpeg -lavformat -lavcodec -lavutil -lid3tag -lFLAC -lvorbis -logg -lz -lpthread -ldl -lm" CC=$CC
make install DESTDIR=$DEST INSTALLPREFIX=$DEST LIBS=""
$STRIP -s -R .comment -R .note -R .note.ABI-tag $DEST/sbin/minidlna

Packaging

cd $DEST
mkdir -p var/cache var/log var/run etc
wget -O service.sh http://www.droboports.com/app-repository/minidlna-1-0-25/service.sh
wget -O etc/minidlna.conf.default http://www.droboports.com/app-repository/minidlna-1-0-25/minidlna.conf.default
chmod a+x service.sh
chmod -R g+w etc var
~/bin/package.sh

Installing

Download the TGZ file below and place it in you DroboApps share. If you do not have SSH access, reboot your Drobo. Otherwise, SSH in and type:

/usr/bin/DroboApps.sh install

Final remarks

The default minidlna.conf indexes the content of the Public share. If you want to specify other folders, please have a look at the beginning of that file and edit accordingly. You may need to restart minidlna for the changes to take effect. In case of upgrade from the previous version, the configuration file will be preserved.

This version incorporates a patch to allow for several instances to run at the same time. Please visit this page to find more information about this feature.

Please visit the DroboSpace forums to leave your comments, suggestions and feedback.

ċ
config.h
Download
  1k v. 1 Aug 14, 2012, 6:56 AM Ricardo Padilha
ċ
minidlna.conf.default
Download
  2k v. 1 Aug 14, 2012, 6:56 AM Ricardo Padilha
ċ
minidlna.tgz
Download
  3097k v. 1 Aug 14, 2012, 7:04 AM Ricardo Padilha
ċ
multi.patch
Download
  2k v. 1 Aug 14, 2012, 6:56 AM Ricardo Padilha
ċ
service.sh
Download
  1k v. 1 Aug 14, 2012, 6:56 AM Ricardo Padilha
Comments