FireFly Media Server › Firefly Media Server Forums › Firefly Media Server › General Discussion › Question to mt-daapd developper (inotify request)
- This topic has 8 replies, 5 voices, and was last updated 17 years, 2 months ago by rpedde.
-
AuthorPosts
-
06/11/2006 at 12:46 PM #749jiceherParticipant
Did you plan to used inotify in place of actual scan procedure ?
It should be fine to enable an mean to automatically scan mp3_dir when some events occur (add/del/move/rename).
more informations at :http://www-128.ibm.com/developerworks/linux/library/l-inotify.html#download
and
http://inotify-tools.sourceforge.net/
http://www.kernel.org/pub/linux/kernel/people/rml/inotify/utils/Thanks
07/11/2006 at 9:35 AM #7159jiceherParticipantModo please move this topic in the appropriate section (request) and sorry to have posted in the wrong section ;o(
07/11/2006 at 11:47 AM #7160fizzeParticipantWell, while inotify would be overkill (imho) (and not being supported on must nslu2 flavours), a simple
for $file in *.[mp3][ogg][flac];do foo;
-esque script would do. where foo does an sqlite insert in the mt-daapd style. trigger that every 5 minutes, and have a dir structure like this:
incoming/
new music/put the new stuff in incoming/, the script iterates every say, 5 minutes through that directory, copies the files to new music/ and then adds it from that path. voila.
08/11/2006 at 3:29 AM #7161rpeddeParticipant@jiceher wrote:
Did you plan to used inotify in place of actual scan procedure ?
It should be fine to enable an mean to automatically scan mp3_dir when some events occur (add/del/move/rename).
more informations at :http://www-128.ibm.com/developerworks/linux/library/l-inotify.html#download
and
http://inotify-tools.sourceforge.net/
http://www.kernel.org/pub/linux/kernel/people/rml/inotify/utils/Thanks
As soon as there is a decent abstraction library for the 10 or 12 versions of inotify/dnotify/dqueue/fam etc interfaces, yeah… I probably will.
— Ron
14/09/2007 at 8:18 AM #7162quitteParticipantisn’t dbus that abstraction layer?
14/09/2007 at 9:44 PM #7163masParticipantAnd I thought dbus was some sort of inter process communication system.
As such it would be something distinctly different than a file change notifier…
But the idea of using such a thing sounds interesting in principle. What do you mean with an abstraction layer? Wouldnt simply linking against e.g. libfam (quite common) and using its functions do the job already???
15/09/2007 at 5:36 AM #7164rpeddeParticipant@mas wrote:
And I thought dbus was some sort of inter process communication system.
As such it would be something distinctly different than a file change notifier…
But the idea of using such a thing sounds interesting in principle. What do you mean with an abstraction layer? Wouldnt simply linking against e.g. libfam (quite common) and using its functions do the job already???
Sure, but I’d have to write one for every different one. Fam doesn’t work because of well-known polling limits, and a requirement to hang a notification on every directory and subdirectory in the search tree.
Fam is great for monitoring a single directory when viewing it in an explorer window, but sucks for monitoring a whole tree.
So you are back to writing one for dnotify, one for dqueue, etc. Don’t really want to maintain all those. Also, none of these would work on embedded devices (although that’s not a deal killer).
At most, I’d probably write an ipc mechanism for other programs to ask the server to re-scan a file. Then the file watcher could run from outside the server.
20/09/2007 at 1:11 PM #7165quitteParticipantI’d really love to see support for some file alteration monitor. Firefly is serving more than 60000 files in a network with multiple users here. All users have permission to add files and modify the tags of existing files. With so many changes happening all the time I don’t want to put the extra load of rescanning on the harddisks.
As I cannot solve this problem myself I did the next best thing and searched the web.I couldn’t find anything about dqueue, so I cannot comment about that.
It seems that dbus actually has some support for watching directories, but not even nautilus uses that. Instead it uses gamin, a drop-in replacement for fam.
The APIs of gamin and fam are the same. fam has dnotify support. gamin has inotify support. Also afaik both can do file system monitoring without any help of the kernel.As far as I can tell adding fam support should cover all of the filesystem change implementations.
Edit: hmm I read this thread before but forgot about the Problems with fam you mentioned 😳
23/09/2007 at 9:19 AM #7166rpeddeParticipant@quitte wrote:
I’d really love to see support for some file alteration monitor. Firefly is serving more than 60000 files in a network with multiple users here. All users have permission to add files and modify the tags of existing files. With so many changes happening all the time I don’t want to put the extra load of rescanning on the harddisks.
As I cannot solve this problem myself I did the next best thing and searched the web.I couldn’t find anything about dqueue, so I cannot comment about that.
It seems that dbus actually has some support for watching directories, but not even nautilus uses that. Instead it uses gamin, a drop-in replacement for fam.
The APIs of gamin and fam are the same. fam has dnotify support. gamin has inotify support. Also afaik both can do file system monitoring without any help of the kernel.As far as I can tell adding fam support should cover all of the filesystem change implementations.
Edit: hmm I read this thread before but forgot about the Problems with fam you mentioned 😳
I might look at them again, as it was a while ago that I looked last and decided it wasn’t usable for workloads like the ones you are describing — 60000 files. It may be that gamin + new kernels might actually work now for huge file sets. It will be a post 1.2 thing, though.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.