Skip to content
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

Not working on new Kobo Clara B/W #11731

Open
jrjove opened this issue Apr 29, 2024 · 37 comments
Open

Not working on new Kobo Clara B/W #11731

jrjove opened this issue Apr 29, 2024 · 37 comments
Labels
Milestone

Comments

@jrjove
Copy link

jrjove commented Apr 29, 2024

  • KOReader version: last
  • Device: Kobo Clara B/W

Issue : It does not start.

Steps to reproduce

crash.log (if applicable)
                launching...
  _  _____  ____                _
 | |/ / _ \|  _ \ ___  __ _  __| | ___ _ __
 | ' / | | | |_) / _ \/ _` |/ _` |/ _ \ '__|
 | . \ |_| |  _ <  __/ (_| | (_| |  __/ |
 |_|\_\___/|_| \_\___|\__,_|\__,_|\___|_|

 It's a scroll... It's a codex... It's KOReader!

 [*] Current time: 04/29/24-17:32:35
 [*] Version: v2024.03.1

ffi.load: libs/libutf8proc.so.3
ffi.load: blitbuffer
./luajit: frontend/device/kobo/device.lua:1682: unrecognized Kobo model spaBW with device id 391
stack traceback:
	[C]: in function 'error'
	frontend/device/kobo/device.lua:1682: in main chunk
	[C]: in function 'probeDevice'
	frontend/device.lua:61: in main chunk
	[C]: in function 'require'
	./reader.lua:151: in main chunk
	[C]: at 0x000140cd
!!!!
Uh oh, something went awry... (Crash n°1: 04/29/24 @ 17:32:35)
Running FW 4.39.22801 on Linux 4.9.77 (#1 SMP PREEMPT d514d0df4-20240307T151406-B0307151713)
Attempting to restart KOReader . . .
!!!!

@olivierclermont
Copy link

I have the same problem. Also on Kobo Clara

@c0eos
Copy link
Contributor

c0eos commented Apr 30, 2024

I have the same issue with my Kobo Clara Colour, with the difference in the crash.log file being ./luajit: frontend/device/kobo/device.lua:1682: unrecognized Kobo model spaColour with device id 393

I edited the frontend/device/kobo/device.lua file to try to trick KOReader with:

elseif codename == "condor" then
    return KoboCondor
elseif codename == "spaColour" then
    return KoboGoldfinch -- same as Clara 2E
else
    error("unrecognized Kobo model ".. codename .. " with device id " .. product_id)
end

However, this gives a new error:

04/30/24-11:34:31 INFO  Enabling Kobo @ 32bpp BGR tweaks 
Cannot open file `/sys/class/leds/aw99703-bl_FL1/color`:	No such file or directory
./luajit: frontend/device/kobo/device.lua:823: Error opening input device </dev/input/by-path/platform-bd71828-pwrkey-event>: No such file or directory
stack traceback:
	[C]: in function 'open'
	frontend/device/kobo/device.lua:823: in function 'init'
	frontend/device.lua:62: in main chunk
	[C]: in function 'require'
	./reader.lua:151: in main chunk
	[C]: at 0x000140cd
!!!!

I'll try to define a new device and find the right settings.

@meguminnet
Copy link

I don't have the device yet, but I'm assuming the Kobo Libra Colour will also need to be added for it to be supported.

@Diblox
Copy link

Diblox commented Apr 30, 2024

Same issue with Clara Colour

@c0eos
Copy link
Contributor

c0eos commented Apr 30, 2024

OK, some progress.
In frontend/device/kobo/device.lua, I have added:

-- Kobo Clara Colour:
local KoboSpaColour = Kobo:extend{
    model = "Kobo_spa_colour",
    isMk7 = yes,
    hasEclipseWfm = yes,
    canToggleChargingLED = yes,
    led_uses_channel_3 = true,
    hasFrontlight = yes,
    display_dpi = 300,
    hasNaturalLight = yes,
    frontlight_settings = {
        frontlight_white = "/sys/class/backlight/mxc_msp430.0/brightness",
        frontlight_mixer = "/sys/class/backlight/lm3630a_led/color",
        nl_min = 0,
        nl_max = 10,
        nl_inverted = true,
    },
    battery_sysfs = "/sys/class/power_supply/battery",
    power_dev = "/dev/input/by-path/platform-bd71828-pwrkey.6.auto-event",
    -- Board is eerily similar to the Libra 2, so, it inherits the same quirks...
    -- c.f., https://github.com/koreader/koreader/issues/9552#issuecomment-1293000313
    hasReliableMxcWaitFor = no,
    isSMP = yes,
}

It's a copy of the Kobo Clara 2E (goldfinch) definition, where I changed frontlight_mixer, power_dev (from what seemed right in the /sys/ path) and isSMP (because the new device is dual core).

The crash.log is now:

                launching...
  _  _____  ____                _
 | |/ / _ \|  _ \ ___  __ _  __| | ___ _ __
 | ' / | | | |_) / _ \/ _` |/ _` |/ _ \ '__|
 | . \ |_| |  _ <  __/ (_| | (_| |  __/ |
 |_|\_\___/|_| \_\___|\__,_|\__,_|\___|_|

 It's a scroll... It's a codex... It's KOReader!

 [*] Current time: 04/30/24-12:54:39
 [*] Version: v2024.03.1

ffi.load: libs/libutf8proc.so.3
ffi.load: blitbuffer
04/30/24-12:54:39 INFO  Enabling Kobo @ 32bpp BGR tweaks 
[ko-input] Forked off fake event generator (pid: 1308)
04/30/24-12:54:39 INFO  initializing for device Kobo_spa_colour 
04/30/24-12:54:39 INFO  framebuffer resolution: {
  h = 1448,
  w = 1072
} --[[table: 0xb6b5fe80]] 
ffi.load: libs/libmupdf.so
ffi.load: libs/libwrap-mupdf.so
ffi.load: sqlite3
ffi.load: libs/libfreetype.so.6
ffi.load: libs/libharfbuzz.so.0
ffi.load: libs/libzstd.so.1
ffi.load: libs/libcrypto.so.1.1
04/30/24-12:54:39 INFO  Loading plugins from directory: plugins 
dhcpcd[1321]: dhcpcd not running
04/30/24-12:55:07 INFO  Kobo Wi-Fi: disabling Wi-Fi 
dhcpcd[1333]: dhcpcd not running
OK
04/30/24-12:55:07 INFO  WakeupMgr: scheduling wakeup in 259200 -> 1714733707 
04/30/24-12:55:07 INFO  Inhibiting user input 
04/30/24-12:55:08 INFO  Restoring user input handling 
04/30/24-12:55:11 INFO  Powering off the device... 
setWakeupAlarm ioctl RTC_WKALM_SET	-1	Numerical result out of range
toggleAlarmInterrupt open /dev/rtc0	-1	Device or resource busy
04/30/24-12:55:11 INFO  Preparing to quit UIManager with exit code: 88 
04/30/24-12:55:11 INFO  UIManager: No dialogs left to show 
04/30/24-12:55:11 INFO  Tearing down UIManager with exit code: 88 
[ko-input] Closed input device with fd: 8 @ idx: 3
[ko-input] Closed input device with fd: 7 @ idx: 2
[ko-input] Closed input device with fd: 6 @ idx: 1
[ko-input] Closed input device with fd: 5 @ idx: 0
Restoring original fb bitdepth @ 32bpp & rotation @ 3
[FBInk] Unidentified Kobo device code (393)!
[FBInk] Detected a Kobo Unknown! (393 => ?? @ Mark ?)
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 167 dpi
[FBInk] Variable fb info: 1072x1448, 32bpp @ rotation: 3 (Counter Clockwise, 270°)
[FBInk] Fixed fb info: ID is "hwtcon", length of fb mem: 6243328 bytes & line length: 4288 bytes
[FBInk] Canonical rotation: 0 (Upright, 0°)
[FBInk] Fontsize set to 16x16 (IBM (Default) base glyph size: 8x8)
[FBInk] Line length: 67 cols, Page size: 90 rows
[FBInk] Horizontal fit is perfect!
[FBInk] Vertical fit isn't perfect, shifting rows down by 4 pixels
[FBDepth] Screen is 1072x1448 (1072x1456 addressable, fb says 1072x1448)
[FBDepth] Buffer is mapped for 6243328 bytes with a scanline stride of 4288 bytes
[FBDepth] Current bitdepth is already 32bpp, but the grayscale flag is bogus!
[FBDepth] Current rotation is already 3!
[FBDepth] Switching fb to 32bpp @ rotation 3 . . .
Updating bitdepth from 32bpp to 32bpp
Sanitizing grayscale flag for bitdepths > 8bpp
Updating rotation from 3 (Counter Clockwise, 270°) to 3 (Counter Clockwise, 270°)
Bitdepth is now 32bpp (grayscale: 0) @ rotate: 3 (Counter Clockwise, 270°)
[FBDepth] Screen is 1072x1448 (1072x1456 addressable, fb says 1072x1448)
[FBDepth] Buffer is mapped for 6243328 bytes with a scanline stride of 4288 bytes

KOReader seems to have stopped crashing, and I can use the power button, but the screen is unresponsive and simply shows the normal Kobo home screen.

From what I understand, the issue now lies with FBInk, and I really don't know how to handle that.

@meguminnet
Copy link

2024.04 dropped a few hours ago, but the issue will probably be the same.

@Diblox
Copy link

Diblox commented Apr 30, 2024

2024.04 dropped a few hours ago, but the issue will probably be the same.

Yeah, it is

@mergen3107
Copy link
Contributor

These new Kobos probably have new board design and kernels.

Ask @NiLuJe ?

In the meantime, maybe search for when other new Kobos were added? I remember Kobo Lcara 2E, but maybe something else.

I mean, look for things you need to report: logs, file locations, etc.

@Frenzie
Copy link
Member

Frenzie commented Apr 30, 2024

From what I understand, the issue now lies with FBInk, and I really don't know how to handle that.

FBInk is merely the last thing in your log, unless you mean something else. What's missing is likely something like koreader/koreader-base#1642 but I don't think the kernel sources are available yet.

@ptrm
Copy link
Contributor

ptrm commented Apr 30, 2024

FBInk is merely the last thing in your log, unless you mean something else. What's missing is likely something like koreader/koreader-base#1642 but I don't think the kernel sources are available yet.

And here I bought it hoping they just soldered the new Carta 1300 display to an old board :.>

@c0eos
Copy link
Contributor

c0eos commented Apr 30, 2024

I thought that may have been FBInk because of that message:

[FBInk] Unidentified Kobo device code (393)!
[FBInk] Detected a Kobo Unknown! (393 => ?? @ Mark ?)

You are right. cat /proc/cpuinfo gives

processor	: 0
Processor	: ARMv7 Processor rev 4 (v7l)
model name	: ARMv7 Processor rev 4 (v7l)
BogoMIPS	: 15.60
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm aes pmull sha1 sha2 crc32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4

Hardware	: MediaTek MT8110 board
Revision	: 0000
Serial		: 1234567890ABCDEF

After seeing that I added the line isMTK = yes to my new config, and KOReader finally started and showed the file manager! However, while I can suspend or wake the Kobo up, touching the screen does nothing... Well, not exactly nothing, since the crash.log (with debug and debug_verbose as true) shows the input events.

I looked at the commit you referenced, but it gets a bit too complex for me.


EDIT: can't talk about the input events and not share a bit of the log, just in case:

04/30/24-16:07:52 DEBUG key event => code: 325 (BTN_TOOL_FINGER), value: 1, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG key event => code: 330 (BTN_TOUCH), value: 1, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG input event => type: 3 (EV_ABS), code: 57 (ABS_MT_TRACKING_ID), value: 0, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG input event => type: 3 (EV_ABS), code: 59 (ABS_MT_DISTANCE), value: 0, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG input event => type: 3 (EV_ABS), code: 53 (ABS_MT_POSITION_X), value: 73, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG input event => type: 3 (EV_ABS), code: 54 (ABS_MT_POSITION_Y), value: 1001, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG input event => type: 3 (EV_ABS), code: 58 (ABS_MT_PRESSURE), value: 1, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG input event => type: 3 (EV_ABS), code: 0 (ABS_X), value: 73, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG input event => type: 3 (EV_ABS), code: 1 (ABS_Y), value: 1001, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG input event => type: 3 (EV_ABS), code: 24 (ABS_PRESSURE), value: 1024, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG input event => type: 3 (EV_ABS), code: 48 (ABS_MT_TOUCH_MAJOR), value: 0, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG input event => type: 3 (EV_ABS), code: 49 (ABS_MT_TOUCH_MINOR), value: 0, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG input event => type: 3 (EV_ABS), code: 52 (ABS_MT_ORIENTATION), value: 0, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG input event => type: 0 (EV_SYN), code: 2 (SYN_MT_REPORT), value: 0, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG input event => type: 0 (EV_SYN), code: 0 (SYN_REPORT), value: 0, time: 1714486072.834746 
04/30/24-16:07:52 DEBUG slot 0 in hold state... 
04/30/24-16:07:52 DEBUG AutoSuspend: onInputEvent 
04/30/24-16:07:52 DEBUG MovableContainer:onMovableHoldPan {
  direction = "northwest",
  distance = 572.36788868698773,
  ges = "hold_pan",
  pos = "0x0+70+73",
  relative = {
    x = -418,
    y = -391
  } --[[table: 0xb28c0fb8]],
  start_pos = "0x0+488+464",
  time = 1714486072834746
} --[[table: 0xb28c0e70]] 
04/30/24-16:07:52 DEBUG input event => type: 3 (EV_ABS), code: 0 (ABS_X), value: 73, time: 1714486072.887375 
04/30/24-16:07:52 DEBUG input event => type: 3 (EV_ABS), code: 1 (ABS_Y), value: 1001, time: 1714486072.887375 
04/30/24-16:07:52 DEBUG input event => type: 3 (EV_ABS), code: 24 (ABS_PRESSURE), value: 0, time: 1714486072.887375 
04/30/24-16:07:52 DEBUG key event => code: 330 (BTN_TOUCH), value: 0, time: 1714486072.887375 
04/30/24-16:07:52 DEBUG key event => code: 325 (BTN_TOOL_FINGER), value: 0, time: 1714486072.887375 

@ptrm
Copy link
Contributor

ptrm commented Apr 30, 2024

After seeing that I added the line isMTK = yes to my new config, and KOReader finally started and showed the file manager! However, while I can suspend or wake the Kobo up, touching the screen does nothing... Well, not exactly nothing, since the crash.log (with debug and debug_verbose as true) shows the input events.

I looked at the commit you referenced, but it gets a bit too complex for me.

@c0eos That's for Clara Colour, right? They have dual-core cpus, I wonder if for BW they changed as well. Can you point me to an ssh build you use to get shell access on kobo without koreader? Or another method you had at hand ;)

Also, it might be worth to update the issue title to avoid confusion among new Clara versions

@Frenzie
Copy link
Member

Frenzie commented Apr 30, 2024

I looked at the commit you referenced, but it gets a bit too complex for me.

If isMTK does the trick then you can safely ignore all of that. I was giving it a 50/50 of needing isSomethingElseEntirely but I haven't really kept up with any specifics (if they've even been posted anywhere yet, besides here just now).

@Frenzie
Copy link
Member

Frenzie commented Apr 30, 2024

Can you point me to an ssh build you use to get shell access on kobo without koreader? Or another method you had at hand ;)

https://www.mobileread.com/forums/showthread.php?t=254214

@c0eos
Copy link
Contributor

c0eos commented Apr 30, 2024

@ptrm Yep, I have the Clara Colour. The processor isn't the same as the B/W, it's dual core.

I didn't use ssh, but followed this telnet access.

I added a /mnt/onboard/.adds/nm/run file for NickelMenu consisting of:

menu_item : main : run.sh : cmd_spawn : quiet : exec /mnt/onboard/run.sh

and /mnt/onboard/run.sh

mkdir -p /dev/pts
mount -t devpts devpts /dev/pts

/bin/busybox telnetd &

Hacky, but I didn't want to spend the time for anything more complex.


EDIT: don't bother with that, I tried the link that @Frenzie gave, and it works perfectly fine. Now I have ssh.

@ptrm
Copy link
Contributor

ptrm commented Apr 30, 2024

Here's a quick dump of Clara BW. Listed paths mentioned in frontend/device/kobo/device.lua

[root@spaBW root]# cat /proc/cpuinfo
processor	: 0
Processor	: ARMv7 Processor rev 4 (v7l)
model name	: ARMv7 Processor rev 4 (v7l)
BogoMIPS	: 26.00
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm aes pmull sha1 sha2 crc32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4

Hardware	: MediaTek MT8110 board
Revision	: 0000
Serial		: 1234567890ABCDEF
[root@spaBW root]# ls -l /sys/class/backlight/
total 0
lrwxrwxrwx    1 root     root             0 Apr 30 16:42 lm3630a_led -> ../../devices/platform/10019000.i2c/i2c-1/1-0036/backlight/lm3630a_led
lrwxrwxrwx    1 root     root             0 Apr 30 16:42 lm3630a_leda -> ../../devices/platform/10019000.i2c/i2c-1/1-0036/backlight/lm3630a_leda
lrwxrwxrwx    1 root     root             0 Apr 30 16:42 lm3630a_ledb -> ../../devices/platform/10019000.i2c/i2c-1/1-0036/backlight/lm3630a_ledb
lrwxrwxrwx    1 root     root             0 Apr 30 16:42 mxc_msp430.0 -> ../../devices/platform/ntx_bl/backlight/mxc_msp430.0
[root@spaBW koreader]# ls -l /sys/class/leds/
total 0
lrwxrwxrwx    1 root     root             0 Apr 30 16:42 LED -> ../../devices/platform/leds/leds/LED
lrwxrwxrwx    1 root     root             0 Apr 30 16:42 lcd-backlight -> ../../devices/platform/leds-mt65xx/leds/lcd-backlight
[root@spaBW root]# ls -l /sys/class/power_supply/
total 0
lrwxrwxrwx    1 root     root             0 Apr 30 16:42 bd71827_ac -> ../../devices/platform/10019000.i2c/i2c-1/1-004b/bd71827-power.4.auto/power_supply/bd71827_ac
lrwxrwxrwx    1 root     root             0 Apr 30 16:42 bd71827_bat -> ../../devices/platform/10019000.i2c/i2c-1/1-004b/bd71827-power.4.auto/power_supply/bd71827_bat
[root@spaBW root]# ls -l /dev/input/by-path/
total 0
lrwxrwxrwx    1 root     root             9 Apr 30 16:42 platform-2-0024-event -> ../event1
lrwxrwxrwx    1 root     root             9 Apr 30 16:42 platform-bd71828-pwrkey.6.auto-event -> ../event2
lrwxrwxrwx    1 root     root             9 Apr 30 16:42 platform-ntx_event0-event -> ../event0

@ptrm
Copy link
Contributor

ptrm commented Apr 30, 2024

Modified frontend/device/kobo/device.lua as below (copied from Clara 2e, the hasReliableMxcWaitFor = true is a wild guess attempt at fixing input, was false at first runs). Changed device paths and added isMTK = true

-- Kobo Clara BW:                                                                                                                                             
local KoboSpaBW = Kobo:extend{                                                                                                                            
    model = "Kobo_spaBW",                                                                                                                                 
    isMk7 = yes,                                                                                                                                              
    hasEclipseWfm = yes,                                                                                                                                      
    canToggleChargingLED = yes,                                                                                                                               
    led_uses_channel_3 = true,                                                                                                                                
    hasFrontlight = yes,                                                                                                                                      
    display_dpi = 300,                                                                                                                                        
    hasNaturalLight = yes,                                                                                                                                    
    frontlight_settings = {                                                                                                                                   
        frontlight_white = "/sys/class/backlight/mxc_msp430.0/brightness",                                                                                    
        frontlight_mixer = "/sys/class/backlight/lm3630a_led/color",                                                                                            
        nl_min = 0,                                                                                                                                           
        nl_max = 10,                                                                                                                                          
        nl_inverted = true,                                                                                                                                   
    },                                                                                                                                                        
    battery_sysfs = "/sys/class/power_supply/bd71827_bat",                                                                                                        
    power_dev = "/dev/input/by-path/platform-bd71828-pwrkey.6.auto-event",                                                                                           
    -- Board is eerily similar to the Libra 2, so, it inherits the same quirks...                                                                             
    -- c.f., https://github.com/koreader/koreader/issues/9552#issuecomment-1293000313                                                                         
    hasReliableMxcWaitFor = yes,                                                                                                                               
    isMTK = yes,
}
[...]
elseif codename == "spaBW" then
    return KoboSpaBW

KOreader runs and displays UI. On the first run it displayed the manual, and tapping on the text selected it (edit: the selection started in a fixed, seemingly random, position, and extended back/forward as the following taps pointed), as if koreader treated the display as being touched initially. On second runs I got file browser, and managed only to click the home icon before it froze. Log (verbose) and photo below

crash.log

Edit: the log is from when the file manager showed after start. Any suggestions as to what to tweak further welcome :)

@Frenzie
Copy link
Member

Frenzie commented Apr 30, 2024

Some simple things to try would be touch_snow_protocol and touch_phoenix_protocol even if that seems unlikely. There's also touch_mirrored_x and touch_mirrored_y (not relevant to touch being interpreted as hold but relevant to location).

@c0eos
Copy link
Contributor

c0eos commented Apr 30, 2024

@Frenzie I'll be damned, but touch_snow_protocol = true, works!

-- Kobo Clara Colour:
local KoboSpaColour = Kobo:extend{
    model = "Kobo_spa_colour",
    isMk7 = yes,
    hasEclipseWfm = yes,
    canToggleChargingLED = yes,
    led_uses_channel_3 = true,
    hasFrontlight = yes,
    display_dpi = 300,
    hasNaturalLight = yes,
    frontlight_settings = {
        frontlight_white = "/sys/class/backlight/mxc_msp430.0/brightness",
        frontlight_mixer = "/sys/class/backlight/lm3630a_led/color",
        nl_min = 0,
        nl_max = 10,
        nl_inverted = true,
    },
    battery_sysfs = "/sys/class/power_supply/bd71827_bat",
    power_dev = "/dev/input/by-path/platform-bd71828-pwrkey.6.auto-event",
    isSMP = yes,
    hasColorScreen = yes,
    isMTK = yes,
    touch_snow_protocol = true,
}

out


EDIT: almost everything seems fine so far. I can change the fonts, the brightness, the color temperature. I can open books, it's in colour. The cover as screensaver is slightly broken though, the colors are wrong, they are blueish, or maybe inverted?

EDIT2: it's more than just the screensaver. While I'm reading, the colours are rendered correctly, but not in KOReader itself. All the covers in mosaic mode for example are wrong, but I think it's simply a RGB vs BGR order or something somewhere.

@ptrm
Copy link
Contributor

ptrm commented Apr 30, 2024

Confirming touch_snow_protocol = true, working on BW.

Wifi toggle, warmth, night mode, frontlight, sleepcover, power button sleep, simple multiswipes (two finger frontlight) tested so far


EDIT: Updates:

  • starting USBMS mode via popup reboots device

@ptrm
Copy link
Contributor

ptrm commented Apr 30, 2024

Here's the file for Clara BW for anyone interested: device.lua.zip (copy to .adds/koreader/frontend/device/kobo/ on device)

@c0eos
Copy link
Contributor

c0eos commented Apr 30, 2024

Some more progress, the colours are now (temporarily) fixed! The issue was as I thought, with BGR instead of RGB.

I commented out self.hasBGRFrameBuffer = yes in the function Kobo:init() function and it works, but I think it'll be cleaner to add a flag such as isRGB in the local Kobo = Generic:extend function...

        if self.screen.fb_bpp == 32 then
            -- Ensure we decode images properly, as our framebuffer is BGRA...
            logger.info("Enabling Kobo @ 32bpp BGR tweaks")
            -- self.hasBGRFrameBuffer = yes
        end

If anyone with a Libra Colour can fill the device definition, I can then submit a preliminary pull request?

@tymmej
Copy link

tymmej commented Apr 30, 2024

I have two problems:

  1. starting USB Mass Storage reboots device, after it .kobo/Kobo/Kobo eReader.conf is almost empty
  2. connecting to Wifi also reboots device and .kobo/Kobo/Kobo eReader.conf is almost empty

reboots == screen with 3 dots and back to nickel

-- Kobo Libra Colour:
local KoboMonza = Kobo:extend{
    model = "Kobo_monza",
    isMk7 = yes,
    hasEclipseWfm = yes,
    canToggleChargingLED = yes,
    led_uses_channel_3 = true,
    hasFrontlight = yes,
    hasKeys = yes,
    hasGSensor = yes,
    display_dpi = 300,
    hasNaturalLight = yes,
    frontlight_settings = {
        frontlight_white = "/sys/class/backlight/mxc_msp430.0/brightness",
        frontlight_mixer = "/sys/class/backlight/lm3630a_led/color",
        nl_min = 0,
        nl_max = 10,
        nl_inverted = true,
    },
    battery_sysfs = "/sys/class/power_supply/bd71827_bat",
    power_dev = "/dev/input/by-path/platform-bd71828-pwrkey.6.auto-event",
    isSMP = yes,
    hasColorScreen = yes,
    isMTK = yes,
    -- touch_snow_protocol = true, not required
}
[...]

elseif codename == "monza" then
    return KoboMonza

@tymmej
Copy link

tymmej commented Apr 30, 2024

@c0eos fix for RGB also works on Libra Color, but it's necessary to refresh cache about books to fix wrong covers.

touch_snow_protocol = true, seems not requirued - there's warning in crash.log that hardware does not it and I do not see difference without that line.

Edit:
now connecting/disconnecting WiFi works reliable, but starting USBMS reboots device.

Edit 2:
added hasGSensor = yes, - it works, but screen is rotated 180 degree.

Edit 3:

    local MSC_RAW_GSENSOR_PORTRAIT_DOWN   = 0x18
    local MSC_RAW_GSENSOR_PORTRAIT_UP     = 0x17
    local MSC_RAW_GSENSOR_LANDSCAPE_RIGHT = 0x1a
    local MSC_RAW_GSENSOR_LANDSCAPE_LEFT  = 0x19

in gyroTranslation function fixes rotation.

@Frenzie
Copy link
Member

Frenzie commented Apr 30, 2024

@c0eos

I'll be damned, but touch_snow_protocol = true, works!

Very good, then with any luck nothing more needs to be done there. ;-)

@eddyfadeev
Copy link

Keys are working, but reversed. To scroll down you press up, to scroll up you press down

@eddyfadeev
Copy link

Keys are working, but reversed. To scroll down you press up, to scroll up you press down

nvm, all good :)

