Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Post Reply 
Firefly Media server on NMT
07-17-2010, 08:38 PM (This post was last modified: 07-17-2010 08:41 PM by gsolaro.)
Post: #1
Firefly Media server on NMT
I tried to find any information about this, but i just find closed forums (like here). So, i started trying out some things.

I compiled successfully mt-daapd on my laptop, but i ran into a strange issue: when i try start it, reports cannot open songs.gdb and the strerror message is: File exists (???).

Now i stopped here, i doesn't have enough C knowledge to step over it. I searching anybody who can help me.

G. Solaro

Send me a PM because I am sometimes too busy to check forum, so the PM is quicker.
Find all posts by this user
Add Thank You Quote this message in a reply
08-16-2010, 10:52 PM
Post: #2
RE: Firefly Media server on NMT
Hello gsolaro,

you crosscompiled mt-daapd for the NMT on your laptop?
If you tell me how to setup the environment for compiling NMT apps I might be able to help you with this.
Find all posts by this user
Add Thank You Quote this message in a reply
08-16-2010, 11:59 PM
Post: #3
RE: Firefly Media server on NMT
(08-16-2010 10:52 PM)pac^man Wrote:  Hello gsolaro,

you crosscompiled mt-daapd for the NMT on your laptop?
If you tell me how to setup the environment for compiling NMT apps I might be able to help you with this.
I upload my build environment for you but you will have a little problem with it: my laptop system is crashed in a last days, and the package contains files with wrong permissions (everything is executable). I currently cannot fix it (from windows), so this is will your job... sry.

Anyway, this is a working root, it contains a compiler, uClibC, and packages what i compiled for it.

I compiled:
- sqlite-3.6.23.1
- libid3tag-0.15.1b
- zlib-1.2.3
- gdbm-1.8.3 (probably buggy?)
- mt-daapd-0.2.4.2

I compiled everything as static lib.

But this is just a devel environment, i don't know how can i create a debug environment - i'm quite newbie in cross-compiling world.

You can download it from here

G. Solaro

Send me a PM because I am sometimes too busy to check forum, so the PM is quicker.
Find all posts by this user
Add Thank You Quote this message in a reply
08-17-2010, 07:21 AM
Post: #4
RE: Firefly Media server on NMT
(08-16-2010 11:59 PM)gsolaro Wrote:  I upload my build environment for you but you will have a little problem with it:...

You can download it from here

Thanks for uploading it.
But I'd rather prepare everything from scratch myself.
Do you have a HowTo somewhere according to which I could do this?
Find all posts by this user
Add Thank You Quote this message in a reply
08-17-2010, 09:52 AM (This post was last modified: 08-17-2010 09:52 AM by dc11ab.)
Post: #5
RE: Firefly Media server on NMT
pac^man, if you just want to setup a crosscompiling environment for the 100-series there is info on the NMT wiki:
http://www.networkedmediatank.com/wiki/i...ox_for_NMT

and more if you search this board (for 200-series, etc).

Audio, video, disco - I hear, I see, I learn.
Wiki. Wiki? Wiki!
Find all posts by this user
Add Thank You Quote this message in a reply
[+] 1 user says Thank You to dc11ab for this post
08-17-2010, 06:22 PM
Post: #6
RE: Firefly Media server on NMT
(08-16-2010 11:59 PM)gsolaro Wrote:  I compiled:
- sqlite-3.6.23.1
- libid3tag-0.15.1b
- zlib-1.2.3
- gdbm-1.8.3 (probably buggy?)
- mt-daapd-0.2.4.2

I compiled everything as static lib.

I compiled zlib, gdbm, libid3tag statically and now I'm stuck at the mt-daapd build.

How did you manage to build mt-daapd with the static libid3tag.a?
I can't seem to find the correct configure option and always end up with
Code:
checking for id3_file_open in -lid3tag... no
Must have libid3tag
Find all posts by this user
Add Thank You Quote this message in a reply
08-17-2010, 08:01 PM
Post: #7
RE: Firefly Media server on NMT
Doesn't --with-id3tag=/path/to/the/libid3library do the trick?

Audio, video, disco - I hear, I see, I learn.
Wiki. Wiki? Wiki!
Find all posts by this user
Add Thank You Quote this message in a reply
08-17-2010, 08:23 PM
Post: #8
RE: Firefly Media server on NMT
(08-17-2010 08:01 PM)dc11ab Wrote:  Doesn't --with-id3tag=/path/to/the/libid3library do the trick?

No, it didn't.
Actually I've never dealt with static libraries before and am therefore not sure on how to work with them here now.
So I restarted with dynamic libraries and seeing this in the configure output I feel more comfortable:
Code:
...
checking for gdbm.h... yes
checking for gdbm_open in -lgdbm... yes
Have gdbm
Adding dynamic libgdbm
checking id3tag.h usability... yes
checking id3tag.h presence... yes
checking for id3tag.h... yes
checking for id3_file_open in -lid3tag... yes
Have id3tag
Adding dynamic libid3tag
...

