06-24-2011, 07:53 AM | #31 | |
Groupie
Posts: 181
Karma: 364
Join Date: Oct 2009
Device: DR1000s, Hanlin V5
|
Quote:
I don't think the DR supports ext4 right now, but perhaps this could be added? The SD-card would wear down faster though because of the journaling. |
|
06-24-2011, 08:26 AM | #32 |
Connoisseur
Posts: 71
Karma: 592
Join Date: Aug 2010
Device: irex dr800sg DR1000S
|
I did some analyse for queries:
Actual query is: SELECT filename, directory_path, is_directory, file_type, file_size, file_time_modified, title, author, thumb_data_small FROM file_metadata AS m LEFT JOIN thumbnails AS t ON m.file_id = t.file_id WHERE tag = 'book' ORDER BY sort_priority DESC, (CASE WHEN title IS NOT NULL THEN 0 ELSE 1 END), title COLLATE IREX_CASE_INSENSITIVE ASC, filename COLLATE IREX_CASE_INSENSITIVE ASC, directory_path COLLATE IREX_CASE_INSENSITIVE ASC; result of SQL analise of this query is: SEARCH TABLE file_metadata AS m USING AUTOMATIC COVERING INDEX (tag=?) SEARCH TABLE thumbnails AS t USING INTEGER PRIMARY KEY (rowid=?) (~1 rows) USE TEMP B-TREE FOR ORDER BY What I say? Two search was use not direct indexing and building temporary tree in memory or on disk. Very bad. BTW the same for indexed table . Indexes that I added was wrong !!! |
Advert | |
|
06-24-2011, 08:54 AM | #33 | |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
Quote:
Code:
root@qemuarm:/media/mmcblk0p1# cat /etc/filesystems minix fat vfat ext2 ext3 |
|
06-24-2011, 09:31 AM | #34 |
Groupie
Posts: 181
Karma: 364
Join Date: Oct 2009
Device: DR1000s, Hanlin V5
|
|
06-24-2011, 10:10 AM | #35 |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
aren't DR internal partitions ext2 file systems?
Code:
root@qemuarm:/media/mmcblk0p1# mount rootfs on / type rootfs (rw) /dev/root on / type ext2 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) /dev/root on /dev/.static/dev type ext2 (rw) tmpfs on /dev type tmpfs (rw) devpts on /dev/pts type devpts (rw) tmpfs on /var type tmpfs (rw) tmpfs on /media/ram type tmpfs (rw) Iņigo |
Advert | |
|
06-24-2011, 12:02 PM | #36 |
Groupie
Posts: 181
Karma: 364
Join Date: Oct 2009
Device: DR1000s, Hanlin V5
|
The qemu-image uses ext2, but the DR uses JFFS2 for the internal filesystem.
If you look at the kernel config file, you can also see support for ext2/3/4 is not set. The qemu uses a different kernel than the DR. |
06-24-2011, 12:04 PM | #37 |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
|
06-24-2011, 01:34 PM | #38 |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
It's working
There is a lot of work to be done yet, but it works. I'm including some screenshots and some code (patch against r49 of https://bitbucket.org/inigoserna/dr800, remember to do "hg udpdate -C dr800+ -r49" after cloning the repository). Could anyone check for memory leaks please? Lot of time since I used to code in C... CTB: covers in file system instead of global.db * some comments about the code - the basic idea is to keep global.db free of book covers, they will be in the file system SD_card/System/.icons/medium/XX/asdfgdgdfh.png - the original method store all the pixbufs (images) for current view loaded from the db in the model, here we get from file system on demand - it should be a bit slower than original method in case of few books in the view, but this method use less memory, the difference is huge with lots of books so then it should be much faster too - id is not stored in the model, so we can't use id % 256 to distribute the covers over the covers root directory I'm using the first 2 chars of the md5_hex_digest on the fullpath of the book - erGtkIconView needs to be patched in order to get the images as needed on runtime instead of retrieving from db (look previous screenshots in this thread) - it handles "system" icons perfectly except a few (see below) => screenshots: test10, test11 - IT WORKS!!! => screenshot: test13: image showing the billiard ball is the presumed cover loaded from the file system TODO: * this PoC only works with iconview by now, it needs some code for contentview as well => very easy * "fix" old code which uses model store - remove pixbuf column and references to it - don't query db for thumbnails * remaining special icons not managed by now - settings apps => screenshots: test12 - shorcuts? * we use a cache, a hash table - i think it stores some entries repeated -> glib's g_str_equal bug? - clean contents when changedir, change_view - destroy at end * write a tool (in vala) to move images from db to fs, remove them from db and do a vacuum * update other programs to copy new icons to fs instead of db - mdbindex - cover from uds * test in the real DR with lots of books and compare Kind regard, Iņigo |
06-24-2011, 03:13 PM | #39 |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
Hi Iņigo,
Why didn't you change filemodel.c: load_items_in_model()? The for loop: Code:
for (row=g_item_offset; row < (g_item_offset + items_per_page) && row < g_total_items ; row++) Code:
GdkPixbuf *thumbnail = get_thumbnail(cell); If there is no image in global.db you can check if there is one in the filesystem. This would then work for the settings/global.db also I guess? I haven't looked at this in much detail so I might be missing some details? Do the Delete-mode overlays work? |
06-24-2011, 03:38 PM | #40 |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
The function set_file_metadata_impl() in ermetadb_file.c seems to be a good candidate. If I remember well from some past logging UDS will also use this function to update thumbnails (mdbindex used UDS to update thumbnails). The function could be changed to not execute the sql_t-query, but use the data to write images into the filesystem.
|
06-24-2011, 05:12 PM | #41 | |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
Quote:
I was studying load_items_in_model just now. I thought ctb populated the model with all the results for the view... but not... so no need to get the pixbufs on runtime... so no need to change so much code, even no need to patch erGtkViewIcon. CTB code was almost finished except ovelays and shortcuts that needed some modifications to work with the new code. Over 20 hours of hard work... Ok, I'll create a branch with these code as a monument/example of my silliness. Anyway, needed changes will be much easier. |
|
06-24-2011, 05:45 PM | #42 |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
I will be resetting my brain tomorrow, glad I told you today...
|
06-24-2011, 06:04 PM | #43 |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
If keeping thumbnail in the query is not generating too much extra delay it might be better to keep it in, to handle the global.db from settings. Or maybe it is possible to leave thumbnail from the query in filemodel.c:create_query() in case it is not the SETTINGS_VIEW? Although the delay might be caused more by the JOIN in ermetadb_file.c:global_select_common() or the JOIN is removed if the SQL-query is optimised before executing... my database knowledge is not good enough for that.
|
06-24-2011, 07:23 PM | #44 | |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
Quote:
Patch is quite simple now. See attached file. It works without problems in the emulator. Next steps: 1. write a tool (in vala) to copy images from db to fs, remove them from db and do a vacuum 2. test in the real DR with lots of books and compare 3. update other programs to copy new icons to fs instead of db - mdbindex - cover from uds Btw, have a nice party tomorrow I have a cooking day Last edited by Iņigo; 06-24-2011 at 07:32 PM. |
|
06-25-2011, 02:00 AM | #45 | |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
Quote:
(Also have a lot of fun today.) |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mobiperl Mobiperl - Perl tools for handling MobiPocket files | tompe | Kindle Formats | 890 | 01-17-2021 06:16 PM |
Large number of books on memory card | pwalker8 | Sony Reader | 8 | 03-24-2009 02:20 PM |
huge pdf files on iliad | yolle | iRex | 7 | 08-23-2008 10:59 AM |
Fictionwise Handling Fee Against Credit Card Terms of Service? | Gideon | News | 9 | 08-15-2008 02:13 PM |
Huge RTF files after conversion | TheMadBrewer | Sony Reader | 2 | 01-01-2007 02:55 AM |