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
Kobo: Initial Elipsa 2E support #10719
Conversation
For potential testers, I've just updated the OCP thread with a KFMon build that should handle the basics (but may fail after an USBMS session, more on that later). And since this requires a few built binaries, here's a delta package you can drop over a current nightly that should contain everything in this PR. |
Re: that KFMon issue, I would also very much like to take a look at a KFMon log, to see how the framebuffer evolves during the boot process. So, ideally, install KFMon, try a simple USBMS session in nickel, eject, and send me the log ( Speaking of USBMS, the KOReader USBMS tool should also be working, but obviously I haven't tested that ;). |
Looks like I fumbled the ffi decls, I'll take a look when I get back on Friday, thanks! At least the KFMon stuff went better than I expected ;p. |
i'll be away until 7 August |
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.
Reviewed 1 of 5 files at r1, 4 of 4 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)
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.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)
# Black magic courtesy of wmt_dbg_func_ctrl @ (out of tree) modules/connectivity/wmt_mt66xx/common_main/linux/wmt_dbg.c | ||
# Enable debug commands | ||
echo "0xDB9DB9" >/proc/driver/wmt_dbg | ||
# Disable the LPBK test | ||
echo "7 9 0" >/proc/driver/wmt_dbg | ||
# Nickel appears to sleep for ~1s | ||
sleep 1 | ||
echo "0xDB9DB9" >/proc/driver/wmt_dbg | ||
# Enable the LPBK test (this'll block for ~1.3s) | ||
echo "7 9 1" >/proc/driver/wmt_dbg | ||
# Finally, power on the chip | ||
echo 1 >/dev/wmtWifi |
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.
Heh wtf
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.
Yeah, don't ask me what LPBK stands for ;D.
# Moar sleep! | ||
usleep 250000 | ||
|
||
# Load WiFi modules | ||
# NOTE: Used to be exported in WIFI_MODULE_PATH before FW 4.23 | ||
if ! grep -q "^${WIFI_MODULE}" "/proc/modules"; then | ||
if ! grep -q "^${WIFI_MODULE} " "/proc/modules"; 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.
Was it at risk of actually matching something it shouldn't or just for sanity?
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.
Currently, no, but a common prefix used for a series of interdependent modules is not terribly far fetched (and it was nearly the case here, which prompted that change ^^).
There's no per-update mechanism to trigger it
We already have the framework for something similar because of how we handle it on Kindle, so, let's try this out to offload that to the MDP...
It's too funky for me to try anything blind
It's... beautiful. *sobs*
It's a single device, we know it's always in the wifi subdir
I love NTX kernels. >_<". Does this one behave any better? |
this version works |
Whee \o/ The following should make KOReader behave, then: diff --git a/frontend/device/input.lua b/frontend/device/input.lua
index c316ca1eb..8f3b6a8ae 100644
--- a/frontend/device/input.lua
+++ b/frontend/device/input.lua
@@ -392,6 +392,20 @@ function Input:adjustABS_SwitchAxesAndMirrorX(ev, max_x)
end
end
+function Input:adjustABS_SwitchAxesAndMirrorY(ev, max_y)
+ if ev.code == C.ABS_X then
+ ev.code = C.ABS_Y
+ ev.value = max_y - ev.value
+ elseif ev.code == C.ABS_Y then
+ ev.code = C.ABS_X
+ elseif ev.code == C.ABS_MT_POSITION_X then
+ ev.code = C.ABS_MT_POSITION_Y
+ ev.value = max_y - ev.value
+ elseif ev.code == C.ABS_MT_POSITION_Y then
+ ev.code = C.ABS_MT_POSITION_X
+ end
+end
+
function Input:adjustABS_Translate(ev, by)
if ev.code == C.ABS_X or ev.code == C.ABS_MT_POSITION_X then
ev.value = by.x + ev.value
diff --git a/frontend/device/kobo/device.lua b/frontend/device/kobo/device.lua
index d9d2a0676..8ea2c6e61 100644
--- a/frontend/device/kobo/device.lua
+++ b/frontend/device/kobo/device.lua
@@ -108,6 +108,8 @@ local Kobo = Generic:extend{
touch_switch_xy = true,
-- most Kobos have also mirrored X coordinates
touch_mirrored_x = true,
+ -- but a few mirror on the Y axis instead
+ touch_mirrored_y = false,
-- enforce portrait mode on Kobos
--- @note: In practice, the check that is used for in ffi/framebuffer is no longer relevant,
--- since, in almost every case, we enforce a hardware Portrait rotation via fbdepth on startup by default ;).
@@ -516,6 +518,7 @@ local KoboCondor = Kobo:extend{
display_dpi = 227,
pressure_event = C.ABS_MT_PRESSURE,
touch_mirrored_x = false,
+ touch_mirrored_y = true,
hasNaturalLight = yes,
frontlight_settings = {
frontlight_white = "/sys/class/backlight/mxc_msp430.0/brightness",
@@ -975,7 +978,7 @@ end
function Kobo:initEventAdjustHooks()
-- Build a single composite hook, to avoid duplicated branches...
local koboInputMangling
- -- NOTE: touch_switch_xy is *always* true, but not touch_mirrored_x...
+ -- NOTE: touch_switch_xy is *always* true, but not touch_mirrored_x or touch_mirrored_y...
if self.touch_switch_xy and self.touch_mirrored_x then
local max_x = self.screen:getWidth() - 1
koboInputMangling = function(this, ev)
@@ -985,7 +988,16 @@ function Kobo:initEventAdjustHooks()
gyroTranslation(ev)
end
end
- elseif self.touch_switch_xy and not self.touch_mirrored_x then
+ elseif self.touch_switch_xy and self.touch_mirrored_y then
+ local max_y = self.screen:getHeight() - 1
+ koboInputMangling = function(this, ev)
+ if ev.type == C.EV_ABS then
+ this:adjustABS_SwitchAxesAndMirrorY(ev, max_y)
+ elseif ev.type == C.EV_MSC and ev.code == C.MSC_RAW then
+ gyroTranslation(ev)
+ end
+ end
+ elseif self.touch_switch_xy and not self.touch_mirrored_x and not self.touch_mirrored_y then
koboInputMangling = function(this, ev)
if ev.type == C.EV_ABS then
this:adjustABS_SwitchXY(ev) |
How do I install a nightly version on my device after downloading it from this site? Following the usual installation manual from the Github page doesn't work, tells me that it finds no files... |
@Knut0730 |
@mergen3107: Not possible, the stable doesn't boot on those devices yet ;). @Knut0730: You can't use the OCP scripts, you'll have to install manually. |
Why does it have to be so complicated heh, but it looks to be like most things are working and that a stable release is right around the corner? |
Of course without testing who knows how stable it'll be. ;-P But anyway, you can just use the script to automate the install of 2023.6 and overwrite the files in /mnt/sd/.adds/koreader with those from the downloaded file? |
@Frenzie where do I find these files? I have now installed the 2023.6 version but cannot find the directory you speak of. |
When you plug in the device that probably just means |
Aha! Now I see! So I was supposed to do that BEFORE installing the 2023.6 version, what do I then do if I made the mistake of installing the build completely without replacing the files with the nightly build? Can I simply run the install file once again and it will just overwrite it? I also don't understand how I would go fourth with uninstalling KOReader. |
No, after, otherwise there wouldn't be any files to overwrite and it wouldn't be set up with NickelMenu and all that. ^_^ The difficult part is setting up the device so it can start the program, which is automated by the script. But most of "installing" just means "extract these files to .adds/koreader". |
Okay, now it works! KOReader lauches on my Elipsa 2E! Looks good! Now - anything in particular you need testing @NiLuJe ? |
I found that when turning on Night Mode all ink goes away and it becomes impossible to navigate. Please fix 😅 |
Apparently, that doesn't quite work... Re: koreader#10719
Apparently, that doesn't quite work... Followup to #10719
Was #10841 to fix the Night Mode? After updating to the Aug 26 nightly build my WiFi connection works, but Night Mode still makes the screen blank. |
I can also mention that when connecting a device (my Mac) to my Kobo I get the "Could not start the USBMS session! The device will shut down in 90 sec." message. This should probably also get fixed? |
Try again after a full device restart for good measure. If that doesn't help that would possibly point to wonky eclipse waveform modes, so I'll need a Nickel strace in Dark mode.
That's slightly earlier than I was expecting it to fail, but, ditto, I need syslogs from an USBMS session to deal with that. |
I just did, a reboot did not help.
Anything I can help with? If yes, how?
I cannot help much with getting the USBMS syslogs as I do not know how I get these. But I can attempt it if you give me some sort of instructions. |
You'd need SSH access, pretty much like what was described in the original FR and/or the linked Clara 2E thread. |
That shouldn't be device-specific, so I've moved it to a dedicated issue (#10854). Please attach a file that reproduces the crash and detailed reproduction steps in there. |
A nickel strace was provided via the MR Discord, and AFAICT, this should work (in fact, that revert is irrelevant, the MDP invert works). So new, idea: I'd really like an actual look at how the screen looks like, and I'd also like you to try to do this from inside a book, and, if you toggle NM via the menu, to blindly close the menu, and try to page around the book normally. And the matching verbose debug logs, in case there's something wonky happening and we're not actually uring the right constants for some reason ;o). |
This commit "fixes" reported graphical problems caused by switching to Night Mode on Elipsa 2E. Mentioned here: koreader/koreader#10719 (comment)
Depends on koreader/koreader-base#1642, Fix #10408
This change is