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

Kindle: Log the suspend/wakeup source (& a bunch of fixes) #11350

Merged
merged 6 commits into from Jan 15, 2024

Conversation

NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Jan 13, 2024

We currently don't do anything with it, but this might help someone come up with fancier smartcover handling, like we do on Kobo...

Requires koreader/koreader-base#1723


This change is Reviewable

Copy link
Member Author

@NiLuJe NiLuJe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)

@yparitcher
Copy link
Member

If you ping me after merge i will check what this is when triggered by a rtc wakeup. (If i remember it might be null)
Used extensively in my plugin https://github.com/yparitcher/zmanim.koplugin

Copy link
Member Author

@NiLuJe NiLuJe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 4 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)

@NiLuJe NiLuJe force-pushed the master branch 3 times, most recently from 9602693 to f763932 Compare January 14, 2024 22:56
We currently don't do anything with it, but this might help someone come
up with fancier smartcover handling, like we do on Kobo...

Simplify the fake events w/args checks:
We can just hitcheck the table directly, no need for another hash

Also catch ExitedSS on Kindle.
And, again, dn't do anything with it ;p.
@yparitcher
Copy link
Member

If you ping me after merge i will check what this is when triggered by a rtc wakeup. (If i remember it might be null)
Used extensively in my plugin https://github.com/yparitcher/zmanim.koplugin

Sorry, the wakeupFromSuspend & readyToSuspend events emit a arg, iirc readyToSuspend the amount of seconds left until suspend 10 -> 1, and wakeupFromSuspend either the epoch the alarm was set for or how long it slept, something like that.
If we are passing through lipc args, those would be useful too.

@NiLuJe
Copy link
Member Author

NiLuJe commented Jan 15, 2024

the epoch the alarm was set for

That might not make it through unscathed, as input_event.value is a signed int ;). (e.g., you'll likely get -1 instead since the strtol wrapper detects cast truncations).

EDIT: Oh, wait, we have a bit of time before it'll become a problem, at which point timekeeping in its entirety will be broken on those platforms anyway :D.

Copy link
Member Author

@NiLuJe NiLuJe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 3 files at r3, 5 of 5 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)

@yparitcher
Copy link
Member

If you give me a few minutes, i will test this. rebuilding now.

@yparitcher
Copy link
Member

curl refuses to build with:

[1/4] Performing configure step for 'curl'
FAILED: curl-prefix/src/curl-stamp/curl-configure /AUR/koreader/base/thirdparty/curl/build/arm-kindlepw2-linux-gnueabi/curl-prefix/src/curl-stamp/curl-configure 
cd /AUR/koreader/base/thirdparty/curl/build/arm-kindlepw2-linux-gnueabi/curl-prefix/src/curl && env CC=arm-kindlepw2-linux-gnueabi-gcc "CPPFLAGS= -I/AUR/koreader/base/thirdparty/zlib/build/arm-kindlepw2-linux-gnueabi/zlib-prefix/src/zlib/include -I/AUR/koreader/base/thirdparty/openssl/build/arm-kindlepw2-linux-gnueabi/openssl-prefix/src/openssl/include" "CFLAGS=-O2 -ffast-math -pipe -fomit-frame-pointer   -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mthumb -mfloat-abi=softfp  -fPIC" "LDFLAGS=-Wl,-O1 -Wl,--as-needed -Wl,@/AUR/koreader/base/origin.ldflags  -L/AUR/koreader/base/thirdparty/zlib/build/arm-kindlepw2-linux-gnueabi/zlib-prefix/src/zlib -L/AUR/koreader/base/thirdparty/openssl/build/arm-kindlepw2-linux-gnueabi/openssl-prefix/src/openssl -lssl -lcrypto -lz -lrt" /AUR/koreader/base/thirdparty/curl/build/arm-kindlepw2-linux-gnueabi/curl-prefix/src/curl/configure --prefix=/AUR/koreader/base/thirdparty/curl/build/arm-kindlepw2-linux-gnueabi/curl-prefix/src/curl-build --libdir=/AUR/koreader/base/thirdparty/curl/build/arm-kindlepw2-linux-gnueabi/curl-prefix/src/curl-build/lib --host=arm-kindlepw2-linux-gnueabi --enable-shared=yes --enable-static=no --without-gnutls --without-mbedtls --without-nss --without-polarssl --without-winssl --with-ca-fallback --with-ca-bundle=./data/ca-bundle.crt --with-ssl --with-ca-path=/etc/ssl/certs --with-default-ssl-backend=openssl --disable-alt-svc --enable-crypto-auth --enable-dict --disable-ech --enable-file --enable-ftp --enable-gopher --enable-hsts --enable-http --enable-imap --disable-ldap --disable-ldaps --disable-ntlm-wb --enable-pop3 --enable-rt --enable-rtsp --disable-smb --without-libssh2 --enable-smtp --enable-telnet -enable-tftp --enable-tls-srp --disable-ares --enable-cookies --enable-dateparse --enable-dnsshuffle --enable-doh --enable-symbol-hiding --enable-http-auth --disable-ipv6 --enable-largefile --enable-manual --enable-mime --enable-netrc --enable-progress-meter --enable-proxy --disable-sspi --enable-threaded-resolver --enable-pthreads --enable-versioned-symbols --without-amissl --without-bearssl --without-brotli --without-cyassl --without-fish-functions-dir --without-nghttp2 --without-hyper --without-libidn2 --without-gssapi --without-libgsasl --without-libpsl --without-nghttp3 --without-ngtcp2 --without-quiche --without-librtmp --without-rustls --without-schannel --without-secure-transport --without-spnego --without-winidn --without-wolfssl --with-zlib --without-zstd && /usr/bin/cmake -E touch /AUR/koreader/base/thirdparty/curl/build/arm-kindlepw2-linux-gnueabi/curl-prefix/src/curl-stamp/curl-configure
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... (assumed) yes
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable curl debug memory tracking... no
checking whether to enable hiding of library internal symbols... yes
checking whether to enable c-ares for DNS lookups... no
checking whether to disable dependency on -lrt... no
checking whether to enable ECH support... no
checking for path separator... :
checking for sed... /usr/bin/sed
checking for grep... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
configure: using LDFLAGS: -Wl,-O1 -Wl,--as-needed -Wl,@/AUR/koreader/base/origin.ldflags  -L/AUR/koreader/base/thirdparty/zlib/build/arm-kindlepw2-linux-gnueabi/zlib-prefix/src/zlib -L/AUR/koreader/base/thirdparty/openssl/build/arm-kindlepw2-linux-gnueabi/openssl-prefix/src/openssl -lssl -lcrypto -lz -lrt
configure: LDFLAGS note: LDFLAGS should only be used to specify linker flags, not libraries. Use LIBS for: -lssl
configure: LDFLAGS note: LDFLAGS should only be used to specify linker flags, not libraries. Use LIBS for: -lcrypto
configure: LDFLAGS note: LDFLAGS should only be used to specify linker flags, not libraries. Use LIBS for: -lz
configure: LDFLAGS note: LDFLAGS should only be used to specify linker flags, not libraries. Use LIBS for: -lrt
configure: WARNING: Continuing even with errors mentioned immediately above this line.
checking for a BSD-compatible install... /usr/bin/install -c
checking for arm-kindlepw2-linux-gnueabi-gcc... arm-kindlepw2-linux-gnueabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether arm-kindlepw2-linux-gnueabi-gcc accepts -g... yes
checking for arm-kindlepw2-linux-gnueabi-gcc option to enable C11 features... none needed
checking whether arm-kindlepw2-linux-gnueabi-gcc understands -c and -o together... yes
checking how to run the C preprocessor... arm-kindlepw2-linux-gnueabi-gcc -E
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for code coverage support... no
checking whether build environment is sane... yes
checking for arm-kindlepw2-linux-gnueabi-strip... arm-kindlepw2-linux-gnueabi-strip
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of arm-kindlepw2-linux-gnueabi-gcc... gcc3
checking curl version... 7.80.0-DEV
/AUR/koreader/base/thirdparty/curl/build/arm-kindlepw2-linux-gnueabi/curl-prefix/src/curl/configure: line 6670: syntax error near unexpected token `;;'
/AUR/koreader/base/thirdparty/curl/build/arm-kindlepw2-linux-gnueabi/curl-prefix/src/curl/configure: line 6670: ` ;;'
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile.third:819: build/arm-kindlepw2-linux-gnueabi/libs/libcurl.so.4] Error 1

@yparitcher
Copy link
Member

archlinux has autoconf 2.72, which breaks curls configure script generation. downgrading to 2.71 fixes it for now

@yparitcher
Copy link
Member

some notes for anyone interested readyToSuspend is called with args from 10 -> 1 but we may only get 1 or 2 of them before the suspend actually kicks in. (the fun and joy of dealing with PM ;)

@yparitcher
Copy link
Member

wakeupFromSuspend is passed the amount of seconds we were in suspend, however the count starts ~10s (but not exactly) after we actually suspend.

*border*

That's going to be the sneaky bug to beat for 2024, lol ;).

Fix koreader#11357
@NiLuJe
Copy link
Member Author

NiLuJe commented Jan 15, 2024

archlinux has autoconf 2.72, which breaks curls configure script generation. downgrading to 2.71 fixes it for now

Huh, good to know, so does Gentoo. I'll see if I can fudge that tomorrow ;).

(I was building the input module manually to test, FWIW).

@NiLuJe NiLuJe changed the title Kindle: Log the suspend/wakeup source Kindle: Log the suspend/wakeup source (& a bunch of fixes) Jan 15, 2024
Copy link
Member Author

@NiLuJe NiLuJe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)

@NiLuJe NiLuJe merged commit 40d27ac into koreader:master Jan 15, 2024
4 checks passed
-- this falls outside of the ges_events range of a VirtualKey, so it is *NOT* caught by VK.
-- Instead, since we're flagged is_always_active, it goes to us,
-- so we'll have to double check that it wasn't inside of the whole VK region,
-- otherwise tapping inside a border would close the VK ;p.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that was annoying.

@Frenzie Frenzie added this to the 2024.02 milestone Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants