View Single Post
Old 08-09-2010, 05:41 AM   #8
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,902
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by kgn View Post
In fact, 0.7.6 works very well. It is what I always use. No version since then works with my PB302 - because of this problem.
Hmmm...

0.7.7 changed the way that the cache file was written. In 0.7.6 and before, the file was written line by line. On some installations/devices, this was horribly slow (3 to 4 minutes to write the cache). The change was to write the cache file in one huge write.

One possibility is that the PB302 firmware has trouble with huge writes. It could be a caching issue, where calibre closes the file but the device hasn't in fact finished writing the data. In this case, the device could refuse to permit the file to be reopened until the cache is empty, reported these back to windows as permission errors.

I am not sure what to do about this possibility, if anything. One idea is to slow down the writes, but as this would affect *everyone* it seems like a bad idea.

Another idea would be to force a filesystem 'sync' after the write. If the device behaves correctly, the sync should not return until all the data is committed to the disk.

@kgn: perhaps you are willing to try an alternate driver file. I have implemented the second option and attached the .py file (zipped). You put this file into your 0.7.13 calibre installation directory (probably "C:\Program Files\Calibre2\Lib\site-packages\calibre\devices\usbms\driver.py"), then run calibre-debug -g from a command line. When you send books, you should see lines like
Code:
DEBUG:    8.1 USBMS: starting sync_booklists
DEBUG:    8.2 USBMS: finished os.fsync()
DEBUG:    8.2 USBMS: finished sync_booklists
The second line (fsync) indicates that you are running the modified driver.

Let me know what you do and whether anything changes.
Attached Files
File Type: zip driver.zip (4.7 KB, 99 views)
chaley is offline   Reply With Quote