-
Notifications
You must be signed in to change notification settings - Fork 104
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
Support for Sony PRS-T* #724
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
static const int WAVEFORM_MODE_A2 = 4; | ||
static const int WAVEFORM_MODE_AUTO = 257; | ||
static const int TEMP_USE_AMBIENT = 4096; | ||
static const int TEMP_USE_AUTO = 4097; // this does not exist, simply use a value different than above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure I follow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the comment? I meant there's no actual AUTO constant for temperature in the headers, but looking at the code, if it doesn't receive a AMBIENT setting it will use the temperature sensor. Thus, I simply used a different value for that constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, thanks! :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, that's interesting ;).
I'd add the matching 0x1001 define in the header like we do on Kobo/Kindle, just so that it doesn't get zapped if someone decides to re-run gcc-lua one day ;).
PS: I realized I should've added a CI entry for this. Once I figure that out I can make a PR for that. |
Ideally you'd probably have to create a Docker image, see: Lines 21 to 23 in 22d94e9
Those are from https://github.com/koreader/virdevenv/tree/13c37dcc21d6e8acffe53e0d88e2a6e3562bd169/docker/ubuntu In lieu of that it'd also work to use the pre-Docker situation, see e4f185b#diff-354f30a63fb0907d4ad57269548329e3 However, the Docker images are used on GitLab to auto-build the nightlies as well. |
These |
Sony manufactured older readers which I didn't even intend to support, like PRSnnn. The most recent line was PRS-Tn (I guess because they had touch input). These later devices are mostly similar. If indeed you'd prefer a rename, I guess it would be better no name it prstux, instead of prst, since I'm depending custom OS anyway. Please let me know if you really prefer the rename, since I would have to change lots of names also on koreader repo. |
I agree that something closer Sony PRST would be less mysterious at a glance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few remarks, but generally okay ;).
I have no issue with the PRST naming, but then I'm used to it from the MobileRead days ;).
Makefile.third
Outdated
@@ -38,10 +38,13 @@ $(TURBOJPEG_LIB) $(JPEG_LIB): $(THIRDPARTY_DIR)/libjpeg-turbo/CMakeLists.txt | |||
cd $(JPEG_BUILD_DIR) && \ | |||
$(CMAKE) \ | |||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF \ | |||
$(if $(findstring armv6, $(ARM_ARCH)),-DWITHOUT_SIMD:BOOL=ON,) \ | |||
$(if $(findstring arm, $(ARM_ARCH)),-DWITHOUT_SIMD:BOOL=ON,) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, I want SIMD enabled on armv7 ;).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you had a build issue related to ARM detection, that's to be addressed in the crappy CMakeFile for libjpeg-turbo (there's a bunch of eInk & Android specific cases, it should be somewhat obvious, ping me if that looks too arcane ;)).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Namely, you probably need to add PRST the ginormous ENV(...) branch ;).
Makefile.third
Outdated
-DCHOST="$(CHOST)" \ | ||
-DCFLAGS="$(CFLAGS)" \ | ||
-DLDFLAGS="$(LDFLAGS)" \ | ||
-DCMAKE_CXX_COMPILER="$(CMAKE_CXX_COMPILER)" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, libjpeg-turbo is C only, we shouldn't need that.
If CMake complains, you have a CMake toolchain setup snafu somewhere earlier ;).
ffi/framebuffer_mxcfb.lua
Outdated
self.mech_refresh = refresh_prst | ||
self.mech_wait_update_complete = prst_mxc_wait_for_update_complete | ||
|
||
self.waveform_fast = C.WAVEFORM_MODE_DU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless there's a platform-specific issue with A2 (like there is on REAGL), we usually go with A2 instead of DU for that ;).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I remember A2 being slower than DU, but I can re-check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory, it should be the fastest you can go, at the expense of quality (being basically pure B & W).
DU is more lenient, it handles a few shades of gray, and as such should be a tiny bit slower.
Since we only use this for pure B&W elements (mainly menu/button highlights), if A2 works, that's better.
In practice, there's a few cases where A2 doesn't behave as expected, but that's usually limited to REAGL screens, which I think the T2 predates, so that shouldn't be the case here ;).
ffi/framebuffer_mxcfb.lua
Outdated
|
||
self.waveform_fast = C.WAVEFORM_MODE_DU | ||
self.waveform_ui = C.WAVEFORM_MODE_AUTO | ||
self.waveform_flashui = C.WAVEFORM_MODE_GC16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the same vein, unless there's a specific platform issue where AUTO doesn't always honor UPDATE_FULL, this should be AUTO too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EDIT: answered above comment here
ok, i will change to AUTO.
static const int WAVEFORM_MODE_A2 = 4; | ||
static const int WAVEFORM_MODE_AUTO = 257; | ||
static const int TEMP_USE_AMBIENT = 4096; | ||
static const int TEMP_USE_AUTO = 4097; // this does not exist, simply use a value different than above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, that's interesting ;).
I'd add the matching 0x1001 define in the header like we do on Kobo/Kindle, just so that it doesn't get zapped if someone decides to re-run gcc-lua one day ;).
Ok, I will then rename everything to sony_prstux or sony_prst. I will also look into reverting those changes to libjpeg-turbo cmakelist and see what is wrong with the toolchain that may have triggered that. I'm building a Docker image for building the code, which could be later used for CI. Should I base it on the same base image used for those on the virdevenv repo? Or could I roll my own? I see you use gcc 4.8 and I was using stock ARM 4.9 (cross compilation) found on Ubuntu 16.04, since it matches that of ARMHF Debian Jessie. |
Match the TC of your target device if possible, yeah. (c.f., https://github.com/koreader/koxtoolchain for the Kindle/Kobo TCs, for instance). |
Ok, so here's the error I get if I revert the changes. I see a mix of i386 and arm compilation. I don't fully understand why or how it happens. What I do see is that CMakeLists grabs gcc for ARM but g++ for x86. Also, SIMD appears to mean SSE and not NEON. That's why I originally assumed I did not want SIMD for any arm arch. https://gist.github.com/v01d/33cdf5879b1aed33dc844d03e2ea0eff |
This comment has been minimized.
This comment has been minimized.
1 similar comment
@NiLuJe I think I traced it back to CMAKE_SYSTEM_NAME not being set for PRST. I added the check $ENV{PRST} but it does not seem to be set (I'm exporting it as you see in the Makefile). |
Yeah, that's what happens when CMAKE_SYSTEM_NAME/CMAKE_SYSTEM_PROCESSOR aren't set or mismatched w/ libjpeg-turbo, it mysteriously decides it wants to build x86 assembly :D. Adding an EDIT: And yes, that export in Makefile.defs looks perfectly fine. |
Try a new build from a clean tree? I've had some weird & unreproducible issues when hot-swapping CMake configs... |
@NiLuJe so it appears that there's an issue with checking environment variables like that. I can only get it to work by doing something like It seems adding the '$' is problematic and particularly checking environment variables. Then again, this issue might be due to some cmake version. I have 3.5.1 on my docker image. |
I had the exact same issue when I initially started writing this using If it works for you and doesn't break the CI, go for it ;). I'm on Gentoo here, so a fairly current CMake version (3.12.1, FWIW). We're doing a metric-ton of tests this way, though. |
IIRC, there might be a similar issue with the CHOST expansion in the regex, I tweaked the syntax a few times until either I stopped doing it wrong and/or it happened to play nice with the various CIs. |
Hi, I addressed the aforementioned issues in my last commit. I also added a CI entry using my docker build image. This failed due to some dumb issue in the Docker file which I just fixed. If you want/can re-trigger the job I think it should run OK now. Next step is the rename. |
(prst build restarted) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK.
That just leaves the minor A2/AUTO waveform mode tweaks ;).
In case you missed it: the 2nd build run failed too. Reason:
|
(I launched it a 3rd time and it failed the same way, so not a quirk ;)). |
Sorry, those changes were left on my reader when testing and did not made the commit. Just pushed that. I also fixed the docker image (supposeddly). |
(I don't know if we have a real documentation for how to setup those Docker images, but in any case, feel free to jot down what worked/didn't work somewhere... ;)). |
Thanks! I saw the error as well. I think I just solved that also. I'm pushing here the rename and see if this time builds OK. |
👍 LGTM! |
Cool, thanks! After this is merged I will make the PR on koreader repo. |
@v01d My bad because I only implied it a bit by linking to the virdevenv repo rather than explicitly saying it, but could you please also submit a PR for your Docker image here? https://github.com/koreader/virdevenv/tree/master/docker/ubuntu |
Ok, will do soon. |
This PR adds support for Sony PRS-T readers, which run a custom-made Linux distribution (based on Debian Jessie) which I named PRSTUX. I have a PRS-T2 only so I only that model is supported but most likely the other two models aren't two different. I have my ereader fully working with PRSTUX and koreader.
After this PR get merged I will make a PR for the main repo, with the submodule correctly pointing to this repo's current commit.
Please note that I had to include a fix in
libjpeg-turbo/CMakeLists.txt
file, since it wouldn't detect my architecture as ARM (since the check was specialized for armv6) and also CXX flags where not correctly set (only C flags were).