-
Notifications
You must be signed in to change notification settings - Fork 104
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
add bq/fnac device support #745
Conversation
(next FBInk release probably sometime next week, because I'm expecting doom & misery with the Forma and its magic rotation handling...). |
@pazos On Ubuntu you can just install Docker and for the rest you can find the relevant commands in the Makefiles and scripts. You can probably just copy the Kobo almost wholesale. Uploading it to Docker cloud is a touch trickier in the sense that you need an account, but otherwise also covered by the Makefile. :-) |
What happens, exactly, with FBInk and the stock app? |
input/input-cervantes.h
Outdated
|
||
re = ue_init_listener(&listener); | ||
if (re < 0) { | ||
fprintf(stderr, "[ko-input]: Failed to initilize libue listener, err: %d\n", re); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialize ;)
NOTE: It's not actually your typo, so if you can fix the same one in input-kobo while you're there, that'd be great ;).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean re > 0 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I meant initilize
-> initialize
in the fprintf ;).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, that makes sense 👍
Generally LGTM otherwise, besides the small inherited typo ;). |
Didn't strace it, stock reader is completely broken in developers firmware and sometimes crashes by itself. |
With that version output, you know I'm going to ask if that happens with a proper Cervantes build ;). |
But that sounds like a 0x0 region manages to get sent to the ioctl, which shouldn't happen, especially with clear, which enforces a full-screen region... |
After a quick check, nope, the 0x0 region check looks solid, and Cervantes builds don't appear to bypass it (nothing does, really). The only other thing I can think of is that something doesn't like clear's memset on smem_len, so you can try to replace https://github.com/NiLuJe/FBInk/blob/8d6c857eccf2dec0aa974a8837d355c6e14fa9f5/fbink.c#L458 by We've established that that smem_len is weird on 16bpp Kobos already, but it doesn't appear to cause any problems on my end... |
Did that anyway in NiLuJe/FBInk@0ae5dbc, because it can't hurt ;). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm (besides what's already been pointed out)
47c4299
to
9c723b0
Compare
Will test that later. I debootstrapped a new rootfs just for the fun and have no access to stock reader app now 🙈 |
I merely built and uploaded the Docker image you provided. ;-) I can sh into the Docker image this weekend, but for the moment I'm more suspicious of your Makefile here. |
Not sure if it works but I opened a PR in virdevenv. |
I reverted the mxcfb headers to match the behaviour of stock reader app (which is pretty conservative and does the same for all devices, see:https://github.com/bq/cervantes-qt/blob/eink-imx508/src/plugins/gfxdrivers/einkfb/linux/mxcfb.h) and squashed commits. |
Okay, after taking a look at https://github.com/bq/cervantes-qt/blob/eink-imx508/src/plugins/gfxdrivers/einkfb/einkfb.cpp, I can see how my memset could potentially break Qt's little mind ;). The current approach probably still does, I'll see about that tomorrow... |
The clear screen issue should be taken care of in NiLuJe/FBInk@10beff8 ;). |
@Frenzie: I would like to submit a couple more changes in the waveform_modes table since current behaviour with new devices is far from perfect. Give me a couple of hours/days 😄 |
No problem. This device can also do OTA updates, right? (See koreader/koreader-misc#19) |
pinging @NiLuJe about the REAGL stuff. I tried a bunch of flags based on what we are doing on other devices but the result is not good. Also tried newer mxc_wait_for_update_complete ioctl calls without success (I mean it works but doesn't improve anything, making the UI feels slower). @Frenzie from my end I'm done with this PR, so if you think it is ready to be merged then I will focus on submit a proper frontend stuff. |
Yeah, I doubt you could get anything great with explicit REAGL calls, only the Aura did on Kobo's side, and even then, it was fairly weird. |
Makefile.defs
Outdated
else ifeq ($(TARGET), cervantes) | ||
ARM_ARCH:=$(ARMV7_GENERIC_ARCH) | ||
ARM_ARCH+=-mfloat-abi=softfp | ||
ifeq ($(shell PATH='$(PATH)' $(CC) -dumpmachine 2>/dev/null), arm-linux-gnueabi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inconsistent indentation
You generally shouldn't use spaces in Makefiles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same identation as other devices, like kindlepw2, What I should do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not. The other devices use tab as they should while these here are spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Frenzie Could you please point me to your text editor?. I opened in vim. First two lines are tabs, the ifeq/endif stuff just spaces. The prstux stuff contains spaces too.
Can't fix an error if I can't see it 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The kindle & kindlepw2 indents are actually also wrong, which might be the source of the confusion ;).
Note that the space/tab distinction is actually a bit of a mess in this file in general.
I wholeheartedly agree with @Frenzie, which is why I think the few bits with tabs are mostly mine, and the bits with spaces are whatever was there before ;^p.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the android case for one done right ;).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First two lines are tabs, the ifeq/endif stuff just spaces. The prstux stuff contains spaces too.
So prstux is wrong too. ;-) But please leave fixing the others for a separate PR.
See the android case for one done right ;).
By pure coincidence that's the one I looked at. (It also happens to be the one I'm responsible for.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, scratch that I suppose. I see you already fixed it. It'd be cleaner separately though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, reverted Makefile.defs and squashed again. 👍
thirdparty/glib/CMakeLists.txt
Outdated
@@ -23,7 +23,7 @@ ep_get_binary_dir(BINARY_DIR) | |||
# but fails to actually honor the specified/detected Python version in every cases, | |||
# sometimes just hoping there's a python binary somewhere in $PATH (which, granted, there should be)... | |||
# Enforce that to python3 for containers where that's the only available Python version. | |||
if(($ENV{KINDLE}) OR ($ENV{KOBO}) OR ($ENV{APPIMAGE})) | |||
if(($ENV{KINDLE}) OR ($ENV{KOBO}) OR ($ENV{CERVANTES}) OR ($ENV{APPIMAGE})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I'm too blame for putting AppImage at the end. Could you please fix it?
@@ -31,9 +31,9 @@ set(CFG_OPTS "${CFG_OPTS} -DCMAKE_C_COMPILER='${CMAKE_C_COMPILER}' -DCMAKE_C_COM | |||
set(CFG_OPTS "${CFG_OPTS} -DCMAKE_EXE_LINKER_FLAGS='${LDFLAGS}'") | |||
|
|||
# c.f., http://trac.ak-team.com/trac/browser/niluje/Configs/trunk/Kindle/Misc/CMakeCross.txt | |||
if((DEFINED ENV{KINDLE}) OR (DEFINED ENV{LEGACY}) OR (DEFINED ENV{KOBO}) OR (DEFINED ENV{POCKETBOOK}) OR (DEFINED ENV{UBUNTUTOUCH}) OR (DEFINED ENV{SONY_PRSTUX})) | |||
if((DEFINED ENV{KINDLE}) OR (DEFINED ENV{LEGACY}) OR (DEFINED ENV{KOBO}) OR (DEFINED ENV{POCKETBOOK}) OR (DEFINED ENV{UBUNTUTOUCH}) OR (DEFINED ENV{SONY_PRSTUX}) OR (DEFINED ENV{CERVANTES})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just adding things to the end works up to the point where it becomes illegible. ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switching to two lines then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean alphabetical; my text editor auto-wraps just fine. :-)
set(CFG_OPTS "${CFG_OPTS} -DCMAKE_SYSTEM_NAME='Linux'") | ||
endif((DEFINED ENV{KINDLE}) OR (DEFINED ENV{LEGACY}) OR (DEFINED ENV{KOBO}) OR (DEFINED ENV{POCKETBOOK}) OR (DEFINED ENV{UBUNTUTOUCH}) OR (DEFINED ENV{SONY_PRSTUX})) | ||
endif((DEFINED ENV{KINDLE}) OR (DEFINED ENV{LEGACY}) OR (DEFINED ENV{KOBO}) OR (DEFINED ENV{POCKETBOOK}) OR (DEFINED ENV{UBUNTUTOUCH}) OR (DEFINED ENV{SONY_PRSTUX}) OR (DEFINED ENV{CERVANTES})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too.
Thanks! |
Adds support for devices found in https://blog.bq.com/es/bq-ereaders-developers-program/. Tested on BQ Cervantes 4 (last BQ device from 2017). It adds a new touch input event handler (discussed in #4275) which should work on other single touch devices (ie: Kobo Touch, Mini, Glo, Aura HD) but wasn't tested. Includes base bump with: [feat] Add BQ/Fnac device support (koreader/koreader-base#745)
Since those devices are almost copies of kobos (w/softfloat eabi, without simd) most code is almost there.
I refactored common kobo/bq code to input-ntx.hNah. bq devices don't wake up when power is applied via usb.It builds ok w/ koxtoolchain cervantes target or with a ubuntu/linaro toolchain (given that gcc > 4.8 and glibc <= 2.13)
TODO:
build a Docker image, need help on that.thanks @Frenzie