PDA

View Full Version : Is / can Slimserver use iNotify?



mctubster
2006-09-09, 05:31
Just wondering .... why do we appear to be doing intensive scans to update our music libraries, when there is a much simply why ... ie through file system notifications?

Several linux distributions are supporting this out of the box now.

Anyone?
Steve

Michaelwagner
2006-09-09, 18:05
Search the forum, it's been discussed at length before. It's not as easy as it sounds in a multi-file system, multi-operating system world.

Dan Sully
2006-09-11, 00:18
Plans are to do this for 7.0

It of course won't work for networked filesystems.

http://svn.slimdevices.com/trunk/server/Slim/Utils/ChangeNotify/

Michaelwagner
2006-09-11, 01:11
It of course won't work for networked filesystems.

I wouldn't be quite so quick to dismiss the idea.

There is a protocol for sending network messages about file updates and deletes over networks. It's been a while since I looked at how it's implemented. And of course, whether it's implemented in all networking file systems or not.

But, for instance, if you open an explorer window on a file system and then, from another window or another computer, delete files in that file system, there is a short delay but the explorer window finds out, refreshes itself and the files go away.

I don't know if it's only on delete or other notify-type things too.

Michaelwagner
2006-09-11, 01:46
Insomnia is a terrible thing.

Dan: For SMB file systems, it's called a Change Notify event.

There are printer events and file system events.

File system events are first supported in NT, so anything W2K+ should work fine (and that's all Slim officially supports in the windows arena these days).

There are some bugs in this area, and I couldn't figure out if Samba supports these properly. The Samba docs say it's hard, because there's no exact equivalent in *nix, but then they seem to go on and say they figured it out anyways. Samba isn't one of those things I know a lot about.

HTH.

mavit
2007-11-25, 10:43
Plans are to do this for 7.0

http://svn.slimdevices.com/trunk/server/Slim/Utils/ChangeNotify/

Any news on this?

kdf
2007-11-25, 14:48
On 25-Nov-07, at 9:43 AM, mavit wrote:

>
> Dan Sully;135132 Wrote:
>> Plans are to do this for 7.0
>>
>> http://svn.slimdevices.com/trunk/server/Slim/Utils/ChangeNotify/
>
> Any news on this?
>
none, sorry.
-kdf

hickinbottoms
2007-11-26, 02:19
Any news on this?

I'm going to take a look at this, I think. I suspect it can be added via a plugin.

Can't say when I might have something, though, as I'm pretty busy at the moment.

Stuart

Michaelwagner
2007-11-26, 04:42
I wouldn't be quick to assume the problem can be fixed in a plug-in. It goes quite deep.

IIRC, sychronized players are only loosely synchronized. They each fill their own buffers, and play at their own speed (set by the clock crystal or some derivitive thereof). Sychronization code in the server stops them all (or at least lets them run dry) and only restarts them when the slowest one is finished. So the pause between tracks is needed for synchronized play. Any attempt at removing it (cross-fade, gapless play) breaks synchronized play.

The solution, back in R6, was expected to come from a network time signal that all players played to. But I don't think that got into 7. Without it, (or the pause between songs) synchronized players would unsynch within a few songs and sound awful.

That is my recollection, although it's a year old and it is 6:30AM in my time zone. So it could be wrong. And I've never looked at the 7 code to see if the issues are still the same.

hickinbottoms
2007-11-26, 05:10
You've worried me now!

I believe this issue, however, relates to the scanning of the music
library. At the moment it scans when you explicitly force it, or at
scheduled intervals. Using inotify (on Linux) will ensure that it will
immediately pick up any changes to make without having to explicitly
force a rescan.

I didn't think this had anything to do with player synchronisation
(which I'll agree is actually very complex). Are we talking about the
same thing?

Stuart

Michaelwagner wrote:
> I wouldn't be quick to assume the problem can be fixed in a plug-in. It
> goes quite deep.
>
> IIRC, sychronized players are only loosely synchronized. They each fill
> their own buffers, and play at their own speed (set by the clock crystal
> or some derivitive thereof). Sychronization code in the server stops
> them all (or at least lets them run dry) and only restarts them when
> the slowest one is finished. So the pause between tracks is needed for
> synchronized play. Any attempt at removing it (cross-fade, gapless
> play) breaks synchronized play.
>
> The solution, back in R6, was expected to come from a network time
> signal that all players played to. But I don't think that got into 7.
> Without it, (or the pause between songs) synchronized players would
> unsynch within a few songs and sound awful.
>
> That is my recollection, although it's a year old and it is 6:30AM in
> my time zone. So it could be wrong. And I've never looked at the 7 code
> to see if the issues are still the same.
>
>
>

Michaelwagner
2007-11-26, 17:20
I'm so sorry. I seem to have posted in entirely the wrong thread. I'm not sure where my mind was ... sorry.

hickinbottoms
2007-11-27, 02:40
No worries. I can't even trust myself to stand up at 6am most days, let
alone operate the heavy machinery of the internet forums!

Stuart

Michaelwagner wrote:
> I'm so sorry. I seem to have posted in entirely the wrong thread. I'm
> not sure where my mind was ... sorry.
>
>
>

hickinbottoms
2007-12-06, 02:33
Any news on this?

I've an initial beta release of a plugin that makes use of this:

http://www.hickinbottom.com/autorescan/browser/tags/1.0b1/AutoRescan.tgz?format=raw

It's for SqueezeCenter 7.0 on Linux only as it relies on inotify support, so also make sure you've got that compiled into your kernel. A quick way of checking, I think, is to make sure you have the directory "/proc/sys/fs/inotify" present.

This seems to work OK for me in the limited testing I've performed. I can add files and change their tags, and that's picked up pretty rapidly by SqueezeCenter.

The only problem at the moment is that it doesn't react to deletion (and moving files will count as an add and a delete). That's because there doesn't appear to be an easy interface to remove individual music data from the database in the same way that it can be added with a rescan of a particular folder.

Comments welcome.

Stuart

mavit
2007-12-08, 07:50
Looks good.