@NiLuJe
Copy link
Member

NiLuJe commented May 1, 2024

FWIW, for people with shell access, I posted a few more specific requests for logs/tests in #11737 (comment) ;).

@erangaj
Copy link

erangaj commented May 1, 2024

FWIW, for people with shell access, I posted a few more specific requests for logs/tests in #11737 (comment) ;).

I'd love to help, but I cannot build koreader on my pc for some reason. Is there a downloadable koreader kobo package with your fix included, so I can install it and get the logs?

@NiLuJe
Copy link
Member

NiLuJe commented May 1, 2024

You don't need to build anything, run a recent nightly and apply the PR any way you see fit (i.e., apply the GH diff via patch or just replace the affected files with the ones from the PR).

@erangaj
Copy link

erangaj commented May 1, 2024

You don't need to build anything, run a recent nightly and apply the PR any way you see fit (i.e., apply the GH diff via patch or just replace the affected files with the ones from the PR).

Managed to run with the patch. I am having libra color, so didn't collect the log files. (Please let me know if you want logs from another libra color)

The rotation wasn't right, but @tymmej 's fix worked. The physical buttons are still swaped.

@tymmej
Copy link

tymmej commented May 1, 2024

There’s option to swap buttons in GUI so I left it as is.

@kyxap
Copy link

kyxap commented May 11, 2024

hey, is this still does not work? I've tried [koreader-kobo-v2024.04-32-geb6e5e3c2_2024-05-10.zip] and reader does not go into restart after eject and power cable take off.
It just found some unknown authors...

Im just got the reader so I may missing something, what I've done so far:

  • tried with and without this:
[FeatureSettings]
ExcludeSyncFolders=(\\.(?!kobo|adobe).+|([^.][^/]*/)+\\..+)
  • downloaded zip
  • extract to root of the clara bw
  • eject/took cable off

anything else is missing?

ps: I'm not sure how to read logs from the device

UPD: seems like I've missed installation of the nickel menu and kfmon... after that instalation reader still does not go to update state, log:

[START] [2024-05-11 @ 11:05:32] [INFO] [PID: 302] Starting KFMon . . .
[START] [2024-05-11 @ 11:05:32] [INFO] [PID: 302] Launched KFMon! (Initial PID: 312)
[KFMon] [2024-05-11 @ 11:05:32] [INFO] [PID: 319] Initializing KFMon v1.4.6-66-ga63e9af (2024-04-26 21:50:02 +0200) | Using SQLite 3.45.3 (built against 3.45.3) | With FBInk v1.25.0-229-g5fa7b9f
[KFMon] [2024-05-11 @ 11:05:32] [INFO] Trying to load config file '/mnt/onboard/.adds/kfmon/config/kfmon-log.ini' . . .
[KFMon] [2024-05-11 @ 11:05:32] [NOTE] Watch config @ index 0 loaded from 'kfmon-log.ini': filename=/mnt/onboard/kfmon.png, action=/mnt/onboard/.adds/kfmon/bin/kfmon-printlog.sh, label=Show KFMon log, hidden=true, block_spawns=false, do_db_update=false, db_title=KFMon Log, db_author=NiLuJe, db_comment=Print the last few lines of KFMon's log
[KFMon] [2024-05-11 @ 11:05:32] [INFO] Trying to load config file '/mnt/onboard/.adds/kfmon/config/kfmon.ini' . . .
[KFMon] [2024-05-11 @ 11:05:32] [NOTE] Daemon config loaded from 'kfmon.ini': db_timeout=500, use_syslog=false, with_notifications=true
[KFMon] [2024-05-11 @ 11:05:32] [INFO] Trying to load config file '/mnt/onboard/.adds/kfmon/config/koreader.ini' . . .
[KFMon] [2024-05-11 @ 11:05:32] [NOTE] Watch config @ index 1 loaded from 'koreader.ini': filename=/mnt/onboard/koreader.png, action=/mnt/onboard/.adds/koreader/koreader.sh, label=KOReader, hidden=false, block_spawns=true, do_db_update=false, db_title=KOReader, db_author=KOReader Devs, db_comment=An eBook reader application
[KFMon] [2024-05-11 @ 11:05:32] [INFO] Trying to load config file '/mnt/onboard/.adds/kfmon/config/plato.ini' . . .
[KFMon] [2024-05-11 @ 11:05:32] [NOTE] Watch config @ index 2 loaded from 'plato.ini': filename=/mnt/onboard/icons/plato.png, action=/mnt/onboard/.adds/plato/plato.sh, label=Plato, hidden=false, block_spawns=true, do_db_update=false, db_title=Plato, db_author=Baskerville, db_comment=A document reader
[FBInk] Detected a Kobo Clara B&W (391 => Spa BW @ Mark 12)
[FBInk] This device does not support HW inversion
[FBInk] Enabled MediaTek quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 300 dpi
[FBInk] Variable fb info: 1072x1448, 32bpp @ rotation: 1 (Clockwise, 90°)
[FBInk] Fixed fb info: ID is "hwtcon", length of fb mem: 6243328 bytes & line length: 4288 bytes
[FBInk] Canonical rotation: 0 (Upright, 0°)
[FBInk] Fontsize set to 24x24 (IBM base glyph size: 8x8)
[FBInk] Line length: 44 cols, Page size: 60 rows
[FBInk] Vertical fit isn't perfect, shifting rows down by 4 pixels
[FBInk] Pen colors set to #000000 for the foreground and #FFFFFF for the background
[KFMon] [2024-05-11 @ 11:05:32] [INFO] Beginning the main loop.
[KFMon] [2024-05-11 @ 11:05:32] [INFO] Checking watch config file '/mnt/onboard/.adds/kfmon/config/kfmon-log.ini' for changes . . .
[KFMon] [2024-05-11 @ 11:05:32] [INFO] Checking watch config file '/mnt/onboard/.adds/kfmon/config/koreader.ini' for changes . . .
[KFMon] [2024-05-11 @ 11:05:32] [INFO] Checking watch config file '/mnt/onboard/.adds/kfmon/config/plato.ini' for changes . . .
[KFMon] [2024-05-11 @ 11:05:32] [INFO] Initializing inotify.
[KFMon] [2024-05-11 @ 11:05:32] [NOTE] Setup an inotify watch for '/mnt/onboard/kfmon.png' @ index 0.
[KFMon] [2024-05-11 @ 11:05:32] [NOTE] Setup an inotify watch for '/mnt/onboard/koreader.png' @ index 1.
[KFMon] [2024-05-11 @ 11:05:32] [NOTE] Setup an inotify watch for '/mnt/onboard/icons/plato.png' @ index 2.
[KFMon] [2024-05-11 @ 11:05:32] [INFO] Listening for events.
[FBInk] Detected a change in framebuffer rotation (1 -> 3)
[FBInk] Reinitializing...
[FBInk] Variable fb info: 1072x1448, 32bpp @ rotation: 3 (Counter Clockwise, 270°)
[FBInk] Fixed fb info: ID is "hwtcon", length of fb mem: 6243328 bytes & line length: 4288 bytes
[FBInk] Canonical rotation: 2 (Upside Down, 180°)
[FBInk] Fontsize set to 24x24 (IBM base glyph size: 8x8)
[FBInk] Line length: 44 cols, Page size: 60 rows
[FBInk] Vertical fit isn't perfect, shifting rows down by 4 pixels
[FBInk] Pen colors set to #000000 for the foreground and #FFFFFF for the background
[KFMon] [2024-05-11 @ 11:05:41] [NOTE] Tripped IN_OPEN for /mnt/onboard/icons/plato.png
[KFMon] [2024-05-11 @ 11:05:41] [INFO] Full-size screensaver hasn't been parsed yet!
[KFMon] [2024-05-11 @ 11:05:41] [INFO] Homescreen tile hasn't been parsed yet!
[KFMon] [2024-05-11 @ 11:05:41] [INFO] Library thumbnail hasn't been parsed yet!
[KFMon] [2024-05-11 @ 11:05:41] [INFO] Flagged target icon '/mnt/onboard/icons/plato.png' as pending processing ...
[KFMon] [2024-05-11 @ 11:05:41] [NOTE] Tripped IN_CLOSE for /mnt/onboard/icons/plato.png
[KFMon] [2024-05-11 @ 11:05:41] [NOTE] Target icon '/mnt/onboard/icons/plato.png' might not have been fully processed by Nickel yet, don't launch anything.
[KFMon] [2024-05-11 @ 11:05:42] [NOTE] Tripped IN_OPEN for /mnt/onboard/kfmon.png
[KFMon] [2024-05-11 @ 11:05:42] [INFO] Homescreen tile hasn't been parsed yet!
[KFMon] [2024-05-11 @ 11:05:42] [INFO] Library thumbnail hasn't been parsed yet!
[KFMon] [2024-05-11 @ 11:05:42] [INFO] Flagged target icon '/mnt/onboard/kfmon.png' as pending processing ...
[KFMon] [2024-05-11 @ 11:05:42] [NOTE] Tripped IN_CLOSE for /mnt/onboard/kfmon.png
[KFMon] [2024-05-11 @ 11:05:42] [NOTE] Target icon '/mnt/onboard/kfmon.png' might not have been fully processed by Nickel yet, don't launch anything.
[KFMon] [2024-05-11 @ 11:06:06] [NOTE] Tripped IN_OPEN for /mnt/onboard/kfmon.png
[KFMon] [2024-05-11 @ 11:06:06] [NOTE] Tripped IN_CLOSE for /mnt/onboard/kfmon.png
[KFMon] [2024-05-11 @ 11:06:06] [NOTE] Target icon '/mnt/onboard/kfmon.png' should be properly processed by now :)
[KFMon] [2024-05-11 @ 11:06:06] [INFO] Preparing to spawn /mnt/onboard/.adds/kfmon/bin/kfmon-printlog.sh for watch idx 0 . . .
[KFMon] [2024-05-11 @ 11:06:06] [NOTE] Spawned process 1059 (/mnt/onboard/kfmon.png -> /mnt/onboard/.adds/kfmon/bin/kfmon-printlog.sh @ watch idx 0) . . .
[KFMon] [2024-05-11 @ 11:06:06] [INFO] [TID: 1060] Waiting to reap process 1059 (from watch idx 0) . . .
**** Log dumped on 2024-05-11 @ 11:06:08 ****
**** FW 4.39.22861 on Linux 4.9.77 (#1 SMP PREEMPT 69bc51802-20240419T134452-B0419142243) ****
**** PRODUCT 'spaBW' on PLATFORM 'mt8113t-ntx' ****

@meguminnet
Copy link

meguminnet commented May 11, 2024

extract to root of the clara bw

I have koreader into the .adds folder, not the root as per the guide:

https://github.com/koreader/koreader/wiki/Installation-on-Kobo-devices#manual-installation-method-based-on-kfmon

The one that goes on the root is KFmon

@kyxap
Copy link

kyxap commented May 11, 2024

oh yeah.... different manuals say diff folders... after multiple re-installs it start to work! thanks!

@Bapf
Copy link

Bapf commented May 13, 2024

While the fixes from @tymmej are fixing the rotation when triggering it (meaning rotating the device), the default rotation is still 180 degrees of, meaning when I start KOReader or when I exit from a book to the library the view it is upside down and I have to tilt the device to get the correct orientation.
Other than that (and the reboot when exiting) it really works great on the Libra Colour. Good work!

@tymmej
Copy link

tymmej commented May 13, 2024

@Bapf my fixes are no longer needed, it was fixed in fbink.

You can try Keep current rotation across views setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests