Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 09-06-2015, 07:48 PM   #106
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,279
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
Scanline Mode

It was more annoying to implement than anticipated but there you have it. Another mode of operation, another way to detect nickel going to sleep (or powering off), and it supports different sets of images for sleep/poweroff states, too. On the downside it requires manual setup.

What's scanline mode? When Kobo goes to sleep, it executes a command (dd) before doing so and the screensaver hooks into that. Since that command is also executed at other times, screensaver then "scans" a "line" (of pixels) on the screen in order to "read" whether it says "Sleeping" or "Poweroff". And then it displays a sleep or poweroff image.

Click image for larger version

Name:	sleeping.png
Views:	636
Size:	3.4 KB
ID:	141783 Click image for larger version

Name:	poweredoff.png
Views:	625
Size:	3.1 KB
ID:	141784

But unfortunately the Sleep/Poweroff screen looks different on every device and for every language. So you have to teach it how to read correctly.

In order to switch to scanline mode you have to edit the configuration file, .addons/screensaver/screensaver.cfg. Here's what the relevant values look like for me (for Aura H2O, 3.17.3 firmware, English language):

Code:
method=scanline
offset=105
debug=0
standby=1324b028adf403db69004f9c5025c163
poweroff=9d79ef5cdf4d49315e61eaae3e397eac
The method=scanline is what puts the mod into scanline mode. (The default mode is method=logread). You'll have to reboot for the new mode to take over.

The offset=105 is the offset of the scanlines in pixels from the bottom of the screen. That's where the line crosses the Sleep/Poweroff status message displayed by Kobo, on the Aura H2O.

The standby= and poweroff= things are signatures for the scanline when it actually says Sleep or Poweroff and not something else.

You'll have to find your own signatures, and that can be achieved by setting debug=1.

With debug=1 you get two things:

1) The scanline will be visually displayed on the screen. If it does not appear in the correct place, adapt the offset accordingly until it crosses the Power/Sleep message.

2) The detected signature will be stored in a file called scanline.txt. It will also include the date and time the signature was detected, so you can do the following:

So to get your own scanline standby/poweroff signature,
  • Go into settings, set sleep timeout to 5 minutes and power off timeout to 5 minutes.
  • Enable debug,
  • Check the time, for example, tap the screen at 20:30 and then let it idle for ~15 minutes. The device should go to sleep and subsequently power off in that time.
  • Turn it back on and check the scanline.txt. If you went idle at 20:30 then there should be a signature around 20:35 and another around 20:40. If there is more than one signature for each of those time slots, the last one is probably the good one.
  • set standby= and poweroff= to the signatures you discovered, set debug=0, and see if it works.

Sorry it's complicated.

If you try this let me know how it works out for ya. Also share your device / language / signatures that work for you.

PS: I should add that if there is any other mod trying to hook into the dd command, it would probably be a conflict of interests with that mod. Right now I simply assume no one else is crazy enough to do that.
Attached Thumbnails
Click image for larger version

Name:	scanline.jpg
Views:	683
Size:	60.0 KB
ID:	141853  

Last edited by frostschutz; 09-09-2015 at 12:19 PM.
frostschutz is offline   Reply With Quote
Old 09-07-2015, 03:30 PM   #107
boriar
Evangelist
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
boriar's Avatar
 
Posts: 407
Karma: 314204
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
So, do all image used have the word sleeping/power off wrote?
boriar is offline   Reply With Quote
Advert
Old 09-07-2015, 03:39 PM   #108
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,279
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
The image is whatever you use as image. You can use transparency or put your own words in your images if you like.

The poweroff/sleep is displayed by Kobo and then replaced by the mod so if everything works that text will appear only temporarily.

Timing is still an issue, but you can play with the delay setting in the config file for that. With the scanline approach I might be able to make it more aggressive (like test it 60 times per second until it appears) but I'll have to re-write it in C for that, a shell script does not work well for this kind of thing.
frostschutz is offline   Reply With Quote
Old 09-07-2015, 03:49 PM   #109
boriar
Evangelist
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
boriar's Avatar
 
Posts: 407
Karma: 314204
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
Ah, I got it! Really good trick!
boriar is offline   Reply With Quote
Old 09-08-2015, 02:41 PM   #110
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,279
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
Another day, another update, with a few optimizations.

The scanline debug is now more aggressive which should make it more likely to catch the signatures you need to set it up. And it no longer puts duplicate (or repeating) signatures in the file.

Small delay values should now work better than before. You might still have to experiment which values work best for you, but before something like 'delay=0.1 0.1 0.1' didn't work too well (too many pngshow instances fighting each other and in the end none managing to actually display before poweroff).

There just isn't much time between the "Poweroff" message and the device actually powering off. The mod has to display its image in that time, particularly in scanline mode this means using more (and smaller) delays.

It also means that you should not make your PNG images too large as they have to be loaded from storage and displayed as well. So make sure the resolution of the PNG is not higher than your display, and reduce color images to 16 levels of gray as the display can't do color anyway.
frostschutz is offline   Reply With Quote
Advert
Old 09-09-2015, 09:53 AM   #111
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,279
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
Some things to look out for regarding the configuration file:

- In order to prevent overwriting an already existing configuration file, the config file is created only a few seconds after the device reboots (and named screensaver.cfg.$date if there already was a screensaver.cfg). Now, if after installing this mod you connected to PC instantly, it may be that the screensaver.cfg did not have a chance to be created yet. After rebooting the Kobo, give it a few seconds before you connect to PC. (I will try to improve this in a future version).

- If you set uninstall=1 in the configuration file, the mod will be uninstalled on the next reboot. If you then decide to re-install the mod, you should change the config file back to uninstall=0 first. Otherwise you will install the mod, and because the mod does not overwrite the old config file, it will uninstall itself right away again.

- Don't use MS Notepad to edit the configuration file. Use Notepad++ instead. In particular you must use Unix/Linux line endings (\n instead of \r or \r\n)
frostschutz is offline   Reply With Quote
Old 09-09-2015, 01:02 PM   #112
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,279
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
Example for the scanline debug mode on a Kobo Touch - bought it on Ebay, broken substrate, lower third of the display still operational. No idea what language it's set to.

With offset=105 the scanline is a tad too high: Click image for larger version

Name:	scanline_touch_105.jpg
Views:	729
Size:	141.9 KB
ID:	141854
It might work but it's not optimal.

With offset=75 it's too low: Click image for larger version

Name:	scanline_touch_75.jpg
Views:	701
Size:	258.0 KB
ID:	141855

With offset=95 it's okay: Click image for larger version

Name:	scanline_touch_95.jpg
Views:	687
Size:	110.9 KB
ID:	141856

The scanline should cross the letters in as many places as possible.

Note I had to reboot the device between each offset change that should not be necessary, I'm still looking for that bug.

Last edited by frostschutz; 09-09-2015 at 01:57 PM.
frostschutz is offline   Reply With Quote
Old 09-09-2015, 05:07 PM   #113
Deahna
Member
Deahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmos
 
Posts: 15
Karma: 21264
Join Date: Jul 2014
Device: none
Smile

Quote:
Originally Posted by frostschutz View Post
Since I have another report that this doesn't work on a Glo HD...

- any Glo HD users using this screensaver successfully?
My mother expressed a wish for a reader with a touchscreen so she gets my "old" aura and I got myself the Glo HD today.

And yes, I promptly installed the screensaver and it works nicely whether I use the switch or just wait for the timeout to kick in.

I have only one png in each of the folders so far, I use logread and I'm running 3.17.3

Sorry, I don't have telnet so can't post any further details.

Thank you for all your hard work. I used another mod before for the aura and yours seems a lot more reliable.
Deahna is offline   Reply With Quote
Old 09-09-2015, 05:17 PM   #114
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,279
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
Quote:
Originally Posted by Deahna View Post
And yes, I promptly installed the screensaver and it works nicely whether I use the switch or just wait for the timeout to kick in.
Glad it works for you! Thanks for reporting back.

Quote:
Originally Posted by Deahna View Post
I have only one png in each of the folders so far, I use logread and I'm running 3.17.3
logread can't distinguish standby/poweroff, so the image in the off/ folder will simply be ignored while using logread mode.

It's scanline mode that uses different images for standby/poweroff. If you want to use the same images in scanline mode you can just delete all images from the off/ folder.

scanline is more difficult to set up, unfortunately, but it's the more reliable/powerful mode.

Quote:
Originally Posted by Deahna View Post
I used another mod before for the aura and yours seems a lot more reliable.
Are you also using Night Mode or Kobo Start Menu? The other mod (that I'm aware of) is using LD_PRELOAD trick, which should be the moste potente solution, but it might not work with other mods also trying to use LD_PRELOAD or those that introduce other ways of starting nickel.

Last edited by frostschutz; 09-09-2015 at 05:27 PM.
frostschutz is offline   Reply With Quote
Old 09-10-2015, 01:49 PM   #115
Deahna
Member
Deahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmosDeahna has become one with the cosmos
 
Posts: 15
Karma: 21264
Join Date: Jul 2014
Device: none
Quote:
Originally Posted by frostschutz View Post
logread can't distinguish standby/poweroff, so the image in the off/ folder will simply be ignored while using logread mode.
For now I'm happy with having the same imagine in both modes. I rarely use poweroff and then I usually remember it. However, I will have a go at scanline mode at a later date, especially now that I know it can be done

Quote:
Are you also using Night Mode or Kobo Start Menu? The other mod (that I'm aware of) is using LD_PRELOAD trick, which should be the moste potente solution, but it might not work with other mods also trying to use LD_PRELOAD or those that introduce other ways of starting nickel.
No, the only things I installed are a few more fonts and my dictionary collection. I did think about KSM and CoolReader but... I love CoolReader on the Pocketbook TL3 (about the only thing good about it!!) but I'm not sure it works on 3.17.3 and I don't want to downgrade.
Deahna is offline   Reply With Quote
Old 09-23-2015, 09:10 PM   #116
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,279
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
For some reason or other this mod seems to break with every firmware update...

In firmware 3.18.0 the Sleeping/Poweroff message seems to have moved by a few pixels on my H2O (offset ~105 vs ~150 -ish, so the message appears a little higher now). For scanline mode that means having to re-do the setup using debug=1.

New values for Aura H2O running 3.18.0, English language:

Code:
offset=150
standby=220c9ccc1a263b4b871c35d4dc6cbb40
poweroff=d516079aedea23f2dbd7de1712f24129

Last edited by frostschutz; 09-23-2015 at 10:11 PM.
frostschutz is offline   Reply With Quote
Old 09-25-2015, 04:50 AM   #117
MGlitch
Wizard
MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.
 
Posts: 2,845
Karma: 22003124
Join Date: Aug 2014
Device: Kobo Forma, Kobo Sage, Kobo Libra 2
mod isn't working for me in 3.18.0 on an H2O.

I've tried the default- no go
I've switched to scanline using the already set settings since you're using an H2O with English as am I.

May do a factory reset tomorrow and see if that clears things up. 3.18.0 already made me reconvert my ebook collection so I'm not concerned about losing anything with a reset.
MGlitch is offline   Reply With Quote
Old 09-25-2015, 05:58 AM   #118
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,279
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
Did you reboot after changing modes? Unfortunately the mod right now needs more reboots than strictly necessary [when editing the config file], I'm hoping to fix that in a future version of the mod.

Did you disable showing cover etc. in poweroff settings? Those would change how things look like in standby/poweroff...

Did you notice the post above yours - the scanline values changed in 3.18.0. Otherwise you might have to find your own with debug=1. If the scanline debug does not work either (no scanline appears) then it's something weird, like a config file broken with MS notepad/wordpad; file needs unix newlines.

It appears the log messages the mod was using for logread mode no longer exist in 3.18.0 so you're now forced to use scanline mode ...

Last edited by frostschutz; 09-25-2015 at 06:06 AM.
frostschutz is offline   Reply With Quote
Old 09-25-2015, 11:23 AM   #119
MGlitch
Wizard
MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.
 
Posts: 2,845
Karma: 22003124
Join Date: Aug 2014
Device: Kobo Forma, Kobo Sage, Kobo Libra 2
Ah I'd caught the post, but thought you may have updated the patch in the first post. Corrected the values and all is well with scanline. Shame about logread, though I'm glad I wasn't going crazy since that method should have been simple.
MGlitch is offline   Reply With Quote
Old 09-25-2015, 01:51 PM   #120
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,279
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
@MGlitch: glad it works! thanks for your feedback
frostschutz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Boox T68 - Screensaver Image fozzedout Onyx Boox 4 07-27-2020 07:25 PM
(PW) Location of waterstones screensaver image mrspaceman Kindle Developer's Corner 19 05-09-2013 02:07 AM
[PB360] Image Viewer with random? rogue_librarian PocketBook 2 12-12-2010 05:20 AM
K2i original screensaver image Aeroraptor Kindle Developer's Corner 1 12-12-2009 07:40 PM
Hacks Angus Young Screensaver Image Jason Shaffer Amazon Kindle 5 04-08-2009 01:34 PM


All times are GMT -4. The time now is 09:53 AM.


MobileRead.com is a privately owned, operated and funded community.