Bugzilla – Bug 15651
Image Viewer crashes with thousands of files in the root of the storage media
Last modified: 2010-04-08 17:26:20 UTC
I am running the latest beta firmware on my SB Controller (7.5.0-r8462), and I have found out that the Image Viewer screensaver crashes when I try to make it show pictures from a 32GB SDHC card. I have 10.000+ pictures on a card, but when I direct Image Viewer to it to show the images, the screen goes black for 5-10 seconds, and then the Controller reboots. It works well with a 2GB SD card.
Do you know what filesystem is on that card by any chance?
(In reply to comment #1) > Do you know what filesystem is on that card by any chance? Yep, it's FAT32.
Felix, is this something you could look at?
FWIW: I've added an aritificial limitation to 1000 images. It wouldn't read more. But it's very likely you're still running out of memory. I mostly tested this on Touch. Can you monitor memory usage eg. running "top -d1" in a shell when you start the image viewer?
BTW: you didn't mention the number of files on the smaller card. Some more things we should check: - would the same or similar amount of files on the smaller card crash too? - would the large card with a smaller amount of files crash too? - does it crash on a particular file? - would it still crash if you renamed the first few folders (assuming that renaming will change the order in which the images are displayed)? - could you please create a /log folder on your SD card to have the device log to it instead of RAM - then upload the messages file But this is definitely not a show stopper for 7.5/Touch
== Auto-comment from SVN commit #8475 to the repo by mherger == == https://svn.slimdevices.com/?view=revision&revision=8475 == Bug: 15651 Description: log file to be displayed when using inserted media. This should help debugging crashes in the ImageViewer
Mikkel - I don't think this is due to the number of files or the SD card. I'd rather suspect the image being too big or something. I've added some more logging (in tomorrow's firmware, r8475 or later) which should show you what file it tries to display. If you haven't done so, please set the sort order in the ImageViewer settings to random. Does it still crash? Could you identify the problem picture, copy it to the other card and see whether it would still crash? Tested with a Sandisk Ultra II 16GB SDHC card with about 1600 images (10-14 megapixels). Reading the folder structure stopped after the first 1000 items as expected ("WARN applet.ImageViewer - ImageSourceCard.lua:101 we're not going to show more than 1000 pictures - stop here").
Mikkel - any news?
== Auto-comment from SVN commit #8525 to the repo by mherger == == https://svn.slimdevices.com/?view=revision&revision=8525 == Bug: 15651 Description: don't download & render new image before previous is drawn. Move heavy image handling to a task to leave room for other SP activity.
(In reply to comment #8) > Mikkel - any news? Sorry for my absence - not really much news: I'm on firmware 8539, but it still doesn't work. I have all my pictures stored directly in the root of the SD card (makes it easier to use the card in my photo frame), but in the Image Viewer settings you cannot set the path to just "/" (I will make a new bug report on that), so mine is still set to the default "/media". Thus, I'm not even sure that the Image Viewer tries to access any image file at all - it just crashes and restarts about 30 seconds after pressing "Start slideshow". Is there anywhere I can see some debug info so I can maybe find out what it does before it crashes?
> I have all my pictures stored directly in the root of the SD card (makes What fileformat are you using? The wide spread fat (used in digicams) is limited to 512 items in the root. 10000 sounds like a crazy idea... > is still set to the default "/media". That's where your cards are mounted. Latest firmware has a "SD Card" item as a shortcut. > all - it just crashes and restarts about 30 seconds after pressing "Start > slideshow". I wonder whether it crashes as SP takes too long to read the full directory. There's a watchdog which will restart it if it can't process a command withing a given time. Reading 10000+ items might take too long. > Is there anywhere I can see some debug info so I can maybe find out what > it does before it crashes? Please see my comment #5.
(In reply to comment #11) > What fileformat are you using? The wide spread fat (used in digicams) is > limited to 512 items in the root. 10000 sounds like a crazy idea... It's FAT32 (see comment #2). I didn't know about that limitation - the card works well in my photo frame, although it does take a while for it to start showing the images. > > is still set to the default "/media". > > That's where your cards are mounted. Latest firmware has a "SD Card" item as a > shortcut. Thanks for clarifying - I didn't know that. > I wonder whether it crashes as SP takes too long to read the full directory. > There's a watchdog which will restart it if it can't process a command withing > a given time. Reading 10000+ items might take too long. That's what I was thinking as well. If I SSH-connect to the Controller and browse the media folder, it takes quite a while for the files to list (well over 60 seconds using WinSCP over a wireless connection). I will make a log and see what it says.
(In reply to comment #12) > > That's where your cards are mounted. Latest firmware has a "SD Card" item as a > > shortcut. Just upgraded to 8540, and now mine has "Local storage media", "Memory card" and "URL list" - what's the difference between the first and the second option? > I will make a log and see what it says. I set mine to "Local storage media" and pressed Start. The resulting log file is below.
Created attachment 6553 [details] Log file from Image Viewer when trying to view images from an SD card with 10.000+ images All images are now stored in a subfolder in the root.
== Auto-comment from SVN commit #8547 to the repo by mherger == == https://svn.slimdevices.com/?view=revision&revision=8547 == Fixed Bug: 15651 Description: give SP air to breath when scanning large folders for images. Idle task every 100 items, check the max items inside the folder too.
Mikkel - I was finally able to reproduce the issue. The latest change should fix the behaviour: previously the scan would starve the system, the watchdog would trigger a reboot as it didn't get any feedback from the process. The code was only idling after scanning a folder, but not _while_ scanning that folder. I changed this to idle every 100 items, which made it work in my test environment. Please give today's firmware a try and let me know if it didn't help. Thanks!
(In reply to comment #16) > Please give today's firmware a try and let me know if it didn't > help. Thanks! It works! As of 8563 the problem is gone. And even with 10.000+ images on the card, the first image shows after just a few seconds - great job!
Thanks for testing! Please note that while it doesn't crash any more, it's currently limited to the first 1000 images it finds. Even if you enable random order you'll never see all your pictures. This is to protect SP from running out of memory - SP and audio playback has all priority, as we'd rather see an incomplete slideshow than the music stop :-)
(In reply to comment #18) > Please note that while it doesn't crash any more, it's currently limited to the > first 1000 images it finds. Even if you enable random order you'll never see > all your pictures. Okay, so it will always be the first 1000 images, or does it create a set of 1000 random files every time? > This is to protect SP from running out of memory - SP and > audio playback has all priority, as we'd rather see an incomplete slideshow > than the music stop :-) Agreed :-D
first 1000. Maybe we'll review this limitation at some point. But right now we want to get Touch out the door.
This bug has been marked fixed in a released version of Squeezebox Server or the accompanying firmware or mysqueezebox.com release. If you are still seeing this issue, please let us know!