DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2010-01-27 01:59:09

sirmax
Member
Registered: 2010-01-26
Posts: 31

MediaTomb with Inotify support

Here you can find mediatomb-0.12.1 with static libraries, inotify support and external transcoding enabled.
All libraries are included in base fonz's funplug 0.5 installation, or statically linked in the mediatomb binary, or can be installed from fonz's funplug repository (here).

Packages are available to download from http://sites.google.com/site/sirmaxwiki/

1. MediaTomb with sqlite db support:
mediatomb-0.12.1-3.tgz
Depends: curl, bzip2, sqlite3.

Technical info:

Code:

# mediatomb --compile-info

MediaTomb UPnP Server version 0.12.1 - http://mediatomb.cc/

===============================================================================
Copyright 2005-2010 Gena Batsyan, Sergey Bostandzhyan, Leonhard Wimmer.
MediaTomb is free software, covered by the GNU General Public License version 2

Compile info:
-------------
        host:                   armv5tejl-unknown-linux-gnu
        sqlite3:                yes
        mysql:                  disabled
        libjs:                  yes
        libmagic:               yes
        inotify:                yes
        libexif:                yes
        id3lib:                 disabled
        taglib:                 yes
        ffmpeg                  yes
        libmp4v2:               yes
        external transcoding:   yes
        curl:                   yes
        YouTube:                yes
        libextractor            disabled
        db-autocreate:          yes
        debug log:              yes
        protocol info extension:yes
        ffmpegthumbnailer:      yes
        lastfmlib:              yes
        data directory:         /ffp/share/mediatomb

Code:

# ldd /ffp/bin/mediatomb
        librt.so.0 => /ffp/lib/librt.so.0 (0x4000e000)
        libmagic.so.1 => /ffp/lib/libmagic.so.1 (0x40018000)
        libiconv.so.2 => /ffp/lib/libiconv.so.2 (0x40033000)
        libsqlite3.so.0 => /ffp/lib/libsqlite3.so.0 (0x4011a000)
        libz.so.1 => /ffp/lib/libz.so.1 (0x4017e000)
        libbz2.so.1.0 => /ffp/lib/libbz2.so.1.0 (0x4019b000)
        libexpat.so.1 => /ffp/lib/libexpat.so.1 (0x401b5000)
        libcurl.so.4 => /ffp/lib/libcurl.so.4 (0x401da000)
        libssl.so.0.9.8 => /ffp/lib/libssl.so.0.9.8 (0x4021e000)
        libcrypto.so.0.9.8 => /ffp/lib/libcrypto.so.0.9.8 (0x40264000)
        libdl.so.0 => /ffp/lib/libdl.so.0 (0x4039b000)
        libstdc++.so.6 => /ffp/lib/libstdc++.so.6 (0x403a6000)
        libm.so.0 => /ffp/lib/libm.so.0 (0x4049b000)
        libgcc_s.so.1 => /ffp/lib/libgcc_s.so.1 (0x404b6000)
        libpthread.so.0 => /ffp/lib/libpthread.so.0 (0x404c9000)
        libc.so.0 => /ffp/lib/libc.so.0 (0x404e3000)
        ld-uClibc.so.0 => /ffp/lib/ld-uClibc.so.0 (0x40000000)

2. MediaTomb with mysql db support:
mediatomb-mysql-0.12.1-3.tgz
Depends: curl, bzip2, mysql-5.0.67.

Code:

MediaTomb UPnP Server version 0.12.1.
Compile info:
  host: armv5tejl-unknown-linux-gnu
  sqlite3: disabled
  mysql: yes
  libjs: yes
  libmagic: yes
  inotify: yes
  libexif: yes
  id3lib: disabled
  taglib: yes
  ffmpeg yes
  libmp4v2: yes
  external transcoding: yes
  curl: yes
  YouTube: yes
  libextractor: disabled
  debug log: yes
  protocol info extension:yes
  ffmpegthumbnailer: yes
  lastfmlib: yes
  data directory: /ffp/share/mediatomb

MediaTomb with MySQL support is useful for big collections.
rom69 wrote: "Indexing the collection (database > 100 MB, complex import script) takes 50% less time with mysql compared to sqlite, but after the database is built, I don't feel any speed difference when browsing the database."

3. MediaTomb with Sony Bravia TV patch (this one) is available:
mediatomb-bravia-0.12.1-4.tgz
Depends: curl, bzip2, sqlite3, mysql-5.0.67.


Some info about inotify
The main problem is that ulimit for open file descriptors on DNS-323 is only 1024. I have runned lighttpd with fcgi and transmission. Both of them are runned from user 'nobody', and mediatomb have no free descriptors to add inotify watches. It seems to working after adding "unimit -n 65536" into /ffp/etc/funplug.local script file.

Also, for inotify working, the device /dev/inotify must be created. It it is not, mediatomb will exit with log message:
2010-09-07 16:13:52   DEBUG: [../src/mt_inotify.cc:107] supported(): Inotify: supported
2010-09-07 16:13:52   ERROR: You specified "yes" in "<autoscan use-inotify=""> however your system does not have inotify support

You can install my package inotify-dev-0.1-1.tgz for creating inotify device at system startup.

Created device is:

Code:

# ls -l /dev/inotify
crw-rw-rw-    1 root     root      10,  63 Sep  7 16:19 /dev/inotify

You can check for inotify working, running command:

Code:

su nobody -c /ffp/share/inotify/inotify-test

Last edited by sirmax (2011-11-08 12:12:40)

Offline

 

#2 2010-01-27 19:57:01

oxygen
Member
Registered: 2008-03-01
Posts: 320
Website

Re: MediaTomb with Inotify support

the stock kernel 2.6.12 doesnt have inotify support

Offline

 

#3 2010-01-27 21:19:30

sirmax
Member
Registered: 2010-01-26
Posts: 31

Re: MediaTomb with Inotify support

DNS-323 FW 1.07 have pathed kernel.
Just try it.

Offline

 

#4 2010-04-05 17:38:10

monkeyboy76
New member
Registered: 2010-04-05
Posts: 2

Re: MediaTomb with Inotify support

Hi Sirmax,

I really like your mediatomb 0.12 build!  Could it be possible for you to recompile with external transcoding enabled?

Offline

 

#5 2010-04-06 13:16:05

sirmax
Member
Registered: 2010-01-26
Posts: 31

Re: MediaTomb with Inotify support

monkeyboy76 wrote:

Hi Sirmax,

I really like your mediatomb 0.12 build!  Could it be possible for you to recompile with external transcoding enabled?

Ok, I add it. But I think DNS323 CPU is weak for external transcoding.

Offline

 

#6 2010-04-07 02:47:47

RobertFontaine
Member
Registered: 2010-04-01
Posts: 24

Re: MediaTomb with Inotify support

I'd love to get some of my external audio transcoded.  My receiver device is extremely limited in what it can do.  If the dns323 can handle it, I won't have to rebuild another machine as a media server. smile

Offline

 

#7 2010-04-07 08:25:25

RobertFontaine
Member
Registered: 2010-04-01
Posts: 24

Re: MediaTomb with Inotify support

missing at least one lib so far... off to dig it up.

mediatomb: can't load library 'libffmpegthumbnailer.so.4'

... did a funpkg reinstall 'I' and it's in lib where it belongs now smile
... rm'ed the contents of /var/mediatomb (could have chowned to the unreadable file to "nobody" but I didn't see that till after.

up and running.   thanks smile

Last edited by RobertFontaine (2010-04-07 09:01:08)

Offline

 

#8 2010-04-07 20:36:04

monkeyboy76
New member
Registered: 2010-04-05
Posts: 2

Re: MediaTomb with Inotify support

Sirmax!!!!

You're a star! Been trying to get mediatomb to transcode FLAC files on the fly to my PS3 and it now works!!!

For all those out there that are trying to do the same, use Sirmax's Mediatomb 0.12.0-6 build with associated packages and the following lines in your config.xml:

  <transcoding enabled="yes">
    <mimetype-profile-mappings>
      <transcode mimetype="audio/x-flac" using="audio-flac"/>
   </mimetype-profile-mappings>
      <profile name="audio-flac" enabled="yes" type="external">
        <mimetype>audio/L16</mimetype>
        <accept-url>no</accept-url>
        <first-resource>yes</first-resource>
        <hide-original-resource>yes</hide-original-resource>
        <accept-ogg-theora>no</accept-ogg-theora>
        <sample-frequency>44100</sample-frequency>
        <audio-channels>2</audio-channels>
        <agent command="/ffp/bin/flac" arguments="-dfs --force-raw-format --endian=big --sign=signed -o %out %in"/>
        <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
        </profile>
    </profiles>
  </transcoding>

big_smile big_smile big_smile big_smile

Offline

 

#9 2010-04-10 16:27:04

yhrn
New member
Registered: 2009-03-19
Posts: 2

Re: MediaTomb with Inotify support

This sounds really interesting!

Currently running the Mediatomb version included in ffp 0.5 on fw 1.06 but I was planning on upgrading to 1.08 (to get the kernel NFS server). Has anybody tried this version of Mediatomb on fw 1.08?

Also, is it correct that all the packages on http://sites.google.com/site/sirmaxwiki/ in the "MediaTomb 0.12.0 shared" folder should/could be installed simply using funpkg?

Offline

 

#10 2010-04-11 10:44:01

RobertFontaine
Member
Registered: 2010-04-01
Posts: 24

Re: MediaTomb with Inotify support

yhrn wrote:

This sounds really interesting!

Currently running the Mediatomb version included in ffp 0.5 on fw 1.06 but I was planning on upgrading to 1.08 (to get the kernel NFS server). Has anybody tried this version of Mediatomb on fw 1.08?

Also, is it correct that all the packages on http://sites.google.com/site/sirmaxwiki/ in the "MediaTomb 0.12.0 shared" folder should/could be installed simply using funpkg?

yes and yes.

Offline

 

#11 2010-04-12 02:38:54

RobertFontaine
Member
Registered: 2010-04-01
Posts: 24

Re: MediaTomb with Inotify support

Looks like I need to move funplug to a usb key to run this.   INotify crashes with   
ERROR: Inotify thread caught exception: The user limit on the total number of inotify watches was reached or the kernel failed to allocate a needed resource.

I'm guessing I need to free up some memory.

Offline

 

#12 2010-04-12 11:41:43

oxygen
Member
Registered: 2008-03-01
Posts: 320
Website

Re: MediaTomb with Inotify support

no, your kernel does not have inotify support

Offline

 

#13 2010-04-12 11:43:58

sirmax
Member
Registered: 2010-01-26
Posts: 31

Re: MediaTomb with Inotify support

oxygen wrote:

no, your kernel does not have inotify support

I already answer you that DNS-323 have patched kernel.
Look here: http://www.kernel.org/pub/linux/kernel/ … v2.6/0.23/

Offline

 

#14 2010-04-12 14:24:52

oxygen
Member
Registered: 2008-03-01
Posts: 320
Website

Re: MediaTomb with Inotify support

I know. But obviously, RobertFontaines firmware version is too old (and the including kernel dont have inotify).

Last edited by oxygen (2010-04-12 14:25:54)

Offline

 

#15 2010-04-12 14:25:58

sirmax
Member
Registered: 2010-01-26
Posts: 31

Re: MediaTomb with Inotify support

oxigen, check for new version of inotify-h-patch-3.tgz at http://sites.google.com/site/sirmaxwiki/
I include test code for inotify (both binary and sources) at /ffp/share/inotify dir. You can look and try it yourself.

Offline

 

#16 2010-04-12 14:39:44

sirmax
Member
Registered: 2010-01-26
Posts: 31

Re: MediaTomb with Inotify support

RobertFontaines, can you run /ffp/share/inotify/inotify-test from inotify-h-patch-3.tgz package?
Also try to update mediatomb package (mediatomb-0.12.0-7.tgz) - I've fixed one possible bug.

Offline

 

#17 2010-04-14 00:38:46

RobertFontaine
Member
Registered: 2010-04-01
Posts: 24

Re: MediaTomb with Inotify support

Will be updating again in the next day or two... I'm rebuilding from scratch onto a usb key.
Will download the packages from your share either tonight or tomorrow night.

Thanks again for putting these together.  INotify is a darn nice feature.    Transcoding is a nice to have but the dns-323 really doesn't have a lot of horsepower to drive it.

Offline

 

#18 2010-04-14 09:53:48

RobertFontaine
Member
Registered: 2010-04-01
Posts: 24

Re: MediaTomb with Inotify support

Inotify is still failing.
ERROR: Inotify thread caught exception: The user limit on the total number of inotify watches was reached or the kernel failed to allocate a needed resource.

Fresh install of all software...

DSN-323 rev b
firmware 1.08
ffp running on a 4 gig usb partition
fun_plug 0.5 with packages installed
all packages from sirmax

config modified to use utf-8

I ran inotify-test
inotify_init(): OK
inotify_add_watch(): ....................................................................................................OK
testing file creation:
.. 99 files created.
testing file removing
.. 99 files deleted
cleaning
close(wd)

hmmm.

Last edited by RobertFontaine (2010-04-14 09:54:16)

Offline

 

#19 2010-04-14 09:56:44

sirmax
Member
Registered: 2010-01-26
Posts: 31

Re: MediaTomb with Inotify support

So inotify is working in your kernel, but not in MediaTomb. How many root folders you have in MediaTomb library?

Also check permissions on your /dev/inotify device. It must be 0666, because MediaTomb is running from unprivileged user.

Last edited by sirmax (2010-04-14 10:03:35)

Offline

 

#20 2010-04-14 11:48:49

RobertFontaine
Member
Registered: 2010-04-01
Posts: 24

Re: MediaTomb with Inotify support

1 root folder - "Music"

root@Musicbox:/dev# ls -al inotify
crw-rw-rw- 1 root root 10, 63 Apr 14 01:29 inotify

Offline

 

#21 2010-04-14 13:01:25

sirmax
Member
Registered: 2010-01-26
Posts: 31

Re: MediaTomb with Inotify support

Ok, I'll try to reproduce your error.
I don't use MediaTomb for now, because XMBC have weak support of UPnP and I was switched to SMB Shares.

Offline

 

#22 2010-04-15 00:06:32

sirmax
Member
Registered: 2010-01-26
Posts: 31

Re: MediaTomb with Inotify support

Inotify is working on my device. I was checked it on directory with hundreds of dirs and thousands of files.
Did you select 'Inotify' in the 'change autoscan dir' page?
Try to enable debug mode for MediaTomb (add '-D' option to /ffp/start/mediatomb.sh) and look into /ffp/var/mediatomb/mediatomb.log

You must see somethink like this:

=====================================================
...
2010-04-14 23:43:04   DEBUG: [../src/autoscan_inotify.cc:90] init(): starting inotify thread...
2010-04-14 23:43:04   DEBUG: [../src/autoscan_inotify.cc:347] monitor(): ---> INCOMING REQUEST TO MONITOR [/mnt/HD_a2/test/inotify/dir]
2010-04-14 23:43:04   DEBUG: [../src/autoscan_inotify.cc:128] staticThreadProc(): started inotify thread.
2010-04-14 23:43:04   DEBUG: [../src/autoscan_inotify.cc:203] threadProc(): adding recursive watch: /mnt/HD_a2/test/inotify/dir
2010-04-14 23:43:04   DEBUG: [../src/autoscan_inotify.cc:376] watchPathForMoves(): adding move watch: /
2010-04-14 23:43:04   DEBUG: [../src/autoscan_inotify.cc:376] watchPathForMoves(): adding move watch: /mnt
2010-04-14 23:43:04   DEBUG: [../src/autoscan_inotify.cc:376] watchPathForMoves(): adding move watch: /mnt/HD_a2
2010-04-14 23:43:04   DEBUG: [../src/autoscan_inotify.cc:376] watchPathForMoves(): adding move watch: /mnt/HD_a2/test
2010-04-14 23:43:04   DEBUG: [../src/autoscan_inotify.cc:376] watchPathForMoves(): adding move watch: /mnt/HD_a2/test/inotify
2010-04-14 23:43:43   DEBUG: [../src/autoscan_inotify.cc:227] threadProc(): inotify event: 0 100 a
2010-04-14 23:43:43   DEBUG: [../src/autoscan_inotify.cc:227] threadProc(): inotify event: 0 8 a
2010-04-14 23:43:43   DEBUG: [../src/autoscan_inotify.cc:294] threadProc(): deleting /mnt/HD_a2/test/inotify/dir/a
2010-04-14 23:43:43   DEBUG: [../src/autoscan_inotify.cc:317] threadProc(): adding /mnt/HD_a2/test/inotify/dir/a
2010-04-14 23:44:11   DEBUG: [../src/autoscan_inotify.cc:227] threadProc(): inotify event: 0 200 a
2010-04-14 23:44:11   DEBUG: [../src/autoscan_inotify.cc:294] threadProc(): deleting /mnt/HD_a2/test/inotify/dir/a
...
2010-04-15 00:03:24   DEBUG: [../src/autoscan_inotify.cc:227] threadProc(): inotify event: 931 8 Track01.mp3
2010-04-15 00:03:24   DEBUG: [../src/autoscan_inotify.cc:294] threadProc(): deleting /mnt/HD_a2/Music/Artist/Album/Track01.mp3
2010-04-15 00:03:24   DEBUG: [../src/autoscan_inotify.cc:317] threadProc(): adding /mnt/HD_a2/Music/Artist/Album/Track01.mp3
...
=====================================================