Unfortunately make fails now with the following error:
Code:
/nmt/usr/local/mips/bin/../lib/gcc/mipsel-linux-uclibc/4.0.4/../../../../mipsel-linux-uclibc/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
which made me remember that I hadn't built a shared zlib.

So I went back into the zlib-1.2.5 directory and am stuck there now because I don't know how to built a shared zlib. I get the following error when doing the configure:
Code:
mipsel-linux-uclibc-gcc: ${exec_prefix}/lib/libz.1.dylib: No such file or directory
mipsel-linux-uclibc-gcc: 1: No such file or directory
mipsel-linux-uclibc-gcc: 1.2.5: No such file or directory
mipsel-linux-uclibc-gcc: unrecognized option '-compatibility_version'
mipsel-linux-uclibc-gcc: unrecognized option '-current_version'
No shared library support; try without defining CC and CFLAGS
Building static library libz.a version 1.2.5 with /nmt/usr/local/mips/bin/mipsel-linux-uclibc-gcc.

Now I don't have a clue how to proceed.
Find all posts by this user
Add Thank You Quote this message in a reply
08-17-2010, 09:49 PM
Post: #9
RE: Firefly Media server on NMT
While trying for static, did you add: --enable-static ?

Would it be insane to add --disable-zlib ?

No help from ./configure --help ?

Perhaps you can edit the Makefile and do ugly stuff, like adding linking path to the libz.* ?


Sorry I can't be of much more help. I'm a compiling newbie.

Audio, video, disco - I hear, I see, I learn.
Wiki. Wiki? Wiki!
Find all posts by this user
Add Thank You Quote this message in a reply
08-17-2010, 09:53 PM
Post: #10
RE: Firefly Media server on NMT
Disabling zlib is out of the question, there's "include zlib.h" in the mt-daapd source code Angry
I'll wait for gsolaro before doing ugly stuff, after all he managed to compile it.
Find all posts by this user
Add Thank You Quote this message in a reply
08-17-2010, 09:58 PM
Post: #11
RE: Firefly Media server on NMT
Here's a hint on how zlib was made, but I haven't read the thread and topic in context:
http://www.networkedmediatank.com/showth...3#pid96263

Audio, video, disco - I hear, I see, I learn.
Wiki. Wiki? Wiki!
Find all posts by this user
Add Thank You Quote this message in a reply
[+] 1 user says Thank You to dc11ab for this post
09-28-2010, 04:36 AM
Post: #12
RE: Firefly Media server on NMT
Has anyone had any luck with this? I started with gsolaro's tree and had even less success than he had.
Find all posts by this user
Add Thank You Quote this message in a reply
05-15-2011, 04:56 PM
Post: #13
RE: Firefly Media server on NMT
Man, that would be great! If somebody has the firefly media server working on the NMT please help (or another server that supports eing a iTunes Server).

Kind regards,
Find all posts by this user
Add Thank You Quote this message in a reply
02-29-2012, 07:32 PM
Post: #14
RE: Firefly Media server on NMT
Hey guys,

Sorry for a big silence. I have really no time for this project sadly.

The good news is I successfully compiled and started the mt-daapd on my BluePanther Syvio 200A mediaplayer!

So, the needed steps is following:

- Grab the previously linked toolchain, that is only one what I could make work.
- Grab and compile the dependencies, in order:

Code:
## Preparation
mkdir -p $HOME/tmp/sysroot # Here goes the stuffs what we will scp to our mediacenter
export D=$HOME/tmp/sysroot

## Compilations. Before dollar sign, you can see the current dir, what informs you what we compiling currently. This and the dollar sign is not a part of the command!

zlib-1.2.6 $ CC=/opt/toolchain-mipsel_gcc3.4.6/bin/mipsel-linux-uclibc-gcc LD=/opt/toolchain-mipsel_gcc3.4.6/bin/mipsel-linux-uclibc-ld ./configure --static --prefix=/mnt/custom && make && make DESTDIR=$D install

sqlite-autoconf-3071000 $ ./configure --host=mipsel-linux-uclibc --target=mipsel-linux-uclibc CC=mipsel-linux-uclibc-gcc --disable-readline --disable-shared --enable-static --disable-dynamic-extensions --disable-threadsafe --libdir=/mnt/custom/lib --prefix=/mnt/custom && make && DESTDIR=$D install

