Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  overactive dir cache?
« previous next »
  • Print
Pages: [1] 2

Author Topic: overactive dir cache?  (Read 4557 times)

Offline squidkidd

  • Member
  • *
  • Posts: 42
overactive dir cache?
« on: July 15, 2007, 08:59:49 AM »
First off, I'm using the 070712 daily build on my 80gb ipod video.  It seems to work normally except that dir cache wants to scan my disk about every other time I restart my player.  This does include when I restart without loading the original apple firmware or do a usb connection.

I did some searching and found some people with similar issues, but they seemed to be using an unsupported build or a very old build.  It doesn't do it every time, but like I said, roughly every other time I restart.  Any idea why this would happen and how I could prevent it (without disabling dir cache)?

Thanks,
Brian
Logged

Offline Febs

  • Member
  • *
  • Posts: 2701
Re: overactive dir cache?
« Reply #1 on: July 15, 2007, 09:37:32 AM »
I had a similar problem a while back.  Running a chkdsk /f fixed it.
Logged
Rockbox Forum Guidelines
The Rockbox Manual
How to Ask Questions the Smart Way
Please do not send me support questions via PM.

Offline squidkidd

  • Member
  • *
  • Posts: 42
Re: overactive dir cache?
« Reply #2 on: July 15, 2007, 10:02:36 AM »
Thanks for the suggestion Febs.  I tried that and it did not appear to help.  I also just loaded the current build and that did not appear to help either.  The player still faithfully scans the disk on startup every other time it's reset...
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: overactive dir cache?
« Reply #3 on: July 15, 2007, 10:19:24 AM »
Your post is a little bit confusing. Do you mean resetting (Select + Menu) or shutdown and restart (Long Play to shutdown, Select to restart)?

If you are just shutting Rockbox down properly and restarting you should not see the behaviour you described.

However, if you are going into Apple firmware, connecting USB, connecting to computer etc. then you will.
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline squidkidd

  • Member
  • *
  • Posts: 42
Re: overactive dir cache?
« Reply #4 on: July 15, 2007, 10:34:26 AM »
sorry, I mean shutting down properly(long play) and then restarting(select).  I do this one time and it turns on normally, going straight into now playing, then I turn it off properly, restart it and it scans disk.  If I do it again, it does not scan disk, then the next time, I get another scan of the disk.

Brian
Logged

Offline squidkidd

  • Member
  • *
  • Posts: 42
Re: overactive dir cache?
« Reply #5 on: July 15, 2007, 11:04:18 AM »
Another "symptom" I noticed was that I tried to disable the dircache and then re-enable it.  it prompted me to reboot, and when I did that, it did *not* scan the disk.  I checked in debug to see if the cache was working and it was not.  I had to restart I think twice more before it would scan and enable dircache again.  I even tried a reset in there before it would scan.

Brian
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: overactive dir cache?
« Reply #6 on: July 15, 2007, 12:14:25 PM »
Well, I'm stumped.

My Gigabeat very occasionally seems to scan for no apparent reason on startup, but I live with it.

I *guess* that whatever checks to see if there have been any disk changes, which I *presume* is done by scanning the File Allocation Table on startup just sometimes bugs out...  :-\

As you can tell, I'm no expert in this matter.
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline squidkidd

  • Member
  • *
  • Posts: 42
Re: overactive dir cache?
« Reply #7 on: July 15, 2007, 12:56:41 PM »
Ok, this just keeps getting more and more frustrating.  I have now discovered that whenever my player starts and does not scan the disk, dircache is not enabled (I checked through the debug info).  So the only time dircache gets enabled to start with is every other time it starts and says scanning disk.  Does this shed light on anything?

Brian
Logged

Offline squidkidd

  • Member
  • *
  • Posts: 42
Re: overactive dir cache?
« Reply #8 on: July 15, 2007, 01:11:45 PM »
I think I might be a little confused as to how dircache actually works.  I have now discovered that those times when the disk does not scan on startup, and I check in debug, and it says dircache is not initialized, if I give it long enough (601sec for instance) it will eventually say dircache initialized.  Does this mean dircache scans disk every time the player is turned on, it just does it though in the background?  I thought dircache disk scanning was a rare thing, and that the whole point of it was to save on disk spinning.

way confused,
Brian
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: overactive dir cache?
« Reply #9 on: July 15, 2007, 01:33:23 PM »
Considering the iPod has several modes you can get to without any Rockbox code every running, how is Rockbox supposed to know what you did between last time you ran it and this time?

Dircache *has* to check to see if files have changed. On some players there is no mode that doesn't go through some of our code first. On those we can prevent Dircache from needing to check.

Dircache prevents additional spinups and spindowns while browsing. For people who browse the filetree often it means many, many less disk spinups (specifically: One when you boot, plus any time the buffer needs refilled or a file needs to actually be loaded such as running a plugin).

Are you saying it took a literal 10 minutes for dircache to scan your drive?
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: overactive dir cache?
« Reply #10 on: July 15, 2007, 01:35:54 PM »
What it does is scan the disk and keep a map of the directories and folders so the File Browser (and Database?) do not cause the disk to spin when browsing, as it can display the filetree from memory.

In order to do this is *does* have to scan the disk for changes on startup, so it can modify the map it holds.

However, this should be very quick (my presumed FAT check) unless it actually finds some changes, in which case I believe it then physically scans the disk in order to update it's mental model of the file structure.

Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline squidkidd

  • Member
  • *
  • Posts: 42
Re: overactive dir cache?
« Reply #11 on: July 15, 2007, 01:43:03 PM »
I'm saying that when I get dircache info from the debug menu on the instances where it did not say scanning disk upon startup, it initially tells me that dircache is not initialized.  If I give it long enough, it will become initialized.  I have seen the time this takes be reported from 18s to 601s.  

I guess what I'm asking is when this is happening, is this the same as dircache scanning the disk?

Anyhow the bottom line is that every *other* time I turn the player on dircache must scan the disk which adds a livable but annoying 5-10 seconds to startup time.  this happens even by only turning the player on and off without connecting it to a computer.

Regards,
Brian


Quote from: Llorean on July 15, 2007, 01:33:23 PM


Are you saying it took a literal 10 minutes for dircache to scan your drive?
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: overactive dir cache?
« Reply #12 on: July 15, 2007, 02:38:00 PM »
Yes, because if you turn it off, you *could* turn it back on and hold the button combination to go into disk mode bypassing entirely the Rockbox bootloader.

Rockbox *cannot* know that you haven't done anything while it's shut off. AFAIK it should at least check every boot to see if new files have been added,  and I'm somewhat surprised if it doesn't.
Logged

Offline squidkidd

  • Member
  • *
  • Posts: 42
Re: overactive dir cache?
« Reply #13 on: July 15, 2007, 04:18:27 PM »
Ok, well I can just live with it scanning the disk every other boot.  My question now though is when I turn dircache off and then back on, and it says it needs a reboot, and I do that, it takes 3 or 4 reboots before the player remembers I turned dircache on.  After the first couple reboots I go to the dircache setting, and "off" is still selected even though last time the player was on, I turned it to "on".  Why does it have a hard time remembering to initially turn dircache on?  Once it loads dircache, it's fine, but that first time to get it to do so is tricky.

Brian
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: overactive dir cache?
« Reply #14 on: July 15, 2007, 04:31:32 PM »
Have you actually tried waiting to see if it's just doing a background scan?
Logged

  • Print
Pages: [1] 2
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  overactive dir cache?
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.087 seconds with 14 queries.