Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 08-05-2016, 06:36 AM   #1
zxczxc
Addict
zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.
 
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
Change screen orientation?

Amazon lets us go from portrait to landscape, but that is only 0 degrees and 90 degrees.
What would be needed to change/force to 180 and 270 degrees?

I think 180 - upside down would be very useful, when using anything usb OTG I/we want the usb facing upwards, not downwards into my lap/table.
I hope you understand what I'm talking about.

If there is some KUAL extension or native command that gives this feature, sorry, I did search but could not find much useful, my mistake.

Thanks for the support!
zxczxc is offline   Reply With Quote
Old 08-05-2016, 01:11 PM   #2
ecc29
Member
ecc29 doesn't litterecc29 doesn't litterecc29 doesn't litter
 
Posts: 11
Karma: 226
Join Date: Oct 2015
Device: KPW3
https://www.mobileread.com/forums/sho...d.php?t=206443
ecc29 is offline   Reply With Quote
Advert
Old 08-05-2016, 02:08 PM   #3
zxczxc
Addict
zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.
 
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
Quote:
Originally Posted by ecc29 View Post
Thanks, straight to the point!
Although I think this only gives 270, so we can use 0, 90, 270, but still not 180...? A shame if true.
zxczxc is offline   Reply With Quote
Old 08-05-2016, 03:23 PM   #4
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by zxczxc View Post
Thanks, straight to the point!
Although I think this only gives 270, so we can use 0, 90, 270, but still not 180...? A shame if true.
Read the rotations.sh script.
Then change menu.json as required.
knc1 is offline   Reply With Quote
Old 08-05-2016, 03:23 PM   #5
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by zxczxc View Post
Thanks, straight to the point!
Although I think this only gives 270, so we can use 0, 90, 270, but still not 180...? A shame if true.
The "inversion of framebuffer wangle" twobob mentions could work (using a variant of the screen rotation extension for damaged eink screen). In that case, rotating the touchscreen may be desirabe as well. I would need some tweaking to the C code and a recompile...
geekmaster is offline   Reply With Quote
Advert
Old 08-07-2016, 09:07 AM   #6
Yourcat
Groupie
Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.
 
Posts: 175
Karma: 54048
Join Date: Mar 2016
Device: PW3 5.6.5-usbnet
A small summary of the lines above: "/usr/bin/lipc-set-prop com.lab126.winmgr orientationLock (L|R|D)" "U" is not supported, so no 180° rotation.

xrandr sounds promising to rotate the screen.

xorg.conf includes 'Option "Rotate" "CW"' or 'Option "Rotate" "CCW"' depending on the Kindle model which will disable the xrandr rotation. One must remove it and enable RandRRotation.
The init script /etc/init/makexconfig re-creates /var/local/xorg.conf on X11 startup.
I removed the lines from /etc/init/makexconfig and added 'Option "RandRRotation" "on"' without success. (I killed xlinit to restart X and to recreate xorg.conf.)

Rotating the screen should work with "xrandr -o inverted" while it fails for me (PW3/5.6.5) with:
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 141 (RANDR)
Minor opcode of failed request: 2 (RRSetScreenConfig)
Serial number of failed request: 14
Current serial number in output stream: 14

So no joy here unless someone has a brilliant idea.
Yourcat is offline   Reply With Quote
Old 08-07-2016, 03:19 PM   #7
zxczxc
Addict
zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.
 
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
That's a disappointment... I have no brilliant ideas about this!
Thanks for all the help with my request though everyone - I hope someone finds a way.
zxczxc is offline   Reply With Quote
Old 08-07-2016, 03:49 PM   #8
Yourcat
Groupie
Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.
 
Posts: 175
Karma: 54048
Join Date: Mar 2016
Device: PW3 5.6.5-usbnet
Thinking about it - setting rotate to CW instead of CCW should fix it - need to test this later. [Even if this works one must rotate also the input device. Otherwise the handling will be crazy.] According to xrandr the screen is 1440x107x (=landscape) and with CCW the main screen is in portait mode, USB down. The 3rd rotate option is 'UD', likely not needed here.
Yourcat is offline   Reply With Quote
Old 08-09-2016, 12:22 PM   #9
Yourcat
Groupie
Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.
 
Posts: 175
Karma: 54048
Join Date: Mar 2016
Device: PW3 5.6.5-usbnet
CW instead of CCW in /etc/init/makexconfig for PW3 works fine to rotate the output while the input / touch screen stays as is and is upside down (or vice versa - depending on your point of view).
One may get used to crazy controls or find a way to fix also them.
Yourcat is offline   Reply With Quote
Old 08-09-2016, 02:50 PM   #10
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
If the Amazon kernel build has debugging features enabled (some have had in the past) -
Then it might be possible to 'hook' the event dispatcher for the events used and do a rectangular transformation on them before pushing them back onto the event publishing thingy.

You can tell from my in-exact description above that I haven't looked at these specific kernel details in a long time.
It is only posted as an idea to consider.
knc1 is offline   Reply With Quote
Old 08-10-2016, 02:47 PM   #11
Yourcat
Groupie
Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.
 
Posts: 175
Karma: 54048
Join Date: Mar 2016
Device: PW3 5.6.5-usbnet
I fetched xinput from Debian jessie armel:
Code:
xinput --list --long
⎡ Virtual core pointer                          id=2    [master pointer  (3)] {snip}
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)] {snip}
⎜   ↳ multitouch                                id=6    [slave  pointer  (2)]
        Reporting 4 classes:
                Class originated from: 6. Type: XIButtonClass
                Buttons supported: 9
                Button labels: "Button Left" "Button Middle" "Button 0" "Button 1" "Button 2" "Button 3" "Button 4" "Button 5" "Button 6"
                Button state:
                Class originated from: 6. Type: XIKeyClass
                Keycodes supported: 248
                Class originated from: 6. Type: XIValuatorClass
                Detail for Valuator 0:
                  Label: Abs X
                  Range: 0.000000 - 1071.000000
                  Resolution: 10000 units/m
                  Mode: absolute
                  Current value: 102.000000
                Class originated from: 6. Type: XIValuatorClass
                Detail for Valuator 1:
                  Label: Abs Y
                  Range: 0.000000 - 1447.000000
                  Resolution: 10000 units/m
                  Mode: absolute
                  Current value: 83.000000

⎣ Virtual core keyboard                         id=3    [master keyboard (2)] {snip}
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)] {snip}
And with
Code:
xinput set-prop 'multitouch' 'Multitouch Device Orientation' 1
one can rotate the input device.

A better way to restart X (without the need to modify makexconfig) is still needed to create an easy to use Kual package.
Yourcat is offline   Reply With Quote
Old 09-27-2016, 06:26 AM   #12
zxczxc
Addict
zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.
 
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
I did it!
http://imgur.com/a/6STJn

-- Oops, I didn't read properly, nice work Yourcat!

Yeah, I was following your ideas, I edited the xorg.conf file, and inserted:
Option "RandRRotation" "True" and removed
Option "Rotate" "CW"


Then I made it immutable so the system couldn't change it back on init

And yeah... lab126 really don't have this set up to account for different resolutions!
The screen went landscape, which I realized is the TRUE orientation of the screen, since yeah most places use screens landscape and nothing is telling to the kindle to go portrait (counter clock wise) anymore.

The layout was a bit of a mess, it wasn't so bad. The input wasn't correct, it was 90/270 etc.

I tested using xrandr --output default --rotation inverted/right/left...
only --rotation normal worked

I read about other people having problems like this, sometimes you need to adjust the mode your screen/display is using, look at the edid, stuff about proprietary drivers, it seemed a bit complex...

Anyway, when changing the xorg.conf back I realized (like Yourcat) - just go to CW instead of CCW.

Sorry I didn't see/understand what you did earlier, this is just what I wanted!

I'll have to build xinput but yes when we use that it would be perfect!

Although... what is the best way to edit the xorg.conf?

Making it immutable is ugly, but, I don't think the system ever changes the file.
As in, the data there remains constant (unless we update the kindle and there is a change etc)

Your idea of editing the makexconfig config creation script is great, I'll make a program to automate it.
I don't like the idea of editing system files but, it's not that invasive.
If there was an update to the kindle that mattered, relating to the xorg.conf, makexconfig would be replaced anyway... so, no big issue!

The only scary bit is that if we mess up makexconfig, maybe the kindle won't boot. ha



---

New idea:

I see this in the makexconfig file:
Code:
# Only whiskey has accelerometer as of now.
  if [ "$(f_board)" = "whisky" ]; then
    echo '        Option      "NoAccel" "false"' >> $XCONFFILE
  else
    echo '        Option      "NoAccel" "true"' >> $XCONFFILE
  fi
How about we fake having the accelerometer and send/fake whatever motion values are needed to get the system to rotate natively?

Maybe worth a shot.

Last edited by zxczxc; 09-27-2016 at 07:11 AM.
zxczxc is offline   Reply With Quote
Old 09-27-2016, 09:42 AM   #13
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Making it immutable is ugly, but, I don't think the system ever changes the file.
Only every time Amazon or yourself installs a firmware update file.
These devices (since 5.1.something) use complete system images as the update.

Also the system still has a file manifest in the form of a list of file, md5sum values for what Amazon/Lab126 considers: "Critical" files.

The rescue pack (rp) installed along with its add-in (cowards rescue pack (crp) ) is (by design) tested very early in the start-up (and certainly before the manifest check although I don't recall if before X is started).

It would be a real good idea for anyone to consider how they are going to rescue or de-brick their Kindle (and maybe practice a bit) before changing system image files.

Last edited by knc1; 09-27-2016 at 09:51 AM.
knc1 is offline   Reply With Quote
Old 09-27-2016, 10:21 AM   #14
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
How about we fake having the accelerometer and send/fake whatever motion values are needed to get the system to rotate natively?
That sounds worth trying.
Doing it at that level should already have any system interactions and dependencies dealt with.
IF they still have the working support included in the system (worth trying, Lab126 is usually slow to remove 'dead' code/scripting).
knc1 is offline   Reply With Quote
Old 09-27-2016, 11:16 AM   #15
zxczxc
Addict
zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.
 
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
Yes i understand the issues that could possibly happen

I did some research...

xinit supports passing a config file, great.
I think, I hope lxinit does too.

Code:
lxinit -- /usr/bin/X -config /mnt/us/xorg.conf
Yet, it doesn't fix this because lxinit won't do anything since X is already running.

So when I do:
Code:
killall lxinit && lxinit -- /usr/bin/X -config /mnt/us/xorg.conf
it is too late, because lxinit has already started.

I am not sure what process restarts lxinit...
Any advice there?

--
Also with regards to how the oasis goes upside down:
Code:
lipc-set-prop/lipc-get-prop

com.lab126.winmgr

	r	Str	accelerometer	[U]
	rw	Str	setAccOrientation	[0]
	r	Str	orientation	[U]
	rw	Str	orientationLock	[U]
The values in the [] brackets are the values that were read on my device.
You can see the seemingly important one (orientation) is r, read only...

Any information on how to FORCE a value?
We have root after all...

Thanks

Last edited by zxczxc; 09-29-2016 at 01:19 PM.
zxczxc is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does Kobo Touch change orientation? Orn8one Kobo Reader 22 01-13-2014 05:31 PM
Sony PRS T1 screen orientation tomixed Sony Reader Dev Corner 3 05-22-2012 11:41 AM
change screen orientation jacek.poplawski Amazon Kindle 7 10-25-2011 07:47 AM
PRS-505 Quick way to change orientation diy Sony Reader 8 11-20-2010 10:29 AM
PRS-505 Change Orientation Clockwise instead of Anticlockwise ??? jeromedevine Sony Reader 3 12-26-2009 03:12 PM


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


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