06-11-2010, 04:58 PM | #31 | |
Grand Sorcerer
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
First, note that what I say below are my thoughts. Kovid could easily have a different rationale or longer-term reasons for why he started this work. Calibre wants to know several bits of information about the books stored on a device. The obvious are correct title and authors, but having series, tags, dates, and some other information is also very helpful. The vast majority of devices do not store this information in a way that Calibre can see, and storing the information in file path names can go only so far. Because of this, calibre before 0.7 was severely limited in what it could do with the books. For example, using 0.6, the on device feature would have been very difficult, and perhaps impossible, to get close to right while providing even marginally acceptable performance. Detecting changes in collection information (and subsequent rebuilding) would have been impossible. The goal was to store enough calibre metadata on the device to overcome these problems and to pave the way to future features, such as syncing. We are most of the way there. What is missing is the custom field information, which will be added in a few releases once we get time to finish the work. Sony devices do store metadata, and are the only calibre-supported devices to do so, modulo the iPad, which I know little about. The issue we have been facing, as evidenced by this thread, is caused by Sony not publishing their database semantics. We must find what the information really means and how it changes by experimentation and reverse engineering, and in the process made some mistakes that hurt performance and correctness. For example, some things we have found are that the Sony truncates authors back to the first one when it rebuilds metadata, that it uses the local time of the PC instead of GMT when checking timestamps, and that it fabricates metadata for formats that can't have it (such as txt) or don't have it even though they can. We tested on our personal devices, but we clearly did not encounter all the corner cases. Thanks to the help of people on this forum, we think that the 0.7.2 release will have it right. Did I answer your question? |
|
06-11-2010, 05:00 PM | #32 |
creator of calibre
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
An additional important consideration (which applies to non sony devices) is metadata caching. For non sony devices calibre used to have to reread metadata from files each time it connected, which was very slow. Now it caches the emtadata.
|
06-11-2010, 06:08 PM | #33 |
my parent's oops...
Posts: 463
Karma: 1477570
Join Date: Feb 2009
Device: Vx->Handera->Clie-> Axim->505->650->KPW/Aura ->iOS/L2
|
thank you both chaley and kovid for explaining the changes in metadata handling. your replies totally make sense.
|
06-12-2010, 03:11 PM | #34 |
Evangelist
Posts: 412
Karma: 546196
Join Date: Mar 2009
Location: UK canal boat
Device: sony prs505, prs650, kobo Glo HD liseuses
|
Finally managed to run 0.7.2 - great improvement.
Previously it was taking 2m 30s to update metadata, now it's taking 11s. Thanks. |
06-28-2010, 02:50 AM | #35 |
You kids get off my lawn!
Posts: 4,220
Karma: 73492664
Join Date: Aug 2007
Location: Columbus, Ohio
Device: Oasis 2 and Libra H2O and half a dozen older models I can't let go of
|
But can't it do it just once, at the end?
I paged through my collection and added a book here, a book there, another book...and it's updating the metadata for each individual "send to device". And each of those is taking more than 3 minutes (I have LOTS of books).
Could you at least consider having the metadata update once at the end of all jobs run? It won't allow me to stop any of these "extra" jobs - so I can't even stop it. NOTE: Windows XP, calibre 0.7.4 Last edited by FizzyWater; 06-28-2010 at 02:52 AM. Reason: forgot to include the OS and version |
06-28-2010, 04:10 AM | #36 | ||
Grand Sorcerer
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
If you are willing to help, could you run calibre in debug mode? Calibre will produce a log telling me in much finer granularity where it is spending the time. That could give me the necessary clues to where the time is being used. To run in debug mode, first open a command box (start, run, type cmd in the box, and OK). In the command box, type: Code:
cd \ calibre-debug -g >calibre_debug.txt 2>&1 Next, send a book to your device (I hope it will take as long as before). Do as little as possible in addition, or the log could be filled with lots of extra stuff, making it hard to isolate what is going on. Now quit calibre. Using a file manager (explorer), go to C:\. You should see the file calibre_debug.txt. This file is what I want you to post. The only personal information the file will contain is the title of the book you sent and the collections that must be created for the book (if any). Feel free to look at it, but be aware that the file is in 'Unix' format, and many windows programs (like notepad) will show you one really long line instead of the correct many short lines. Email the file to me if you have any concerns about posting it. Send it to "calibre-debug [at] charles dot haleys dot name" (no quotes, make the obvious substitutions). Thank you in advance. |
||
06-28-2010, 04:12 AM | #37 | |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
It takes 3 seconds for calibre to grab my book list once it recognizes my device and show all books when I first connect. I then added a book here and a book there, each job took a few seconds to transfer the book and update the metadata. I am using 0.7.5 Win XP sp3. I can't recreate your anomaly. What you're experiencing is not how it is designed to work. Hopefully someone in the know can ask the right questions to help unravel this mystery. Update: I see while I was twiddling my thumbs browsing the calibre manual that chaley has given you guidance. Hopefully y'all can work this out. Last edited by DoctorOhh; 06-28-2010 at 04:26 AM. |
|
06-28-2010, 09:33 PM | #38 | |
You kids get off my lawn!
Posts: 4,220
Karma: 73492664
Join Date: Aug 2007
Location: Columbus, Ohio
Device: Oasis 2 and Libra H2O and half a dozen older models I can't let go of
|
Quote:
I've gotten the impression that version 0.7.5 is a buggy release. For exapmle, I saw on a different thread that there's a known bug when importing HTML files. Since I sometimes start with HTML, I didn't want to install the update - I was waiting for 0.7.6. I normally watch the posts here for a couple of days before installing any new Calibre updates! |
|
06-28-2010, 10:20 PM | #39 | |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
I was actually referring to 0.7.6 |
|
06-28-2010, 11:47 PM | #40 | |
You kids get off my lawn!
Posts: 4,220
Karma: 73492664
Join Date: Aug 2007
Location: Columbus, Ohio
Device: Oasis 2 and Libra H2O and half a dozen older models I can't let go of
|
Quote:
Hmmm...when I opened Calibre yesterday, it didn't notify me that 0.7.6 was available...maybe it was rolled out later in the day. I've already seen one bug thread about 0.7.6, so I'm hesitant about installing it, too. I'm waiting to see if it's a fluke... |
|
06-28-2010, 11:53 PM | #41 |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
|
06-29-2010, 06:15 AM | #42 |
Grand Sorcerer
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@FizzyWater: Thank you for sending me the log. I found a (i hope 'the') problem. It was in a place I never would have looked, and has nothing to do with Sonys and collections. A program component supplied by the Python people is using a very inefficient method to write to disks. Interestingly enough, they even say so in the middle of their code. (For those who want to know, the metadata cache code uses JSON, which is using unbuffered writes. Combine that with using unbuffered I/O with removable storage, the norm on XP I think, and you have performance death.)
Under Win7, both my phone card and my PRS-300 are forced to a performance-enhanced mode (write behind is forced on), so I can't completely measure the effects of the fix. However, even in my case I see a 10-times improvement, with 1500 books taking 1 second instead of 10. My guess is that you will see more improvement than that. In addition, using your log and the one June sent earlier, I isolated two spots in the Sony driver that could be improved. Fizzywater's log indicates that building collections took 11 seconds for 1500 books. With the code changes, that time should drop to below 7 seconds, perhaps as low as 5. A drop in your bucket, but as one supermarket here says, "every little helps". I have neither an XP machine nor a 505 to test with, so I can't be sure of the magnitude of the improvement. My guess is that in FizzyWater's case, the time will drop from approximately 220 seconds to approximately 25. It could drop to as low as 10, but I am not holding my breath. @FizzyWater: the remapping messages in the log are not a problem. Remapping happens because calibre puts the books before the playlists in the Sony database, which can change their ID. It looks like the new book you added was given id 200. Also, the numbers in the front of the log are time in tenths of seconds from when the device was connected. Looking at the log, you will see that the vast majority of the time is taken between USBMS: starting sync_booklists and USBMS: finished sync_booklists. Fortunately for me, from calibre's point of view not much happens between those two messages, so it was relatively easy to chase the problem to its external source. Last edited by chaley; 07-04-2010 at 06:30 AM. Reason: Fix June's name. |
06-29-2010, 06:59 AM | #43 | |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
Great job with digging in and finding the little things that hide in the dark. |
|
06-29-2010, 10:33 PM | #44 |
You kids get off my lawn!
Posts: 4,220
Karma: 73492664
Join Date: Aug 2007
Location: Columbus, Ohio
Device: Oasis 2 and Libra H2O and half a dozen older models I can't let go of
|
|
06-30-2010, 03:52 AM | #45 |
Grand Sorcerer
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Book covers not sending to device | tdavis74 | Calibre | 5 | 07-25-2010 11:38 PM |
PRS-505 sending PDF to device too much slow | danizzz | Sony Reader | 3 | 07-07-2010 01:26 AM |
PDF metadata not written sending to device | joselitux | Calibre | 8 | 05-25-2010 12:03 AM |
Sending E-Books to Device | Lady Fitzgerald | Calibre | 3 | 05-16-2010 03:43 PM |
default format when sending to device | richreads | Calibre | 5 | 04-05-2010 04:20 PM |