libid3tag-0.15.1b $ ./configure --host=mipsel-linux-uclibc --target=mipsel-linux-uclibc CC=mipsel-linux-uclibc-gcc  --disable-shared --enable-static  CFLAGS="-I${D}/usr/local/include" CPPFLAGS="-I${D}/usr/local/include"  LDFLAGS="-L${D}/usr/local/lib" && make && DESTDIR=$D install

The tricky thing is the mt-daapd itself. The configure line is the following:

Code:
./configure --host=mipsel-linux-uclibc --target=mipsel-linux-uclibc CC=mipsel-linux-uclibc-gcc  --disable-shared --enable-static --enable-gdbm  --enable-sqlite3 --with-sqlite3-includes=$D/mnt/custom/include --with-sqlite3-libs=$D/mnt/custom/lib --with-id3tag=$D/mnt/custom   --enable-mdns --disable-iconv --prefix=/mnt/custom LDFLAGS="-static $D/mnt/custom/lib/libz.a" CFLAGS="-D__USE_UNIX98" CPPFLAGS="-D__USE_UNIX98 -DSETPGRP_VOID" ac_cv_lib_id3tag_id3_file_open=yes ac_cv_func_setpgrp_void=yes
But, before issue make command, edit the /opt/toolchain-mipsel_gcc3.4.6/include/bits/pthreadtypes.h and comment out L97 and L117 (just these lines, the lines between them leave untouched!).
Next, edit src/main.c and around L94 you will see the following (the following code contains line numbers):

Code:
90 #ifndef DEFAULT_CONFIGFILE
91 #ifdef NSLU2
92 #define DEFAULT_CONFIGFILE "/opt/etc/mt-daapd/mt-daapd.conf"
93 #else
94 #define DEFAULT_CONFIGFILE "/etc/mt-daapd.conf"
95 #endif
96 #endif

As you see, the L94 contains the fallback config file location. You can edit it for your fits. I targeted it to /mnt/custom/mt-daapd.conf but if you want to edit it from SMB then point it to /opt/sybhttpd/localhost.drives/HARD_DISK/mt-daapd.conf

Next, start make, and see the make command is failing. But no worries!
There is a final command (you must execute it after make failing:
Code:
mipsel-linux-uclibc-gcc  -D__USE_UNIX98  -static /home/hron/build/nmt/sysroot/mnt/custom/lib/libz.a  -L/home/hron/build/nmt/sysroot/mnt/custom/lib -o mt-daapd  main.o uici.o webserver.o configfile.o err.o restart.o daap-proto.o daap.o db-gdbm.o mp3-scanner.o playlist.o lexer.o parser.o strcasestr.o strsep.o redblack.o dynamic-art.o query.o mDNS.o mDNSPosix.o mDNSUNP.o rend-posix.o rend-unix.o -lgdbm -lid3tag -lz -lpthread

The trick what I did there is the reordering of arguments, moving -l switches to the end of command is solves the limitations of GCC 3.x.

Finally, you can execute
Code:
make DESTDIR=$D install
. After this, you will get ~6MB directory at $HOME/tmp/sysroot. You can upload this directory's content to your mediacenter's root:
Code:
scp -r $D/mnt/custom root@YOUR_MC_IP:/mnt/

Then, create a mt-daapd.conf and upload where you specified in main.c. After it, you can start mt-daapd with executing the binary without arguments. It forks to background, no worries.

Tip: mt-daapd currently have an mdns-advertisement feature, so you do not need to start mDNSresp-mips utility for it, mt-daapd can advertise itself alone.

And that's all. If there is a question about it, please drop me a PM because I am not active on this forum.

G. Solaro

Send me a PM because I am sometimes too busy to check forum, so the PM is quicker.
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  a400 accepting tvheadend server lil8386 0 1,011 05-28-2013 12:38 PM
Last Post: lil8386
  change mime types on default pch upnp server? AdamNJ 1 1,386 03-11-2013 07:32 AM
Last Post: halfelite
  [A-400] Does not see llink server tkenn1s 5 2,195 02-26-2013 05:14 PM
Last Post: Imdre
  Windows Media Center docluv01 1 1,216 12-07-2012 08:28 PM
Last Post: accident
  Upnp server A200 + external HDD wizzy 0 1,560 11-12-2012 12:34 PM
Last Post: wizzy
  UPnp server for C200 blief 1 1,652 10-31-2012 06:53 AM
Last Post: halfelite
  C200 UPnP server blief 2 1,874 10-22-2012 12:51 AM
Last Post: blief
  Which DLNA/UPnP server works with a PCH A210? sal iva 2 2,174 08-25-2012 06:58 PM
Last Post: accident
  Important function of uPnP Server nuke 5 2,239 03-11-2012 07:00 AM
Last Post: lundman
  Announcing Edna++ - A Social Media Server gkreidl 13 4,980 02-25-2012 07:37 PM
Last Post: scerazy

Forum Jump: