New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bookeen Saga ereader. Not sure where to start. #6043
Comments
Just a bit of a quick linkdump. The ioctls are basically already implemented by KOReader unless they're doing something way out there. See koreader/koreader-base#1023 and #5828 for the most recent example of a port. (Also keep in mind that just to get things proof of concept working you don't need all the intricacies.) Pinging @NiLuJe https://github.com/koreader/koreader-base/blob/fd8e6cfadea27f14188e5f12f2c342a828b0a9c2/ffi/framebuffer_mxcfb.lua |
Thanks! I have seen the wiki page on porting koreader: http://koreader.rocks/doc/topics/Porting.md.html. It seems like the touchscreen and buttons should be handled though the /dev/cyio device, however that seems straight forward. The e-ink stuff, not so much :) |
Unfortunately, AFAIK, the Allwiner SoCs use a completely different driver, so, no, the ioctl stuff is definitely not taken care of ;). |
Huh, weird, just sounds like more effort for everyone. Or is that in some strange way the point? |
Take a look at the repo i linked. It doesn't seem that different. The ioctl calls to /dev/disp handle screen updates and the actual drawing done to the framebuffer. |
Hey! I found the header with all of the ioctl codes! https://github.com/BOOKEEN/kernel-linux-3.0/blob/0aeda9a8538f2e2dcdfee92b5740a6bcc33c3662/include/linux/drv_display_sun4i.h |
@Frenzie: Not the same video/image block (i.e., what passes as a "graphics card" in these things). AW's "display engine" (or whatever it's actually called) here, instead of my good friend the PxP on Freescale HW ;). @rstar000: That's a good start. That's a few less magic numbers in the way, which is good. The layout of the structure's reference to pass to that is still confusing, but at least your first example seems to know what to do with most of it. My usual approach is to patch strace to decode those ioctls and see what happens in the stock software (c.f., the strace section in my build script and the matching Kobo mxcfb patch (which is possibly slightly less convoluted to grok that the Kindle ones)). The other approach is an interposer via an LD_PRELOAD hack (c.f., Kobo's really old one, and libremarkable's for current i.MX6-ish boards). (The strace approach is slightly more work upfront, but much less unwiedly in practice once you're done). |
Okay, struct layout tracks:
mode is actually a bitmask [think mxcfb's update, mode & flags all mixed together] (c.f., Disp_eink_update), I suspect the "LOCAL" (EDIT: and/or "RECTANGLE") stuff more or less matches freescale's PARTIAL stuff (i.e., regional, non-flashing updates). No idea what sel & fb_id are supposed to be used for (well, fb_id more or less speaks for itself ;D), leaving 'em both at 0 seems cool (in fact, quite a few Disp_eink functions seem to take a sel argument and then never do anything with it, so, eh.). Not quite sure what's up with the split A2 (IN/OUT), I suspect they're used for some sort of automagic A2->!A2 chaining, which we probably don't care about. The GET_UPDATE_STATUS ioctl is NOT a 1:1 match for the mxcfb wait_for_completion stuff: while the mxcfb EPDC will block for you, in-kernel, this just returns 1 if there's currently an update being processed, and 0 otherwise (it's basically a getter for an internal global flag in the driver). |
Another, more generic, useful thing to know would be the glibc version being used, and whether it's hardfloat or not. As well as the output of /proc/cpuinfo (because cortex A8 or A9 cores can ship in many weird configurations, and I'm only familiar with the Freescale (now NXP) ones) ;). |
I'll try to find these things out.
|
I still haven't set up a proper cross-compile environment. Is there a docker image for this? |
That was the idea behind my latest questions ;p.
(You can just run the libc library to find out the version, it's
executable).
It's likely going to be fairly close to the Kobo TC in practice...
…On Mon, Apr 13, 2020, 07:09 rstar000 ***@***.***> wrote:
I still haven't set up a proper cross-compile environment. Is there a
docker image for this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6043 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA3KZQMJKLZC24DAPSTUFDRMKM6XANCNFSM4MGM3FBA>
.
|
And the filename of the dynamic loader will tell you if it's soft or hard
float. (as would poking at any stock binary with readelf).
…On Mon, Apr 13, 2020, 07:39 NiLuJe ***@***.***> wrote:
That was the idea behind my latest questions ;p.
(You can just run the libc library to find out the version, it's
executable).
It's likely going to be fairly close to the Kobo TC in practice...
On Mon, Apr 13, 2020, 07:09 rstar000 ***@***.***> wrote:
> I still haven't set up a proper cross-compile environment. Is there a
> docker image for this?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#6043 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAA3KZQMJKLZC24DAPSTUFDRMKM6XANCNFSM4MGM3FBA>
> .
>
|
Here it is! Looks super old...
|
On mobile right now, but I *think* I went over most of this in more details
in the reMarkable PR mentioned above (and/or the matching PR in FBInk) ;).
…On Mon, Apr 13, 2020, 07:42 NiLuJe ***@***.***> wrote:
And the filename of the dynamic loader will tell you if it's soft or hard
float. (as would poking at any stock binary with readelf).
On Mon, Apr 13, 2020, 07:39 NiLuJe ***@***.***> wrote:
> That was the idea behind my latest questions ;p.
>
> (You can just run the libc library to find out the version, it's
> executable).
>
> It's likely going to be fairly close to the Kobo TC in practice...
>
> On Mon, Apr 13, 2020, 07:09 rstar000 ***@***.***> wrote:
>
>> I still haven't set up a proper cross-compile environment. Is there a
>> docker image for this?
>>
>> —
>> You are receiving this because you were mentioned.
>> Reply to this email directly, view it on GitHub
>> <#6043 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AAA3KZQMJKLZC24DAPSTUFDRMKM6XANCNFSM4MGM3FBA>
>> .
>>
>
|
Ah, yeah, that might be mildly unfun to deal with... The Kindle (legacy) TC will generate stuff that will probably work, but you'll ultimately want a real matching ct-ng config... EDIT: Actually, not used to it yet, but the pocketbook config will also work (bonus points: it's armv7 unlike the legacy Kindle one). |
By the way, what's the best way to implement input? AFAIK, everything (touch, buttons, magnetic lid, accelerometer) is handled through /dev/cyio. |
You might want to take inspiration from PB, which is also doing something non-standard, IIRC ;). |
OutputSo Input
|
@pazos: The framebuffer is still where we blit, we just need to send the eInk refresh ioctls to disp instead of fb0 like on Freescale ;). |
@pazos Yes, /dev/input/event exists and there are actually separate event devices for touchscreen, buttons and accelerometer. I also tried an experiment with writing data directly into /dev/fb0 and then updating the screen with /dev/disp and it all works. I've made an initial version of the output module and now trying to build it (trying with pocketbook toolchain). It turned out quite different from the rest and currently i haven't found any way to properly wait for screen to update. |
I'm having a bit of trouble: how do i make sure SDL libs are built? Koreader starts up, but crashes immediately because it can't find SDL. I used the pocketbook toolchain, btw. |
@rstar000 SDL shouldn't be used on a platform where you're dealing with the framebuffer and input directly. SDL works as an ersatz framebuffer on desktop platforms and technically similar ones like Ubuntu Phone and Sailfish. (It could fulfill the same job on Android but there we deal more directly with an Android surface.) But shouldn't you be seeing a "could not find hardware abstraction" error instead, until you adjust this function? Lines 4 to 51 in 67627ce
|
Hmm, I'm seeing this:
|
Right, so the error I mentioned. The SDL thing is meaningless in your case. ;-) |
Am I launching it wrong? Or is there something wrong with the build? |
Ohhh, i see. I haven't actually added my stuff to device.lua. Just a sec... |
Ok that's it for today. I got it to not crash at any input/output related things. Now it just crashes in some lua code :D
|
So, it's almost all working. The buttons work. The touchscreen somewhat works, however it always registers a "pan-hold" gesture. Not sure how to fix it, probably an event hook is needed. Any ideas? |
I tried editing |
Is |
Yes, for me it is.
|
You probably don't want to run ebrmain at all? (warning: here be dragons, don't try this without a way to interrupt/recover the boot process). |
I don't know what is in your I added this file and it "works for me" :) : #!/bin/sh
sleep 10
cd /mnt/fat/koreader/
export LANG=en
./luajit reader.lua &
exit 0 Obviously I double checked to be sure to have a "working" touchscreen beforehand, because otherwise I can't exit koreader and get back to boordr :) Edit: |
@lenaing How would one go about reading one of the files? I'm curious what If this script works, I'd be up for testing it, should there be an updated file available like last time. If anything else needs to be run for more info on my device, feel free to ping me. |
@roshavagarga , You can view content of files with the cat or the less command passing their name as argument. (ie: You may want to attach the result as a file to one of your comment. |
Contents seem short enough to share as pure code @lenaing
I checked my ebrmain file and it has this code at the end, which is missing from rstar000's modified ebrmain. Not sure if that's important or not, might be specific to my device.
|
I managed to get a zip from Bookeen's support with the source code, which is under 300 megabytes zipped and 1.2 gigabytes when unzipped. I have no idea how useful this would be, but it seems to actually hold build instructions and firmware, drivers, etc for a ton of parts that aren't used in my device. I can upload it somewhere or give a link. I've attached a directory tree. Edit: These sunxi open source boot scripts might be useful? |
That's a Linux source tree (so, just the kernel). I don't recall if we actually had it before, so, yeah, I'll take it ;). |
@rstar000 @lenaing Managed to get a tiny bit newer u-boot, a newer firmware bin and recovery firmware. All can be sent to anyone interested, just ping me. Bookeen support said the only way to execute native code was the adb_debug file method we used so far. Instructions on reflashing device with recovery img file:
Edit: Effectively, this means that as long as both of you contact their support through https://service.bookeen.com/, you can also get your devices' files. |
Leaving this Google Drive link here for those that want access to the files. All of these are meant for a Bookeen Cybook Muse Frontlight 2. Feel free to alternatively upload these to a new repository and post that here.
|
Is the procedure for the same recovery img you've provided? I do not have my vcom ia it posible to recover the info? |
@MartinAngelov received an answer via email. |
Hi, |
I'm really sorry for cyio. That thing was NEVER meant to stay, it was a quick and dirty jobs for transition (because some people could not figure how to move from the old hacked kernel module they made used in prior devices to normal input event. This was really never meant to stay, and should have been used only during dev on a s3c2416 product that was released but... didn't went well. So I'm terribly sorry for that thing, I tried to make it as good as possible, as bug free as possible, but they asked so many changes and it went into so many things that is was a nightmare to maintain. I think they are still using the same unchanged version from what I've done years ago. |
@Godzil I take it you're one of the devs that worked on the original firmware? Any insight you might have into the original firmware and how things can be accessed would be greatly appreciated - currently not a lot of devs have the devices or the time to continue the porting work, but I'm sure that anything you can add on top of everything that's been said in this thread will be useful once someone has the time and/or device to continue work on this :) Edit: There are links to firmwares and recovery packages + kernel code in the posts above, should you be interested in checking out things. If there are any personal projects you have or useful code that you want to submit - please, feel free to do so. |
I've worked on the firmware (not the main app, just from bootloader to the linux filesystem and some of the tools used on these machines, some invisible for the main user) from most of the S3C2440 devices to the last 6" OMAP based device. I never worked on any AllWinner based device or the latest using a Freescale/NXP chip if I'm correct. (yeah I worked there for a while, but it seems the people who replaced me never stayed long.) Thanks for sharing these files, but I'm not sure I could be of a lot of help on these platforms. I can provide some help on the system I worked with though if needed. |
It seems he's too busy. If you have the time, could you create the PR with your work and his? |
Hi everyone! Sorry for the late response. I've had some crunches at work for the last few months, so couldn't really make an update or merge these branches. I'll try to find some time hopefully this week. |
@rstar000 No worries, whenever you have the time. I'll note I've left a link to my Google drive with newer sources from my device, as obtained from Bookeen itself - check my post from the 2nd of September, you can ask for the same from their support for your specific device too :) |
@rstar000 If you can find some time to at least merge the branches, I'd be personally thankful, as it's obvious you're busy with IRL things :) |
Last call, since we're nearing the 2-year mark since this was originally posted. @rstar000 and @lenaing - if you can get this merged even in its current state I'd be thankful, otherwise I think this should be closed as it's dead in the water and nobody else has a device to actually try and fully implement Koreader on bookeen readers. |
Sorry, almost lost track of where I was on this work. I can't make sure when i'll get time to work on this again. Feel free to close the PR. I'll comment on this if I find time again. |
Unfortunately, I don't have the time to continue working on this. In the end, I decided to buy a tablet to read papers, as it handles PDFs much better. Sorry :( |
Issue
I wish to port KOreader to this ereader. The built-in PDF viewer is quite horrible, so I want to change that. The reader runs Linux 3.0.8 and has an Allwinner A13 cpu (armv7-a). It is quite easy to get root access via built-in ADB.
I have found an old repo with a simple example that redraws the screen using DirectFB and an ioctl call, but I am quite lost now. I don't know yet where to get the rest of ioctl request codes and e-ink waveform stuff. Here is a link to the repo, but it's not much: https://bitbucket.org/alexantunez/nolim-ebook-sdk/src/master/
Anyway, i would really appreciate any help.
Progress:
EDIT: Some useful stuff.
The text was updated successfully, but these errors were encountered: