Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 09-23-2020, 12:53 PM   #1
Norbi24
Connoisseur
Norbi24 doesn't litterNorbi24 doesn't litter
 
Posts: 64
Karma: 144
Join Date: Aug 2019
Device: Tolino Vision HD4, BOOX Poke2
Starting KOReader from CC works only if KOReader was not running before

I have Calibre Companion 5.4.4.19 on Onyx BOOX Poke 2 (Android 9)
and I use to open books directly from CC by clicking the Read button there to open Koreader (2020.08.01) with that book.

But this works only if Koreader was not running before, if KOReader was already open with another book before, it remains hanging.

I've collected logcat logs to see what is going on and see that CC starts Koreader apparently with this:
I ActivityManager: START u0 {act=android.intent.action.VIEW dat=content://com.multipie.calibreandroid.provider/external/Calibre_Companion/Después del amor - Sonsoles Ónega.epub typ=application/epub+zip flg=0x10008001 cmp=org.koreader.launcher/.MainActivity} from uid 10083

and then, if KOreader was not running before I see later that it gets started and it opens.

If it was already open before, it shows these lines:

KOReader: Engine thread destroy requested!
KOReader: got error waiting for events: ffi/input_android.lua:168:
application forced to quit

and then it hangs ...

Not a huge problem for me as I know it, but perhaps easy to solve ?
Btw, I observed the same behaviour on my Samsung S7 mobile with Android 8 so it is not specific to Onyx device

Thanks, Norbert
Attached Files
File Type: txt OpenKoreaderFromCC_OK.txt (864.8 KB, 630 views)
File Type: txt OpenKoreaderFromCChangup.txt (790.2 KB, 939 views)
Norbi24 is offline   Reply With Quote
Old 09-23-2020, 01:20 PM   #2
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,254
Karma: 2189337
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by Norbi24 View Post
I have Calibre Companion 5.4.4.19 on Onyx BOOX Poke 2 (Android 9)
and I use to open books directly from CC by clicking the Read button there to open Koreader (2020.08.01) with that book.

But this works only if Koreader was not running before, if KOReader was already open with another book before, it remains hanging.

I've collected logcat logs to see what is going on and see that CC starts Koreader apparently with this:
I ActivityManager: START u0 {act=android.intent.action.VIEW dat=content://com.multipie.calibreandroid.provider/external/Calibre_Companion/Después del amor - Sonsoles Ónega.epub typ=application/epub+zip flg=0x10008001 cmp=org.koreader.launcher/.MainActivity} from uid 10083

and then, if KOreader was not running before I see later that it gets started and it opens.

If it was already open before, it shows these lines:

KOReader: Engine thread destroy requested!
KOReader: got error waiting for events: ffi/input_android.lua:168:
application forced to quit

and then it hangs ...

Not a huge problem for me as I know it, but perhaps easy to solve ?
Btw, I observed the same behaviour on my Samsung S7 mobile with Android 8 so it is not specific to Onyx device

Thanks, Norbert
Not sure if it is fixable at all. Also I cannot reproduce with Root Explorer (or Explorer I guess) on my phone.

See if you can reproduce with any recent-ish filemanager on your device. If you can reproduce that's a fw thing. If not it is probably a CC thing.

The expected behaviour is

a) file can be opened both with the program running or not. (If the device is too fast you won't see the "opening xxx" message but that's all)

b) some apps that serve content with a non standard file provider will open KO but won't open the new book, so you'll see the last screen, like if you bring KO back to the front.
pazos is offline   Reply With Quote
Advert
Old 09-23-2020, 01:46 PM   #3
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: 26012464
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Is the obvious encoding issue in the filename relevant here? (i.e., does files with low-ascii only filenames behave?)
NiLuJe is offline   Reply With Quote
Old 09-23-2020, 03:11 PM   #4
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,254
Karma: 2189337
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by NiLuJe View Post
Is the obvious encoding issue in the filename relevant here? (i.e., does files with low-ascii only filenames behave?)
Not very relevant, specially if the path was resolved once without problems.
pazos is offline   Reply With Quote
Old 09-24-2020, 04:19 AM   #5
Norbi24
Connoisseur
Norbi24 doesn't litterNorbi24 doesn't litter
 
Posts: 64
Karma: 144
Join Date: Aug 2019
Device: Tolino Vision HD4, BOOX Poke2
I have just tried to start KOReader from Filemanager+ - and there it works fine !
But on the other hand, if I do the same from CC but set it up to open a book with ALReader or with Neoreader then it works there also ... I mean if ALreader is already open I am still able to open a new book in it from CC.

I did a logcat from my attempts with Filemanager+ - at the first glance, it looks like that the command is almost the same - except for the flg property ... with Filemanager+ it is flg=0x10000003, and CC sets it to flg=0x10008001, not sure whether this can make the difference ?

From Filemanager+ (full log is also attached)
ActivityManager: START u0 {act=android.intent.action.VIEW dat=content://com.alphainventor.filemanager.fileprovider/root/storage/emulated/0/Calibre_Companion/Como polvo en el viento - Leonardo Padura.epub typ=application/epub+zip flg=0x10000003 cmp=org.koreader.launcher/.MainActivity} from uid 10081
Attached Files
File Type: txt FilemanagerPLusOK.txt (911.8 KB, 4974 views)
Norbi24 is offline   Reply With Quote
Advert
Old 09-24-2020, 05:35 AM   #6
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,254
Karma: 2189337
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by Norbi24 View Post
I have just tried to start KOReader from Filemanager+ - and there it works fine !
But on the other hand, if I do the same from CC but set it up to open a book with ALReader or with Neoreader then it works there also ... I mean if ALreader is already open I am still able to open a new book in it from CC.
Thanks for the feedback and the logs. The behaviour of KOReader differs from all the other programs.

When a program receives an intent with a content uri it is expected to copy the stream and save it into its own file (thus making a copy). That's how all programs work (including MoonReader, Readera, Pocketbook, AlReader?)


KOReader tries to resolve the absolute path of the file without making a copy. From the log attached:

Code:
09-24 10:05:10.137  3224  3239 V KOReader: [FileUtils] trying to resolve a file path from content delivered by com.alphainventor.filemanager.fileprovider
09-24 10:05:10.151  3224  3239 I KOReader: intent file path /storage/emulated/0/Calibre_Companion/Conversaci├│n en La Catedral - Mario Vargas Llosa.epub
This is intended as android is BS from the POV of KOReader (or KOReader is BS from the POV of android :P). Sadly there isn't any API for doing that and we're relying on procfs tricks.

The trick works fine with most file providers and, since KOReader is not in the play store, will continue to work as is, as we're not forced to bump target API each few months to publish updates.



Quote:
Originally Posted by Norbi24 View Post
I did a logcat from my attempts with Filemanager+ - at the first glance, it looks like that the command is almost the same - except for the flg property ... with Filemanager+ it is flg=0x10000003, and CC sets it to flg=0x10008001, not sure whether this can make the difference ?
These are activity flags and shouldn't affect the behaviour. KOReader works as a singleInstance app so most of the flags won't affect it. If you're interested you can read these excellent medium post about activity flags and launch modes


TL;DR: If you manage to reproduce the same bug on a different (non onyx) device we can discard fw quirks and point fingers to CC.
OTOH if you reproduce the bug on other apps while opening books in KO we can discard CC bugs and see if we can find a -non hackish - workaround.

If the issue just affects CC I won't try to fix it. Use a chaley version of it, which will start the activity with a file uri scheme and won't require the "guess-the-path" workaround.
pazos is offline   Reply With Quote
Old 09-24-2020, 10:21 AM   #7
Norbi24
Connoisseur
Norbi24 doesn't litterNorbi24 doesn't litter
 
Posts: 64
Karma: 144
Join Date: Aug 2019
Device: Tolino Vision HD4, BOOX Poke2
Hola Pazos,
Thanks a lot for explanation. For me also it looks it's something with CC,
as in my understanding would there be occuring any issue with guessing the path,
then it should be never working ...
Meanwhile, I have installed Calibre Sync as per recommendation from another user in the CC forum, and there everything works like a charm ! And it has for me somehow more logical UI ... will start with it so am not interested anymore in CC
Norbi24 is offline   Reply With Quote
Old 09-24-2020, 12:10 PM   #8
jnieland
Junior Member
jnieland began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Sep 2018
Device: Nook Glowlight 3, Boox Leaf 2, Boox Note Air2 Plus
I've observed the same behavior of CC and KOReader on a Likebook Mars
jnieland is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
KOReader running on BQ/Fnac devices pazos KOReader 64 Yesterday 04:59 PM
Koreader running on Kobos (all of them, hopefully!) giorgio130 KOReader 3517 02-25-2024 04:53 PM
Running dropbox sync from within KOReader? ctop Kobo Developer's Corner 1 01-30-2020 11:33 AM
Koreader not starting on Kobo Touch 2.0 SUNGOLD Kobo Reader 2 09-21-2018 03:57 AM
Upon Starting Koreader directed to wifi Kristoffer_1 KOReader 6 09-12-2018 12:10 PM


All times are GMT -4. The time now is 01:31 AM.


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