[confirm] Mediaportal randomly stops playing videos from networkshare (1 Viewer)

mironicus

Portal Pro
March 9, 2008
688
44
Since some weeks I noticed a very annoying behaviour if I play videos from a network share. After some minutes the videoplay just randomly stops.

In the logs you can see the cause of the problem:

2010-12-01 17:36:36.503209 [Debug][(28)]: fileSystemWatcher_Error path z:\bakuman exception=System.ComponentModel.Win32Exception: Der angegebene Netzwerkname ist nicht mehr verfügbar
2010-12-01 17:36:36.503209 [Debug][(22)]: fileSystemWatcher_Error path z:\mm! exception=System.ComponentModel.Win32Exception: Der angegebene Netzwerkname ist nicht mehr verfügbar
2010-12-01 17:36:36.504209 [Debug][(21)]: fileSystemWatcher_Error path z:\fortune arterial exception=System.ComponentModel.Win32Exception: Der angegebene Netzwerkname ist nicht mehr verfügbar
2010-12-01 17:36:36.505209 [Debug][(28)]: RemoveWatcher z:\bakuman
2010-12-01 17:36:36.505209 [Debug][(22)]: RemoveWatcher z:\mm!
2010-12-01 17:36:36.506209 [Debug][(21)]: RemoveWatcher z:\fortune arterial
2010-12-01 17:36:36.543211 [Debug][FileSystemManager Thread(6)]: AddWatcher z:\gokujyo no koibito
2010-12-01 17:36:36.550211 [Debug][FileSystemManager Thread(6)]: AddWatcher z:\hyakka ryouran samurai girls
2010-12-01 17:36:36.555212 [Debug][FileSystemManager Thread(6)]: AddWatcher z:\iron man
2010-12-01 17:36:36.560212 [Debug][FileSystemManager Thread(6)]: AddWatcher z:\kuragehime
2010-12-01 17:36:53.965208 [Info.][MPMain(1)]: VideoPlayer9: Cleanup DShow graph

The FileSystemWatcher reports that it can't find the network folder anymore and the movie playback stops. However after the video is stopped I can just start it again without problems.

The attached Mediaportal.log is from the latest SVN. I also attached a complete log where Mediaportal crashed during video playback - the logs also reports some fileSystemWatcher errors.
 

mironicus

Portal Pro
March 9, 2008
688
44
AW: Mediaportal randomly stops playing videos from networkshare

My problem seems related to Mantis 3062:

Revision: 26712
Autor: gibman_dk
Datum: 20:49:21, Montag, 8. November 2010
Meldung:
fixed mantis : 3126: performance improvements
bug in HasFolderBeenScanned
filesystem watchers are being added sooner.
----
Verändert : /trunk/mediaportal/Core/Util/Util.cs

I have compiled svn 26938 with 26712 changes reverted. This seems to solve it - no more error messages that the folder names are missing and the playback goes till the end when playing files over network. With the unchanged svn 26938 I still get the messages and the video stops randomly.
 

mironicus

Portal Pro
March 9, 2008
688
44
AW: Mediaportal randomly stops playing videos from networkshare

No one can confirm this? The issue still exists for me on the latest build. My self compiled version 26938 with the reverted change from 26712 works fine though.
 

draclich

Portal Member
March 4, 2007
21
3
melb.vic.au
Home Country
Yeah I can confirm it. Will have to chase up logs since to get around the issue I disabled sections of code in util.cs to eliminate the file watchers being added.
 

draclich

Portal Member
March 4, 2007
21
3
melb.vic.au
Home Country
This issue is easy to reproduce the error. Just add a network share to your video folder list. The network share can be to a local drive and it still happens. Then browse in and out of folders in the network share until MediaPortal locks up.

Both logs show different errors and its hard to pin point the exact cause. I commented out calls to AddWatcher, SetupFileSystemManagerThread and SetupFileExistsCacheThread in Util.cs so that MediaPortal was usable.
 

draclich

Portal Member
March 4, 2007
21
3
melb.vic.au
Home Country
Well having a better look at it the issue is with the updatewatcher call. Removing the add watcher call stopped it from freezing. While debugging there are several smb errors getting caught and i think update watcher is just adding to the issue by trying to spin off new threads until it become non responsive.

the smb error is "The network BIOS command limit has been reached" so i think there are just two many threads being opened. I test out later with modifying a registry key as per "The network BIOS command limit has been reached" error message in Windows Server 2003, in Windows XP, and in Windows 2000 Server to include the command limit. However I don't think this is the right solution.
 

draclich

Portal Member
March 4, 2007
21
3
melb.vic.au
Home Country
To stop MediaPortal from freezing the below will disable caching and therefore the issue without a code change. I can't find the option in the configuration tool.

in MediaPortal.xml

add

Code:
<entry name="fileexistscache">false</entry>

just after

Code:
<section name="general">
 

draclich

Portal Member
March 4, 2007
21
3
melb.vic.au
Home Country
I have created a patch that cleans up the watcher handling. Below is the main changes

The remove watcher section was looping for every directory that was being adding instead of just once per cycle.

The SQLlite journal files where triggering the created and deleted handlers due to the user data directory having a file watcher on it. The journal files are now ignored.

Changed the method by which the main file watch loop occurs to be a boolean switch instead of a date time check. Set the switch in the created and deleted file handlers so that the main loop processes on both conditions, previously it only worked for created.

Lastly don't create any watchers on file shares.
 

Attachments

  • only.local.watchers.patch
    6.6 KB

Guzzi

Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,161
    747
    AW: Re: Mediaportal randomly stops playing videos from networkshare

    Lastly don't create any watchers on file shares.

    I haven't looked into any code, but istn't it especially the shares, where a performanceboost is expected b the caching dictionary?
     

    Users who are viewing this thread

    Top Bottom