Mediatomb running successfully under FreeBSD

Gunther
2006-08-12
2013-05-30
  • Gunther

    Gunther - 2006-08-12

    Hi,

    I was searching for a upnp streaming server running under FreeBSD (6.0). I tried the following:

    - (some M$ proprietary delivered with my TG100 streaming client, running under XP...)
    - Twonky Vision (linux binary - worked fine under linux, nice feature set, but failed under FreeBSD)
    - GMediaServer (worked fine, but not suitable for large collections - rescans directory for each start)
    - MediaTomb (worked but I have still some problems / wishes...)

    Finally I got mediatomb compiled and running on my FreeBSD box (had to make some minor changes, most notable adding libexecinfo which provides some linux specific proc info for freebsd). But I have still two problems:

    - The mysql support does not work. mediatomb starts, but when I try to add a file/dir (mediatomb -a <dir> or via web interface) it cores. sqlite3 support works but is increadible slow when creating the DB for many, many files...
    I set up the mysql database correctly, tried with specific user and mysql-root user, with and without passwords. No success. I tried to use truss (~strace in linux) but also did not fine any hint for the problem. Is there any possibility to see debug messages from mediatomb? The core file of mediatomb showed the following:

    #0  0x282a02b7 in pthread_testcancel () from /usr/lib/libpthread.so.2
    [New Thread 0x8103a00 (runnable)]
    [New Thread 0x8103800 (sleeping)]
    [New Thread 0x8103600 (sleeping)]
    [New Thread 0x8103000 (runnable)]
    [New Thread 0x80e0e00 (sleeping)]
    [New Thread 0x80e0c00 (runnable)]
    [New Thread 0x80e0a00 (runnable)]
    [New Thread 0x80e0800 (sleeping)]
    [New Thread 0x80e0600 (sleeping)]
    [New Thread 0x80e0400 (LWP 100118)]
    [New Thread 0x80e0000 (sleeping)]
    [New LWP 100122]
    (gdb) where
    #0  0x282a02b7 in pthread_testcancel () from /usr/lib/libpthread.so.2
    #1  0x28298dac in pthread_mutexattr_init () from /usr/lib/libpthread.so.2
    #2  0x00000000 in ?? ()

    - When I have a big collection of MP3 files the list of interpreters is getting too big. I saw a feature in twonky vision that if there are too many items, they make an additional hierarchy, e.g. adding alphabetical ranges: Instead of going directly from 'interpreters' --> 'andy','angelo', 'anton', it provides something like:
    'interpreters' --> 'a-f', 'g-l', 'm-r'...

    BTW: You can add the 'TG100 Air Media' from telegent (http://www.telegent.de/pages/en/digital.html) to the list of supported streaming clients...

    Best regards and many thanks for the great application,

       Gunther

     
    • Jin

      Jin - 2006-08-12

      Hi,

      we have received a not yet finished patch for FreeBSD. It is not yet tested, we have to look into it first.

      Your log tells me that something is going wroing with pthreads, I have no idea about FreeBSD so I can't tell you anything right now, I would have to look at it on a BSD system.

      If you want to try I can send you the patch, so maybe you could do some testing and report how well it works? If all goes well we could integrate it into the upcoming 0.9.0 release.

      Regarding the TG100 - I had reports from TG100 users, that .avi playback fails. I also received some ethereal logs and we were trying to fix the problem but we couldn't figure out what it was. Apparently it is somehow related to the internal webserver of libupnp, we are still looking at that issue.

      Regarding interpreter sorting: I assume that you have installed the spidermonkey javascript engine (see README for more details).
      We support user customizable server layout, the layouting is done by the import.js script - please take a look at scripting-intro.txt and scripting-dev.txt files in the mediatomb/doc directory. You can easily adjust the server content layout to your personal wishes, so this "a-f" "g-l" thing you are looking for can be achieved by adjusting the import.js script.

      Regarding MySQL - must be something that needs
      to be adjusted in our code under FreeBSD,
      as what I can see from the patch that we
      received some things had to be adapted regarding threads and signals, so maybe you just missed something.

      Please drop a mail to jin@mediatomb.org if you want me to send you the patch.

      Thanks for the report! :)
      Jin

       
      • Gunther

        Gunther - 2006-08-13

        Hi Jin,

        thanks for the fast answer, I will try the patch and let you know if it works.

        I had already a (very short) view on the scripting-intro and planned to try this. It was just an idea, that such an automated feature would be useful as general feature. Maybe if I have an adapted import.js script I can send it - if you are interested.

        I tried the TG100 mainly with mp3s and jpegs and I think I also tried a DivX encoded AVI. I will confirm in my next post...

        Bye,

        Gunther

         
    • Jin

      Jin - 2006-08-13

      OK, just received your mail, will send you the patch right away.

      Of course you can submit your scripts! If more users plan to do this we could even put up some user-script repository with different layouts.

      Greetings,
      Jin

       
    • Gunther

      Gunther - 2006-08-15

      Thanx for the patch - now it works!

      Configuration and compilation works fine, no further interaction needed. I also tried mysql support and it seems to work - no core anymore.
      I will make a longer test and report later.

      Bye,

      Gunther

       
    • Jin

      Jin - 2006-08-15

      Thanks for the report!

      Despite the fact that it worked I would still ask you not to distribute the patch any further. The original author sees some problems in various parts of the implementation and we want to clean everything up first, prior to integrating the patch into the released version.

      Greetings,
      Jin

       
    • Gunther

      Gunther - 2006-08-16

      Hmmm, was a little bit to fast...

      I had no core anylonger with mysql db, but there was also nothing added to the DB.
      Now I really had to look deeper into the code. And I found a bug in mysql_storage.cc:

      line 98:
          char *q = (char *)malloc(value.length() * 2);
      should be:
          char *q = (char *)malloc(value.length() + 2);

      The method "MysqlStorage::quote(String value)" should add a leading and trailing ' around the String value. I do not know why, but in my ID3 tags of my MP3s there seems to be no metadata info (see sql_storage.cc --> SQLStorage::addObject --> quote(obj->getMetadata()->encode());)

      The quote function from your sqlite3 and mysql classes are different, the Sqlite3Storage::quote works and generates '' but the MysqlStorage::quote tries to allocate 2 times 0 byte and fails of course.

      I will now go on with further testing

      Bye,

      Gunther

       
      • Leo

        Leo - 2006-08-16

        Hi!

        Thank you for pointing that out. "value.length() * 2" is clearly wrong. It should be "value.length() * 2 + 1" (according to the MySQL documentation). I'm currently reworking the SQLStorage class completely to make it, let's say, "more" thread-safe than it's the case for 0.8.1. I will fix this problem in doing so.

        I'm a normally a FreeBSD user, so I have the urge to make the next release work under FreeBSD flawlessly.

        P.S. I'm currently the second developer in addition to Jin.

         
    • Gunther

      Gunther - 2006-08-21

      If MySQL documentation states "value.length()*2 + 1" I think this is to escape even a worst case string, e.g. containing only apostrophes: ''' --> '\'\'\''

      But as you add in your code also two apostrophes around you should use "value.length()*2 + 3". At least "+2" is required, if you escape the empty string (length=0) you add a leading and trailing '.

      Since that change I imported several thousend files without problems...

      I am working to learn javascript to fix my next problem now ;-)

      BTW: Is there any advance regarding transcoding on the fly? From my digicam I have many quicktime videos which I would like to stream also...

      Ciao,

      Gunther

       
    • Jin

      Jin - 2006-08-21

      Thanks for the report, we have also noticed some problems in our database code.

      Regarding transcoding... we plan to add transcoding support but I can not say which release will take care of that.

      As a temporary solution you could try using external  URL items which point to some shell scripts that trigger mencoder or somthing like that. You could also try using active-items, but I think they are broken in 0.8.1

      Well... one step after another :) We will be very happy when we finally get 0.9.0 out.. it was never planned to have a one year delay, but here we are :P The good news is, that after two weeks of fulltime coding we made a lot of progress and are really on the way now :>

      Greetings,
      Jin

       
    • Niklaas

      Niklaas - 2006-11-03

      Hello,

      Can someone help me, after a succesfull install on my linux-box i want to keep it running on my PC-BSD box.

      After some issues with pthread.h witch are solved now the next problem. See output of configure...

      ./configure
      checking for a BSD-compatible install... /usr/bin/install -c
      checking whether build environment is sane... yes
      checking for gawk... no
      checking for mawk... no
      checking for nawk... nawk
      checking whether make sets $(MAKE)... yes
      checking for g++... g++
      checking for C++ compiler default output file name... a.out
      checking whether the C++ compiler works... yes
      checking whether we are cross compiling... no
      checking for suffix of executables...
      checking for suffix of object files... o
      checking whether we are using the GNU C++ compiler... yes
      checking whether g++ accepts -g... yes
      checking for style of include used by make... GNU
      checking dependency style of g++... gcc3
      checking for gcc... gcc
      checking whether we are using the GNU C compiler... yes
      checking whether gcc accepts -g... yes
      checking for gcc option to accept ANSI C... none needed
      checking dependency style of gcc... gcc3
      checking for ranlib... ranlib
      checking for pthread.h... yes
      checking for iconv.h... no
      configure: error: iconv.h not found

      and i don't know where to look.... :)

      %locate iconv.h
      /Programs/Apache2_PHP5/include/php/ext/iconv/php_have_bsd_iconv.h
      /Programs/Apache2_PHP5/include/php/ext/iconv/php_have_glibc_iconv.h
      /Programs/Apache2_PHP5/include/php/ext/iconv/php_have_iconv.h
      /Programs/Apache2_PHP5/include/php/ext/iconv/php_have_libiconv.h
      /Programs/Apache2_PHP5/include/php/ext/iconv/php_iconv.h
      /usr/include/iconv.h
      /usr/include/sys/iconv.h
      /usr/local/include/iconv.h
      /usr/ports/converters/libiconv/work/libiconv-1.9.2/include/iconv.h
      /usr/ports/converters/libiconv/work/libiconv-1.9.2/include/iconv.h.in
      /usr/ports/converters/libiconv/work/libiconv-1.9.2/include/iconv.h.msvc-shared
      /usr/ports/converters/libiconv/work/libiconv-1.9.2/include/iconv.h.msvc-static
      /usr/ports/converters/libiconv/work/libiconv-1.9.2/include/iconv.h_vms
      /usr/src/bin/csh/iconv.h
      /usr/src/sys/sys/iconv.h

      Can someone help me pls??

      Niklaas

       
    • Jin

      Jin - 2006-11-03

      Please wait for the 0.9.0 release, it will have BSD support!

      Greetings,
      Jin

       
    • Niklaas

      Niklaas - 2006-11-03

      Hey,

      That's a real fast answer..
      Which is +- release date of the 0.9.0 ?

      Thanks and greetings,

      Niklaas

       
    • Jin

      Jin - 2006-11-03

      Hi,

      we have a 24h support line ;)

      Well, this question has been asked and answered a lot of times, unfortunately the answers were not correct until now. So I'll say: this year. :)

      Greetings,
      Jin

       
    • Dundee

      Dundee - 2006-11-11

      +1 for FreeBSD support

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks