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
| | |-+  How is dircache supposed to work?
« previous next »
  • Print
Pages: [1] 2

Author Topic: How is dircache supposed to work?  (Read 4018 times)

Offline paddlaren

  • Member
  • *
  • Posts: 11
How is dircache supposed to work?
« on: October 10, 2006, 04:25:46 PM »
Hi!

I used to have the dir-cache enabeled to save the battery some. I never noticed it used to update regulary. This was a daily-build from may 2006 I gues (not very certain).

After an update to a recent daily-build (I tried the one today as well) it seems that the dircach scans the disk everytime I switch the device on. This is definitly not what I needed.

Now I wonder how the dircache is supposed to work. Is it supposed to update every time I switch on, after USB-connection, manually? Is the information stored on file to be reused if disk not changed? Does it reflect the compleet directory-structure of the disk and is there any limitations to fit in memory?

I gues that a well designed dircache can save some batterytime. It must be possible to design a smart solution to make the most of the batteries.

By the way, I have an iAudio X5 if that matters.

// Erik
Logged
Jabber: paddlaren@kdetalk.net

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: How is dircache supposed to work?
« Reply #1 on: October 10, 2006, 04:29:55 PM »
Dircache has no way to know if the disk has changed after a USB connection without scanning, so scanning is necessary after a connection for it to continue functioning.
Logged

Offline paddlaren

  • Member
  • *
  • Posts: 11
Re: How is dircache supposed to work?
« Reply #2 on: October 10, 2006, 04:43:36 PM »
This is to bad. I think that updating only after an USB-connection whould be great.

I have reason to belive that the original X5 software detects that the USB has been connected, at least it behaves different during boot afterwards.

If it wheren't for that Rockbox stores thing on disk (playlists, bookmarks etc) it should be possible to detect diskchanges in the FAT-table for devices with FAT and let it trig the disk-scan.
Logged
Jabber: paddlaren@kdetalk.net

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: How is dircache supposed to work?
« Reply #3 on: October 10, 2006, 04:46:52 PM »
You seem to have misunerstood, if you just shut down, and then boot up again, without booting any other firmwares or going into USB mode, it shouldn't have to update.
Logged

Offline paddlaren

  • Member
  • *
  • Posts: 11
Re: How is dircache supposed to work?
« Reply #4 on: October 11, 2006, 01:09:30 AM »
Isn't it my iAudio that have misunderstood? The device scans the disk every time I boot no matter whether I like it or not  :)

This is exactly why I ask the question. If this is an error I will file a bug.
Logged
Jabber: paddlaren@kdetalk.net

Offline paddlaren

  • Member
  • *
  • Posts: 11
Re: How is dircache supposed to work?
« Reply #5 on: October 11, 2006, 01:13:15 AM »
Quote from: Llorean on October 10, 2006, 04:46:52 PM
if you just shut down, and then boot up again, without booting any other firmwares or going into USB mode, it shouldn't have to update.

This means that the device actualy can sense if USB was connected or not, and the expected behavior is pretty much like I ask for.

I use ther X5 dual-boot firmware. Maby it works better with the more official Rockbox firmware.
Logged
Jabber: paddlaren@kdetalk.net

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: How is dircache supposed to work?
« Reply #6 on: October 11, 2006, 02:12:49 AM »
Note that I've said "should" as it may not be working properly, but try it with the official version and see if Dircache scans every boot, or only after USB connections.
Logged

Offline Lear

  • Developer
  • Member
  • *
  • Posts: 533
Re: How is dircache supposed to work?
« Reply #7 on: October 11, 2006, 02:19:07 AM »
Quote from: paddlaren on October 11, 2006, 01:09:30 AM
Isn't it my iAudio that have misunderstood? The device scans the disk every time I boot no matter whether I like it or not  :)

This is exactly why I ask the question. If this is an error I will file a bug.

This is not a bug, as far as I know. It always scans the disk after every boot and after every USB disconnect, as the disk contents may have changed. Apparently there is no easy way to detect this.
Logged

Offline LinusN

  • Member
  • *
  • Posts: 1914
Re: How is dircache supposed to work?
« Reply #8 on: October 11, 2006, 04:21:29 AM »
It always scans the disk, as there is no way of knowing if the contents have changed or not. It will still save a lot of battery in most cases. If you don't like it, turn it off.
Logged
Archos Jukebox 6000, Recorder, FM Recorder/iAudio X5/iriver H1x0, H3x0/Toshiba Gigabeat F20/iPod G5, G5.5

Offline sadur

  • Member
  • *
  • Posts: 7
Re: How is dircache supposed to work?
« Reply #9 on: August 28, 2010, 11:15:00 AM »
Hi.
I know that this post is very old, but I have a similar issue.
On my iPod 5.5G 80GB I have thousands of music files and with a similar directory structure I have thousands of playlists files. If I activate dircache it takes several seconds after the rockbox menu appears on *every* boot until the disk stops its activity checking if there are any modified files to update into the dircache. After that, thanks to the dircache feature, navigating the file-tree structure goes smoothly. If I begin to navigate the file structure before the dircache stops and play some album, the playback delays several seconds, and all slows down.
If I deactivate the dircache feature the player is available immediately, but the navigation and the load a playlists slows down noticeably.
In my case I update my files from time to time. Is there a way to activate dircache initially and then only update it manually on-demand if I update my files? Is the dircache a file that can be loaded into memory without checking anything, or is it build from scratch on every boot.
Logged

Offline AlexP

  • Global Moderator
  • Member
  • *
  • Posts: 3688
  • ex-BigBambi
Re: How is dircache supposed to work?
« Reply #10 on: August 28, 2010, 12:13:38 PM »
This sounds a bit dangerous - what if something changes and you forget to update it, then Rockbox tries to write something?  I'm sure you could hack it to do this, but I don't think the chances of it happpening in SVN are very high.
Logged
H140, F60, S120, e260, c240, Clip, Fuze v2, Connect, MP170, Meizu M3, Nano 1G, Android

Offline sadur

  • Member
  • *
  • Posts: 7
Re: How is dircache supposed to work?
« Reply #11 on: August 28, 2010, 12:33:16 PM »
Ok, I've only posted my impressions on that. If there is a way of knowing if the files have changed or not on every boot it would be nice to improve the dircache load time.
Thank you.
Logged

Offline AlexP

  • Global Moderator
  • Member
  • *
  • Posts: 3688
  • ex-BigBambi
Re: How is dircache supposed to work?
« Reply #12 on: August 28, 2010, 02:21:45 PM »
On virtually all targets there isn't without reading all the files (which is what dircache does so you save nothing) as you could have either used bootloader USB (although we could do something about that) or more of a problem USB in the OF.
Logged
H140, F60, S120, e260, c240, Clip, Fuze v2, Connect, MP170, Meizu M3, Nano 1G, Android

Offline gevaerts

  • Administrator
  • Member
  • *
  • Posts: 1053
Re: How is dircache supposed to work?
« Reply #13 on: August 28, 2010, 04:11:13 PM »
Quote from: sadur on August 28, 2010, 11:15:00 AM
On my iPod 5.5G 80GB I have thousands of music files and with a similar directory structure I have thousands of playlists files.
If I begin to navigate the file structure before the dircache stops and play some album, the playback delays several seconds, and all slows down.

Which rockbox version are you running?

Edit: I'm asking this because I committed a disk IO priority system somewhere in April (so before 3.6), specifically to solve this issue. I just tested again on my 30GB ipod video, with a test set of about 80000 files, and it works perfectly fine. The player is responsive immediately after boot, and playback starts immediately, with dircache enabled. The disk is still busy for a minute or so of course (there is still a full rescan on boot), but apart from using some battery this doesn't have any impact.
« Last Edit: August 28, 2010, 04:54:48 PM by gevaerts »
Logged

Offline sadur

  • Member
  • *
  • Posts: 7
Re: How is dircache supposed to work?
« Reply #14 on: August 29, 2010, 10:42:02 AM »
I'm on r27860.
My player is responsive immediately after boot if I only navigate through the files or menus, but if I play something before the disc stops working because of dircache, both the playback and the dircache scannig delays several seconds, depends on the amount left to scan, I guess.
Logged

  • Print
Pages: [1] 2
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  How is dircache supposed to work?
 

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

Page created in 0.114 seconds with 14 queries.