Offline

 

#23 2010-04-15 00:35:17

RobertFontaine
Member
Registered: 2010-04-01
Posts: 24

Re: MediaTomb with Inotify support

will have a look a the debug output.
I'm not sure whether it is raising the exception (only) on the initial database creation OR whether it will fail on any change.
Will reply tonight.

I just noticed the 12.1 is now out to fix the latest youtube changes.  Good thing I'm not streaming video smile

Offline

 

#24 2010-04-15 05:55:18

RobertFontaine
Member
Registered: 2010-04-01
Posts: 24

Re: MediaTomb with Inotify support

oddly enough while inotify-test runs just fine // when I do a ps -aef it isn't running in the background as a daemon.  I assume it should be.
Nope I misunderstood... Inotify is a device and Inotifiy.sh status returns correctly.   It's running.

1) I can avoid the exception by not changing files while a scan is occurring.

but

2) When I change a files attributes (update the mp3 tag and save NO Update occurs in the database.)

Back to the -D switch.

Last edited by RobertFontaine (2010-04-15 06:06:50)

Offline

 

#25 2010-04-15 07:06:05

RobertFontaine
Member
Registered: 2010-04-01
Posts: 24

Re: MediaTomb with Inotify support

root@Musicbox:/mnt/usb/ffp/var/mediatomb# cat *log | grep otify

2010-04-14 22:52:05   DEBUG: [../src/config_manager.cc:2358] getOption(): Config: option not found: /import/autoscan/attribute::use-inotify using default value: auto
  <autoscan use-inotify="auto"/><library-options><libexif><auxdata></auxdata></libexif><id3><auxdata></auxdata></id3></library-options><magic-file></magic-file></import>
2010-04-14 22:52:06   DEBUG: [../src/storage/sql_storage.cc:1815] updateAutoscanPersistentList(): setting persistent autoscans untouched - scanmode: inotify;
2010-04-14 22:52:06   DEBUG: [../src/autoscan_inotify.cc:90] init(): starting inotify thread...
2010-04-14 22:52:06   DEBUG: [../src/autoscan_inotify.cc:347] monitor(): ---> INCOMING REQUEST TO MONITOR [/Music/Hip Hop]
2010-04-14 22:52:06   DEBUG: [../src/autoscan_inotify.cc:128] staticThreadProc(): started inotify thread.
2010-04-14 22:52:06   DEBUG: [../src/autoscan_inotify.cc:203] threadProc(): adding recursive watch: /Music/Hip Hop
2010-04-14 22:52:06   DEBUG: [../src/autoscan_inotify.cc:376] watchPathForMoves(): adding move watch: /
2010-04-14 22:52:06   DEBUG: [../src/autoscan_inotify.cc:376] watchPathForMoves(): adding move watch: /Music



update ... mp3tag. nothing...
oooooh, I see, watch for moves NOT changes.

move a file out of a directory.  hmm, nothing.

let's dig in the log...  when shutting down (cleanboot)..

2010-04-14 22:44:14   ERROR: wd not found in watches!? (3, /Music/Hip Hop/Black Eyed Peas/)
2010-04-14 22:44:14   ERROR: wd not found in watches!? (4, /Music/Hip Hop/Black Eyed Peas/2000 - Bridging The Gap/)
2010-04-14 22:44:14   ERROR: wd not found in watches!? (5, /Music/Hip Hop/Black Eyed Peas/2003 - Elephunk/)
2010-04-14 22:44:14   ERROR: wd not found in watches!? (6, /Music/Hip Hop/Black Eyed Peas/2005 - Monkey Business/)
2010-04-14 22:44:14   ERROR: wd not found in watches!? (7, /Music/Hip Hop/Black Eyed Peas/1998 - Behind The Front/)
2010-04-14 22:44:14   ERROR: wd not found in watches!? (8, /Music/Hip Hop/Black Eyed Peas/2009 - Black Eyed Peas - [Deluxe Edition] E.N.D/)
2010-04-14 22:44:14   ERROR: wd not found in watches!? (9, /Music/Hip Hop/Black Eyed Peas/2009 - Black Eyed Peas - [Deluxe Edition] E.N.D/CD 1/)
2010-04-14 22:44:14   ERROR: wd not found in watches!? (10, /Music/Hip Hop/Black Eyed Peas/2009 - Black Eyed Peas - [Deluxe Edition] E.N.D/CD 2/)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB