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 05-25-2019, 02:26 PM   #106
BloodRagg
Zealot
BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.
 
BloodRagg's Avatar
 
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
Damn, that's nice mate . I'm gonna do some testing, see how things work out on my end

EDIT: Not allowed to give any karma, must spread Reputation or some shit

Last edited by BloodRagg; 05-25-2019 at 02:28 PM.
BloodRagg is offline   Reply With Quote
Old 05-25-2019, 06:13 PM   #107
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 856
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
I was looking at tslib the other day, wondering how useful it would be. My concerns were mainly regarding calibration, how to do it on eink, and whether the calibration results could be shared on all devices of the same model.
sherman is offline   Reply With Quote
Advert
Old 05-25-2019, 06:23 PM   #108
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Well, it certainly works once you add the requisite eInk refreshes, but I didn't look into the calibration format in detail, although it *should* be re-usable across like-minded devices ;p.

There may be some rotation shenanigans to handle to make the automagic rotation correction behave properly (for instance, I had to run the calibration tool without setting the rotation, because of the H2O inverted rotation quirk, otherwise the calibration tool tried to set the current rotation, which ends up throwing us in the inverted one, which means the base rotation stored in the calibration file is wrong, if that matters, which I imagine it might ;p).

Again, that was from a *very* quick test, because I only had a passing interest in seeing how viable that could be. It probably is, just needs a bit more work (and/or check how it deals with gesture detection and the more esoteric variants of the touch protocol).

The calibration tool itself is dead simple: one by one, it shows a cross near the four corners (TL -> TR -> BR -> BL), and then at the center of the screen, and waits for you to tap (ideally, on the cross ;p).

Last edited by NiLuJe; 05-25-2019 at 06:27 PM.
NiLuJe is offline   Reply With Quote
Old 05-26-2019, 03:50 AM   #109
BloodRagg
Zealot
BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.
 
BloodRagg's Avatar
 
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
Somehow I cant get it compiled , using the kobo/linaro 4.9.4

Code:
git clone https://github.com/NiLuJe/FBInk
cd FBInk; rmdir libunibreak font8x8 stb
git clone https://github.com/adah1972/libunibreak
git clone https://github.com/NiLuJe/font8x8
git clone https://github.com/NiLuJe/stb
make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm
Attached Files
File Type: gz logs.tar.gz (4.6 KB, 169 views)
BloodRagg is offline   Reply With Quote
Old 05-26-2019, 06:20 AM   #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
to clone the repository you only need the first command, if you add --recurse option (or was it --recursive)

it compiles for me, but I compile it directly on the Kobo (Debian Jessie chroot, gcc 4.9.2) so it may be different to using a cross-compiler.

actually I do have to add a cflag (-std=c11) to make it work at all and then it warns about unknown pragma.

Code:
fbink.c:65:10: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
 # pragma GCC diagnostic ignored "-Wduplicated-branches"
          ^
but the result seems to work fine then
frostschutz is offline   Reply With Quote
Advert
Old 05-26-2019, 07:17 AM   #111
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
What @frostschutz said, plus the triplet variable should be called CROSS_TC, not CROSS_COMPILE, and should *not* contain the trailing dash (because this is tailored for my own TCs).

You'll probably indeed need to enforce -std=gnu11 with GCC 4.9, as that's the minimum requirement .

I'll try to silence those pragma warnings, since disabling an option that doesn't exist yet is pretty harmless .

I do have a 4.9 TC laying around, I'll take a look later tonight.

Last edited by NiLuJe; 05-26-2019 at 07:22 AM.
NiLuJe is offline   Reply With Quote
Old 05-26-2019, 08:14 AM   #112
BloodRagg
Zealot
BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.
 
BloodRagg's Avatar
 
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
Quote:
Originally Posted by frostschutz View Post
to clone the repository you only need the first command, if you add --recurse option (or was it --recursive)

it compiles for me, but I compile it directly on the Kobo (Debian Jessie chroot, gcc 4.9.2) so it may be different to using a cross-compiler.

actually I do have to add a cflag (-std=c11) to make it work at all and then it warns about unknown pragma.

Code:
fbink.c:65:10: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
 # pragma GCC diagnostic ignored "-Wduplicated-branches"
          ^
but the result seems to work fine then
Hey man, thanks that did the trick.

Quote:
Originally Posted by NiLuJe View Post
What @frostschutz said, plus the triplet variable should be called CROSS_TC, not CROSS_COMPILE, and should *not* contain the trailing dash (because this is tailored for my own TCs).

You'll probably indeed need to enforce -std=gnu11 with GCC 4.9, as that's the minimum requirement .

I'll try to silence those pragma warnings, since disabling an option that doesn't exist yet is pretty harmless .

I do have a 4.9 TC laying around, I'll take a look later tonight.
I set the flag and the TC option, now everything compiles just dandy

