Long start delay for videos in a large folder containing many files (ATV2)
#1
I'm experiencing ridiculously long delay when starting a video, whenever the video file is in a directory with many files. ( tens or a couple hundred files. A lot of short video clips of our baby )

This issue began to show up in nightlies a little after 10.0-9 official, and has been bothering me for about 2 months now, but somehow nobody seems to report it. I posted my problem with xbmc.log to a nightly sticky thread, but there was no response from anyone.

Here's my original post for 20110808 build, which takes about 30seconds to start a video. ( Compared to 10 seconds of 10.0-9 official build )

http://forum.xbmc.org/showpost.php?p=862...stcount=25

20110827 build shows the same problem, at least for me.

http://pastebin.com/3BA6eBJz

Is there anyone seeing a similar issue? ( ATV2 iOS 8F305, SMB share on WD
MyBook world edition, over wired. The NAS and ATV2 are connected on two ports of a same router unit. To be more specific, a WD livewire powerline AV unit. Note that the connection between NAS and ATV2 is not through power line .)

One important characteristic is that the delay becomes short ( a few sec ) if the video file is in a small folder of just a few files. And 10.0-9 official took up to 10 seconds even for very large folders.

Here's summary of my observations :
1) ScanForExternalSubtitles takes long ( 16 sec) from beginning to end. ( ~8 sec in 10.0-9 )

2) Right after ScanForExternalSubtitles begins, OpenDir is called again, wasting 7 sec. The current directory is already open. Why open it again?

3) 9 sec taken from av_find_stream_info start to finish. ( ~2 sec in 10.0-9) There's no other logged activity in between. What is it doing for 9 sec?

4) 0 delay from "probing detected format" to av_find_stream_info. So I'm NOT talking about this known issue: http://forum.xbmc.org/showpost.php?p=850...tcount=977

5) CPU-XBMC number does not change much during all this delay. But it is quite high even during idle time. ( 96~99%, before, during, or after media playback.. ) Do I need to wait until whatever background job XBMC does after installation is finished?

6) As far as I can see, thumbnail extraction/generation options are both off in guisettings.xml

7) Not sure if this is related, but I think it takes too long to just open a folder ('open' meaning "see the list of files in it" ), when the folder has many files. It's like x10 slower than my windows Atom netbook, accessing the same SMB share over powerline connection. Why does XBMC on ATV2 take so long?

I'd appreciate it if anyone can give me some clue about this.
Thanks
Reply
#2
Okay, it seems that nobody's interested.

I just wanted to report that all my problems are gone by downgrading to 10.0-7. ( 10.0-8 was even worse, taking like 40~60 sec.. 10.0-9 was down to 10 sec. Then most nightlies since then take roughly 30 sec )

And 10.0-7 can do mixed(pics+vids) slideshow without any hiccups, which I need a lot, to run my family travel pics/vids in a nice slideshow format.
Reply
#3
24h ... man we are busy ... give us some more reaction time ... and if you have to wait for weeks ... its nothing which is intended from us.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#4
fly2thesun Wrote:I'd appreciate it if anyone can give me some clue about this.
Thanks

You should rename your userdata and see if you have the problem with a clean database. After I did that myself, and re scanned media etc, my xbmc installation was much more responsive and tiny bugs disappeared.
Reply
#5
I think all slow loading of fanart and slow loading point all to the same direction over and over. Users have issues with fanart and slow starting movies weeks and weeks now.

All related to larger file list and seeming caused by the fantart preliading done
In the theme.
Reply
#6
I have found similar times also in starting files etc.
I must admit, not having had the ATV2 before, I just thought it must be a slow CPU in the ATV2, but your times on the older version are certainly impressive.
Reply
#7
Which skin are you using?

I experienced a dramatic speed-up of playback start when I switched from Confluence to xTV-SAF: 30 sec --> 5 sec! I'm using file manager, playing from a directory with ~300 MKV movies (my library is not updated with posters and movie information yet ).

Rune.
[XBMC PRE-11.0 Git:20110827-639950e / xTV-SAF 1.1.1 / ATV2 4.2.2]
Reply
#8
i am noticing the same delay with the last 8/28 nightly. some larger files would not even play for me (.mkv)... i also noticed repetitive failures when trying to stream imdb trailers. however the mkv in question would play right away if selected through file manager. Keep in mind that all of this worked fine with previous build. Which happens to be whatever is being hosted in Cydia. This was my first nightly (on atv2 Wink). Anyway hope this helps.
Reply
#9
I tried xTV-SAF skin with 20110827 build, and it indeed reduces the wait time dramatically.. From 30~40 sec to 10~15 sec, for a folder with 600+ files. 10~15sec is still a little long, but kind of bearable, and much better than 30~40sec with Confluence skin. Thank you so much for the suggestion. ( But still not sure if recent builds are worth the extra wait, compared to the 10.0-7 version, which starts a video within about 6 secs for the same folder. )

I also tried Confluence Vertical with 20110827, and it was as bad as Confluence.
Reply
#10
The delay has become significantly shorter than before, but it's not so great yet.. ( At least for me.. as I'm seeing delay of about 10 sec for a folder with ~500 files and 20 sec for a folder with about 1000 files.. But I admit it might not be so typical to have 1000 files in a directory. ) And now it doesn't depend on the skin either. Confluence as fast as xTV-SAF.

I spent a little bit time to dig deeper with Oct 7 build. The findings are ( Oct 21 build seems to behave similarly, although I didn't check its log ):
1) Now av_find_stream_info takes 0 sec. No problem.
2) ScanForExternalSubtitles takes 20 sec for a folder of 1000 files. And "ScanForExternalSubtitles: Searching for subtitles..." is always followed by something like "OpenDir - Using authentication url smb://192%2e168%2e0%2e5/Public/Shared%20Pictures/2010/2010%5fBaby".

I found in Oct 22 source code ( 7e8111ba6c ) that the "OpenDir" log is generated by CSMBDirectory::OpenDir, which probably is called by CDirectory::GetDirectory, which is in turn called by CUtil::ScanForExternalSubtitles.

As I asked originally, I find it weird that the current directory (which is already open so that we can see the file list ) has to be opened again to scan for external subtitles And, the delay when starting a video in a given directory happens to be very similar to the delay that I experience when first browing into the given directory. So I suspect that I'm waiting for "OpenDir" to run and finish again every time I try to play a video file, which happens to be very long when the directory has many files. My cheap NAS ( WD MyBook World Edition) is indeed a slowing factor too, but the delay is not as bad ( about half or one third the delay ) when accessing the same share from my Mac (Lion 7.2) or Windows XP machine.

But it's more interesting to me that CDirectory class has some provisions (like DIR_CACHE_ONCE) for caching directory contents, but ScanForExternalSubtitles is apparently not benefiting from directory caching. And can someone explain what "DIR_CACHE_ONCE" means compared to "DIR_CACHE_ALWAYS"? And is there any way to turn on directory caching from setting files? If there's not an easy way to make it faster for me, maybe I should just get a faster NAS..
Reply
#11
try disable the stat for samba as mentioned here...

http://wiki.xbmc.org/index.php?title=Adv...3Csamba.3E
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#12
Thank you for the suggestion.

I disabled "statfiles" and now it's down to about 4 sec for a 1000-file directory. 5 times faster, and probably it is as fast as it can go with the cheap NAS, unless ScanForExternalSubtitles utilizes the cached info of the current directory.

( With statfiles=false, the normally hidden ".AppleDouble" shows up in the listing, but that's no big deal. )
Reply
#13
fly2thesun Wrote:Thank you for the suggestion.

I disabled "statfiles" and now it's down to about 4 sec for a 1000-file directory. 5 times faster, and probably it is as fast as it can go with the cheap NAS, unless ScanForExternalSubtitles utilizes the cached info of the current directory.

( With statfiles=false, the normally hidden ".AppleDouble" shows up in the listing, but that's no big deal. )

Beside that you won't get info about filesizes with it turned off...
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply

Logout Mark Read Team Forum Stats Members Help
Long start delay for videos in a large folder containing many files (ATV2)0