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

#26 2010-04-15 07:28:19

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.

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



Now an interesting twist....

If I first Create an empty Music Dir and set it up as INotify then add the directories in then then dirs and files are added correctly to the database.

Offline

 

#27 2010-04-15 10:44:39

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

Re: MediaTomb with Inotify support

I've added Inotify to my existing music dir and after rescan it still working. Creating, renaming, changing, removing files and dirs are catched by MediaTomb.

Hm... I've found it.

After restarting MediaTomb, it rescan all directories, but did not add inotify watches. And Inotify working only in root folder. Strange behaviour, and I can see two reasons:
1. Inotify implementation in DNS323 kernel is different from  inotify implementation in current kernel, and cannot catch recurse changes.
2. It is a bug (or feature) in MediaTomb.

Both of assertions can be checked.

Offline

 

#28 2010-04-15 22:40:31

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

Re: MediaTomb with Inotify support

ugly but workable.... now on to the next perplexing question.  Why does wmp12 think there are multiple instances of each file being served up by mediatomb.

I've deleted the .wmdb's in  C:\Users\Robert\Local Settings\Application Data\Microsoft
and rebuilt the database in MediaTomb.

config.xml

  <server>
    <pc-directory upnp-hide="yes"/>



Starting with a clean reboot and an empty music directory
1. Set full, recursive and inotify on "Music" folder
2. Copy 1 album folder to "Music"

INotify recognizes the  change and adds the album to the database.

3. copy one album folder to the Music folder
4. run wmp and connect to mediatomb

  14 songs 8 instance of each title found.  impressive.  doh!
- File Path Column shows them to be from the same correct source.

Last edited by RobertFontaine (2010-04-15 22:46:12)

Offline

 

#29 2010-04-15 23:01:08

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

Re: MediaTomb with Inotify support

Windows Media Player shows the following instances of a song.

In the case where there is more than one instance a difference id is shown and in the case of the "js" and "builtin" import script 2 different titles are being exposed and saved for the same son.

Disabled =     <pc-directory upnp-hide="yes"/>
... Start with a folder with a single song in it.
Full , Recursive.

disabled with no INotify = 1 instance smile
js with no INotify = 9 instances.
builtin with no INotify =

Enabled =     <pc-directory upnp-hide="No"/>
... Start with adding an Empty Folder
Full, Recursive, Inotify.

and add a single song into the folder

disabled with Inotify = 0 instances despite the song definitely having been added to the database 1 time.
js with INotify =  8 Instances
builtin with INotify = 8 instances

The database isn't being correctly updated correctly in a few different ways.
In the "js" script multiple 2 virtaual instances are being sent plus

MediaTomb is either making (or exposing) extra song entries.
I think the author needs to implement a unit test framework.

Last edited by RobertFontaine (2010-04-16 00:00:35)

Offline

 

#30 2010-04-16 00:12:53

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

Re: MediaTomb with Inotify support

microsoft's upnp implementation is broken, not mediatomb.

Last edited by oxygen (2010-04-16 00:14:12)

Offline

 

#31 2010-04-16 04:09:42

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

Re: MediaTomb with Inotify support

While msft's upnp may be broken, mediatomb is still transmitting multiple items to the software.   The unique source id's are visible in the source column on the microsloth side.
Mediatomb is sending more than 1 item.

Offline

 

#32 2010-04-16 10:05:03

rintje
Member
Registered: 2010-02-08
Posts: 14

Re: MediaTomb with Inotify support

Hi RobertFontaine,
this may be a silly question and a little off topic, but how do you approach mediatomb with Windows Media Player exactly? I did google around, but info about this seems very sparse.


Conceptronic CH3SNAS | Firmware v1.05b1 | Funplug 0.5 on USB
Mods: Cleanboot, Chkbutton2, NZBGet, Squeezebox Server

Offline

 

#33 2010-04-16 10:09:30

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

Re: MediaTomb with Inotify support

This forum is about NAS, not MediaTomb. Try to ask your questions on MediaTomb forum.

Offline

 

#34 2010-04-16 10:45:44

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

Re: MediaTomb with Inotify support

RobertFontaine wrote:

While msft's upnp may be broken, mediatomb is still transmitting multiple items to the software.   The unique source id's are visible in the source column on the microsloth side.
Mediatomb is sending more than 1 item.

Which is absolutly correct and usuall behaviour for most upnp software. it's a feature.

Last edited by oxygen (2010-04-16 10:49:45)

Offline

 

#35 2010-06-05 12:07:14

taz030485
New member
Registered: 2010-06-05
Posts: 1

Re: MediaTomb with Inotify support

Today I changed over from boilerjt's mediatomb-0.12.0-SVN2017 to sirmax's to make use of inotify.
However I seem to be having an issue with the auto-update.

I have the root of both drives shared and only files added to the root are added.
This seem to be the behavior described below

sirmax wrote:

After restarting MediaTomb, it rescan all directories, but did not add inotify watches. And Inotify working only in root folder. Strange behaviour, and I can see two reasons:
1. Inotify implementation in DNS323 kernel is different from  inotify implementation in current kernel, and cannot catch recurse changes.
2. It is a bug (or feature) in MediaTomb.

So was this ever followed up or is there a workaround to watch all directories recursively?

I am running FW 1.07, if it helps.

Offline

 

#36 2010-06-05 18:28:25

Jobine
Member
Registered: 2010-01-27
Posts: 39

Re: MediaTomb with Inotify support

I have the same problem then RobertFontaine and interest by the solution.

Offline

 

#37 2010-07-26 13:35:27

someone
New member
Registered: 2010-07-26
Posts: 2

Re: MediaTomb with Inotify support

How did you compile the mediatomb? natively on the DNS-323 or with a toolchain on a linux-computer?
is it possible to compile the latest 0.12.1 also?

Offline

 

#38 2010-07-26 13:53:42

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

Re: MediaTomb with Inotify support

someone wrote:

How did you compile the mediatomb? natively on the DNS-323 or with a toolchain on a linux-computer?
is it possible to compile the latest 0.12.1 also?

It compiled on DNS-323. I have no another linux box now.
I'll complile 0.12.1 when will have time for it.

Offline

 

#39 2010-07-26 14:01:38

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

Re: MediaTomb with Inotify support

mediatomb 0.12.1 package is placed on http://sites.google.com/site/sirmaxwiki/

Offline

 

#40 2010-07-26 14:30:26

someone
New member
Registered: 2010-07-26
Posts: 2

Re: MediaTomb with Inotify support

Wow. That's awesome! Many thanks!

Offline

 

#41 2010-07-27 09:14:28

Muppet
Member
Registered: 2008-05-21
Posts: 44

Re: MediaTomb with Inotify support

Code:

/mnt/HD_a2/ffp/start # ./mediatomb.sh start 
Starting /ffp/bin/mediatomb -d -e egiga0 -u nobody -m /ffp/var -f mediatomb -l /ffp/var/mediatomb/mediatomb.log
/ffp/bin/mediatomb: can't load library 'libmp4v2.so.1'

Anyone know where I can get libmp4? I cannot find it anywhere.

I currently use another build of mediatomb from this link below and I believe it is statically compiled in.
http://dns323.kood.org/forum/viewtopic.php?pid=21854

I am an fw 1.08 and using v 0.12.1

Never Mind! I found it on the sirmax wiki. Unfortunately thre file is called mp4... instead of libmp4... so I didn't see it before.

Last edited by Muppet (2010-07-27 09:35:38)

Offline

 

#42 2010-07-27 15:03:26

Jobine
Member
Registered: 2010-01-27
Posts: 39

Re: MediaTomb with Inotify support

MKV to work with this package?
we do something special to activate the ffmpegthumbnailer?

Offline

 

#43 2010-09-07 00:19:49

KnightFire
Member
From: Canada
Registered: 2010-07-09
Posts: 17

Re: MediaTomb with Inotify support

Running FW 1.07 on C1:

Downloaded and installed mediatomb-0.12.1-2.tgz
hunted around and found the libraries I could but I'm still missing:

# ldd `which mediatomb` | grep "not"
    libpng14.so.14 => not found
    libjpeg.so.7 => not found
    libcares.so.2 => not found
    libidn.so.11 => not found
    libfaac.so.0 => not found
    libfaad.so.2 => not found
    libmp3lame.so.0 => not found
    libx264.so.83 => not found

SirMax would you please point me in the right direction?  Could you add them to your d/l wiki?

Offline

 

#44 2010-09-07 10:06:15

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

Re: MediaTomb with Inotify support

KnightFire wrote:

Running FW 1.07 on C1:

Downloaded and installed mediatomb-0.12.1-2.tgz
hunted around and found the libraries I could but I'm still missing:

# ldd `which mediatomb` | grep "not"
    libpng14.so.14 => not found
    libjpeg.so.7 => not found
    libcares.so.2 => not found
    libidn.so.11 => not found
    libfaac.so.0 => not found
    libfaad.so.2 => not found
    libmp3lame.so.0 => not found
    libx264.so.83 => not found

SirMax would you please point me in the right direction?  Could you add them to your d/l wiki?

Now i building static package, that will have only one depend from curl. Please wait, i'll commit it today or tomorrow.

Offline

 

#45 2010-09-07 16:26:00

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

Re: MediaTomb with Inotify support

I build mediatomb-0.12.1 with static libraries. Is is only depends from curl and bzip2, other libraries are included in base fonz fun_plug 0.5 installation or statically linked in the mediatomb binary. Additional libraries are also can be installed from fonz fun_plug: curl-7.19.4-1 and bzip2-1.0.5-2.

Package name: mediatomb-0.12.1-3.tgz
Download from: http://sites.google.com/site/sirmaxwiki/


Some technical info:

# 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


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


About inotify. The main problem is that ulimit for open file descriptors on DNS-323 is only 1024. I have runned lighttpd with fcgi + transmission from user 'nobody' and mediatomb have no free descriptors to add inotify watches.
It seems that addong 'ulimit -n 65536' into /ffp/etc/fun_plug.local fix that problem.

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: supported2010-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:
# ls -l /dev/inotify
crw-rw-rw-    1 root     root      10,  63 Sep  7 16:19 /dev/inotify

Last edited by sirmax (2010-09-08 10:09:38)

Offline

 

#46 2010-09-07 16:42:21

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

Re: MediaTomb with Inotify support

First topic post is updated.

Offline

 

#47 2010-09-08 04:53:49

KnightFire
Member
From: Canada
Registered: 2010-07-09
Posts: 17

Re: MediaTomb with Inotify support

Wow!  Many thanks, I really appreciate the effort.

Offline

 

#48 2010-09-11 08:12:30

KnightFire
Member
From: Canada
Registered: 2010-07-09
Posts: 17

Re: MediaTomb with Inotify support

MediaTomb 0.12.1 keeps crapping out :-(   May be an issue with swap... because when swap fills up... and the system freaks out... it kills mediatomb :-(

Do I have to add 'ulimit -n 65536' into /ffp/etc/fun_plug.local ?  I haven't, because I don't have a fun_plug.local file to put it into.

Or reboot completely after installing inotify and mediatomb?

PS
What happened with libx264.so.83, etc.?  Is it (are they) statically linked into the binary?

Last edited by KnightFire (2010-09-11 18:09:37)

Offline

 

#49 2010-09-12 12:31:39

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

Re: MediaTomb with Inotify support

KnightFire wrote:

MediaTomb 0.12.1 keeps crapping out :-(   May be an issue with swap... because when swap fills up... and the system freaks out... it kills mediatomb :-(

When I has database with ~50.000 files, mediatomb was ~30-40MB in memory. Now I left only ~5.000 files, and memory usage is still ~30 MB. When memory is required for another process, it push out mediatomb to swap (currently I have 11MB in RAM and 19 MB in swap). When mediatomb is active, it push another process to swap and restore memory pages from swap to RAM.
I have running: transmission, mediatomb, lighttpd + perl (FCGI), and standard daemons like rsync, sshd, smbd, ntpd, etc.
As I can see, swap is working correctly and I have no problems with it. I have no crashes of any processes.

KnightFire wrote:

Do I have to add 'ulimit -n 65536' into /ffp/etc/fun_plug.local ?  I haven't, because I don't have a fun_plug.local file to put it into.

Just create it and make it executable:

Code:

echo "ulimit -n 65536" >> /ffp/etc/fun_plug.local
chmod 755 /ffp/etc/fun_plug.local

fun_plug script will execute it on boot, if it is exists and executable

KnightFire wrote:

Or reboot completely after installing inotify and mediatomb?

Reboot is not required but preffered.
To initialize inotify device without reboot you can run: /ffp/start/inotify_dev.sh start

KnightFire wrote:

PS
What happened with libx264.so.83, etc.?  Is it (are they) statically linked into the binary?

Yes, all libs that not listed as shared linked, are statically linked. I left curl and bz2 shared because they are often used in another programs, and it is more effective to have one instanse of library in memory. Also this libs are included in common-known fonz's funplug repository, and it is easy to locate and install they.

Last edited by sirmax (2010-09-12 12:35:14)

Offline

 

#50 2010-09-13 02:19:41

KnightFire
Member
From: Canada
Registered: 2010-07-09
Posts: 17

Re: MediaTomb with Inotify support

Wow!  Best reply I've ever had, many thanks!

sirmax wrote:

When I has database with ~50.000 files, mediatomb was ~30-40MB in memory. Now I left only ~5.000 files, and memory usage is still ~30 MB. When memory is required for another process, it push out mediatomb to swap (currently I have 11MB in RAM and 19 MB in swap). When mediatomb is active, it push another process to swap and restore memory pages from swap to RAM.
I have running: transmission, mediatomb, lighttpd + perl (FCGI), and standard daemons like rsync, sshd, smbd, ntpd, etc.
As I can see, swap is working correctly and I have no problems with it. I have no crashes of any processes.

Well I'm stumped then... I've but 1834 files... it seems to be an issue adding them all at once... but if I don't, I don't get the nice directory structure I want.  Only running mediatomb and the standard daemons.  Maybe I'm just using MediaTomb incorrectly.

How did you measure memory usage?  htop says 2.6% used, but top reports 40% of memory used by mediatomb.

sirmax wrote:

Just create it and make it executable:

Code:

echo "ulimit -n 65536" >> /ffp/etc/fun_plug.local
chmod 755 /ffp/etc/fun_plug.local

fun_plug script will execute it on boot, if it is exists and executable

Will try this, this evening.

sirmax wrote:

Reboot is not required but preffered.
To initialize inotify device without reboot you can run: /ffp/start/inotify_dev.sh start

Did it both ways, 512MB of swap still max'ing out.

SirMax would you be so kind as to post your config.xml as well, please.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB