03-25-2011, 09:16 PM | #1 |
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.
|
Secret at dawn (aka testing strange things)
Ok, as I've promised in another thread, here you have a little present.
Uncompress attached file and copy "Test" directory to your DR "Programs" folder. Then navigate there and tap on the .desktop item. No screenshots now, just check the app and say what you think: - start time - overall run speed - menu integration - feelings It has been harder than what I thought initially but I hope it opens a new way to develop apps for DR devices! Ok, I'm not telling anything more by now, tell me your impressions and in a couple of days I promise I'll explain all of this mistery and show the sources... Iņigo |
03-25-2011, 10:04 PM | #2 |
Addict
Posts: 326
Karma: 6908
Join Date: Sep 2010
Device: DRs, EE, ipad/iphone, Helix
|
I am a little puzzled, it looks like the same (very nice) System Information app that you provided for us some time ago ?
|
03-26-2011, 06:15 AM | #3 |
Addict
Posts: 225
Karma: 72
Join Date: Jan 2010
Device: irex DR-800S, M92S
|
well as you should know very little people try stuff without knowing anything about it..
in any case your enthusiasm should mean that you did something good.. let's hope so.. |
03-26-2011, 07:33 AM | #4 |
Groupie
Posts: 181
Karma: 364
Join Date: Oct 2009
Device: DR1000s, Hanlin V5
|
A great app for getting system information.
It loads and runs fast on my DR1000. Menu integration is nice. Perhaps the chosen refresh-option could be presented in boldscript (so as to know which is the current refresh cycle)? The CPU always shows 100% idle on my device, but perhaps this is as expected? Also, it says "no information available" on the battery status. Overall, very nice app. I also like the option to kill off a process, though I haven't dared to test it yet Edit: Skip the part about the CPU always showing 100% idle, it turns out to be incorrect. Last edited by rvs; 03-26-2011 at 08:02 AM. |
03-26-2011, 10:42 AM | #5 |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
<GUESS MODE>
I think you created a framework that allows to build stand-alone lua applications for the DR? Allowing more people to write applications for the DR. <\GUESS MODE> |
03-26-2011, 01:39 PM | #6 |
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.
|
new version attached, with some improvements:
- battery information (this has been hard, all that dbus stuff) - menu items indicates fullscreen mode and refresh timer in bold (easy) Anyway, I'm not as interested in the application per se as the internal hidden part. But perhaps I'll create a proper package for it anyway. I'll need some time to write the explanations and I'm quite exhausted now. I'll try to post them between this evening and tomorrow. Mackx: I thought you'd say this ;-) In fact I studied a similar approach with luajit (which has a beautiful FFI since a few weeks ago, which would allow to call IREX libs directly without writing bindings) but sadly enough luajit doesn't compile in ARM processors by now, maybe in some months. EDIT: btw, for the ones that checked the lua version, do you feel any speed difference in the start time or with the general use? Iņigo PS: and sorry for this stupid mistery, but I'm liking it Last edited by Iņigo; 03-26-2011 at 01:46 PM. |
03-26-2011, 05:19 PM | #7 |
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.
|
Secret revealed
Executive summary
SysInfo is a proof of concept application written in a language called Vala [1] to test if Vala is a viable development method for iRex DR ereaders. Historical note During some months I've been maturing the idea to extend DR core programs without C, using an easier and faster (to write code in) language. So I started learning and playing with lua, waiting for LuaJIT [2] to be available for ARM processors. This would allow us to use the impressive FFI support in LuaJIT to call DR libraries from lua code without writing bindings. But ARM processors are not supported yet... And I was musing this mood when I unexpectedly read a MobileReader thread I haven't seen before [3]. All credit for exploring this idea is for ross therefore. Vala Vala is a new language created in the GNOME desktop world. People say its syntaxis is similar to C# or Java, but I can't say it myself because I don't know much about both of them. The main feature of Vala is that it compiles from .vala sources to C code, which is then compiled and linked to generate the final machine code. Note the whole compilation from .vala sources to binary program can be performed in just one step too. Though more low level than lua or python, it's easier and faster to code than C, and offers much more faster execution speed than scripting languages (but not as fast as plain C). Vala also comes with lot of "bindings" for many popular libraries. And it's easy to write bindings for "our" DR libraries (take a look at "liberipc.vapi" file). But the main advantage I see for DR development is that we could write modules in Vala easily, and then use these C sources to extend original firmware. Current status of Vala for DR development I've taken what ross provided and updated to support modern versions of Vala. I've also fixed and improved the irex.vala and liberipc.vapi files. More will come as needed. Note that Vala is not perfect, it's quite new and in continue development. I've also found some issues: vala is so new that it sometimes depends on the last versions of glib to do some tasks, and this causes problems with the "old" libraries coming with DRs. F.e, I couldn't find a better way to get current date and time in a custom format that to parse OS "date +fmt". Posix or glib 2.26+ contain functions to do it, but both of them are not available for DR development. Anyway, I've been able to translate and improve a previously lua-written program (SysInfo) into vala without prior knowledgement of Vala or C# in ~10 hours of work. Most of this time was spent reading Vala documentation, fixing the Vala environment (irex.vala, liberipc.vapi) and fighting against some imcompatibilities between vala v0.11.x and DR older libraries. I'm pretty satisfied with the results, this first program looks fast, robust, integrates well with DR and even doesn't depend on external runtime or libraries. But what excited me most is the now opened possibility to write enhancements to core DR programs using a higher level language than C, so we could test new ideas faster and with less effort. Instructions to compile SysInfo.vala Steps: Code:
- You need a running DR development environment - Download, build and install Vala . download v0.11.7 from [1] . patch or change vala-0.11.7/vala/valaflowanalyzer.vala with the supplied file . build and install Vala using devel machine compiler (i.e, gcc, not arm-poky-linux-gnueabi-gcc) - Build SysInfo: . put all the needed files in the same directory: SysInfo.vala, irex.vala, liberipc.vapi . set the cross-compiling environment: $ source /usr/local/poky/eabi-glibc/arm/environment-setup . run "make" or: $ valac --vapidir=. --pkg gtk+-2.0 --pkg=gdk-x11-2.0 --pkg liberipc --pkg posix SysInfo.vala irex.vala -o SysInfo - That's it . there will be many warnings, they don't matter This is a vala testing package not intented for general use. Anyway, you can copy the "bin" folder contents to <SD card>/Programs to get a fully functional program. Eventually I'll split these contents into a SysInfo package for end user consumption and a vala development package. [1] http://live.gnome.org/Vala [2] http://luajit.org/ [3] https://www.mobileread.com/forums/showthread.php?t=39212 Kind regards, Iņigo Serna |
03-27-2011, 10:06 AM | #8 | ||
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
Quote:
Quote:
I will be closely following your progress. |
||
04-02-2011, 06:43 AM | #9 | |
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.
|
Of course, I was clearer than pure water... hehehe
Quote:
I've been travelling this week and had no much time to hack on this, but I'll publish new and improved versions of SysInfo and Icons tools soon. Besides their own merits as useful applications, they also served me to learn vala. All of you can look at the sources, if you are familiar with C, C++, C# or Java you will be able to write vala programs in almost no time. My next plan is to modify popupmenu to add 2 new entries and release a new version of DR800+: - Go to Programs - System Information They are not directly related to this vala work, but I think they are interesting for DR800+ (or perhaps even Mackx's additions). "System Information" will run sysinfo binary as an external program, so "sysinfo" will be copied to /usr/bin when installing DR800+. I also consided the alternative to add the generated .c code to popupmenu and be part of popupmenu core, but I think it's better it remains an external app. Long term idea is to hack on ctb: - nowdays when you enter into "Books" or "Recently Added" virtual folders, all the books are extracted from the DB, so it's very slow if you have lots of books. My idea is to only query for next "page" (SQLite admits LIMIT and OFFSET) - add a "Recently opened" virtual folder to HOME - improve view sorting in Books folder, maybe adding sort modes as icons to the toolbar at the bottom What do you think? Iņigo |
|
04-02-2011, 07:56 AM | #10 | ||||
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
Quote:
Quote:
Quote:
You should be able to merge that from dr1000-hackx. (Although the settings dialog to control the appearance and order of views in Home, needs some extra work to make it more user friendly.) Quote:
Maybe I should post the new version as a pre-release so you can play with it in the emulator? (The new version also allows tagging multiple documents.) Marcel. |
||||
04-02-2011, 10:46 AM | #11 | |||||
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:
After a few days playing with Vala, I think I've lost my initial interest in lua as a development tool for DR. Vala is only a bit harder but it's faster, can be completely integrated with DR and doesn't require external dependencies. Quote:
It's easier to code and requires same work for the user, 2 clicks (menu and menu-link vs. HOME and home-link). Quote:
The only problem I can think of is the Sort by Title / Author that requires all the items to build the ABCDE toolbar at the right. Don't think the other view modes (by size, by file type, by recently opened, by added) require to retrieve all books. Quote:
Quote:
And a fast and improved "Books" opening is as interesting In my case (almost 3000 books) "Books" opening is very slow, so I can't fairly use it. Maybe we could use vala to build the interfaces for tags and metadata (title, author) handling . All in all, what I am only sure about is that I don't know what I want exactly... only random ideas: tags, metadata, fast sort_by_recently_opened and sort_by_recently_added... I have to rest these ideas. Btw, as you'll have already noticed, I've published the vala package and new examples. Take a look at them and discover the beauty of vala Iņigo |
|||||
04-03-2011, 04:33 AM | #12 | |||
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
Quote:
Quote:
Quote:
I already took a quick look, it indeed seems easier to program in vala then plain C. |
|||
04-03-2011, 09:13 AM | #13 | ||
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:
SELECT xxx FROM yyy WHERE zzz SORTBY sort OFFSET ooo LIMIT lll;? I took a look at that code some time ago and maybe I can't remember properly... Quote:
Iņigo |
||
04-03-2011, 11:55 AM | #14 | |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
Quote:
1) Selecting/sorting all data from global.db? 2) Or is it caused by the information of these 3000 books that is kept into memory after the query (including thumbnail info)? After measuring what is causing the biggest delay in the current code, changes can be made to measure the effect. (I.e. using OFFSET/LIMIT or maybe delayed loading of thumbnails.) |
|
04-03-2011, 12:45 PM | #15 |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
There is already measurement code available, see ctb:filemodel.c search for TIMER_ON.
|
Tags |
secret, suprise, testing |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Strange things happening w/PDF ebook | Writernan | Astak EZReader | 5 | 04-05-2010 06:36 PM |
Best firmware for Hanlin V5 aka Bebook Mini aka Papyre 5.1? | javimm | HanLin eBook | 1 | 01-11-2010 05:37 PM |
Strange things happening at Fictionwise... | captaingeorges | Bookeen | 5 | 03-08-2009 05:20 AM |
The Secret of Lost Things | Taylor514ce | Reading Recommendations | 7 | 05-15-2008 09:06 AM |
Strange things happening after Kindle update | tsgreer | Amazon Kindle | 15 | 02-22-2008 05:34 PM |