Code:
git clone --recurse-submodules https://github.com/NiLuJe/FBInk
export CFLAGS="$CFLAGS -std=gnu11"
make CROSS_TC=arm-linux-gnueabihf ARCH=arm
And poof, a working binary
BloodRagg is offline   Reply With Quote
Old 05-26-2019, 02:29 PM   #113
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Ooh, those were some highly cryptic and verbose warnings indeed ;p.

Fixed it so the std flag gets automagically enforced where it's needed (GCC < 5.1), and silenced that pragma warning .

Also added a bit of hand-holding for really old kernel headers, even if that wasn't an issue in practice, because that was for button_scan, which is Kobo specific, and my crappy old kernel headers were from Kindle kernels .

Last edited by NiLuJe; 05-26-2019 at 02:41 PM.
NiLuJe is offline   Reply With Quote
Old 05-27-2019, 05:51 AM   #114
BloodRagg
Zealot
BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.
 
BloodRagg's Avatar
 
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
I feel like a moron asking this, but I'm doing it anyway:

@frostschutz: How did you know to use this flag ?

@NiLuJe: Why is it gnu11 and not c11 ?

EDIT: Test script is almost done, it seems to be working properly

Last edited by BloodRagg; 05-27-2019 at 11:31 AM.
BloodRagg is offline   Reply With Quote
Old 05-27-2019, 12:37 PM   #115
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Mostly because as this is Linux-only, I'm likely to be using/expecting GNU extensions somewhere, and that's what GCC's default std values always use anyway: the GNU variant .
NiLuJe is offline   Reply With Quote
Old 05-28-2019, 03:46 AM   #116
BloodRagg
Zealot
BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.
 
BloodRagg's Avatar
 
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
Quote:
Originally Posted by NiLuJe View Post
Mostly because as this is Linux-only, I'm likely to be using/expecting GNU extensions somewhere, and that's what GCC's default std values always use anyway: the GNU variant .
Ahh

Something else, when i run: "fbink -c -qe" it does not clear the screen
I use the output from fbink and have to run it again to also perform a clearscreen.
BloodRagg is offline   Reply With Quote
Old 05-28-2019, 08:45 AM   #117
BloodRagg
Zealot
BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.
 
BloodRagg's Avatar
 
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
Proof of concept script

That was a nice little challenge but it works like a charm

Here is a proof of concept: (see attachment below)
Code:
#!/bin/sh
trap './fbink -cq' 0 1

IFS=$'\n;';export $(./fbink -c -qe);IFS=
./fbink -cqm -y1 "Testing '-E' flag by BloodRagg"

touched(){
  IFS=$'\n;';local $1;IFS=
  [ $ntxRotaQuirk -eq 1 ] && { x=$((screenHeight-x)) ; y=$((screenWidth-y));}
  [ $x -ge $lastRect_Left -a $x -le $(( lastRect_Left + lastRect_Width )) ] || return 1
  [ $y -ge $lastRect_Height -a $y -le $(( lastRect_Top  + lastRect_Height )) ] || return 1
  echo true;return 0
}

get_touch_event(){
  dd if=/dev/input/event1 count=2 2>/dev/null|\
   hexdump -ve '8/2 "%d " "\n"'|\
   awk '{if ($6==0 && $7!=0) {print "x="$7}};{if ($6==1) {print "y="$7}}'
}

ON=$(./fbink -E -x1 -M -S6 "ON")
OFF=$(./fbink -E -x-4 -M -S6 "OFF")
EXIT=$(./fbink -E -x-5 -y-2 -S6 "EXIT")

while true ;do
  eval $(get_touch_event)
  case true in
    $(touched $ON)) ./fbink -qg file=lamp_on.jpeg,halign=CENTER,valign=CENTER;;
    $(touched $OFF)) ./fbink -qg file=lamp_off.jpeg,halign=CENTER,valign=CENTER;;
    $(touched $EXIT)) exit;;
  esac
done
Attached Files
File Type: zip fbink_E-flag_script.zip (306.6 KB, 221 views)
BloodRagg is offline   Reply With Quote
Old 05-28-2019, 12:24 PM   #118
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@BloodRagg: Yeah, never thought that would ever be used like that . Fixed it .
NiLuJe is offline   Reply With Quote
Old 05-29-2019, 03:48 AM   #119
BloodRagg
Zealot
BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.
 
BloodRagg's Avatar
 
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
Working like a charm
BloodRagg is offline   Reply With Quote
Old 06-02-2019, 01:55 PM   #120
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Released v1.16.0!

Mostly minor tweaks here and there, and a few new features as discussed earlier .
NiLuJe is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aura HD Small tool for filling book library in Kobo Aura Paxerus Kobo Developer's Corner 2 12-31-2013 07:05 PM
Small print Broadback Conversion 12 12-12-2011 02:31 PM
Small Tool to change book order (PRS-x50) goaspy Sony Reader 113 10-14-2011 03:28 PM
small print breezeman Introduce Yourself 13 07-03-2011 09:02 AM


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


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