Action Item #441

Add display rotatation/flip

Added by Hammel over 2 years ago. Updated about 1 year ago.

Status:In ProgressStart date:01 Jun 2015
Priority:HighDue date:
Assignee:Hammel% Done:

30%

Category:04 - Applications
Target version:0.12.0
Severity:02 - High

Description

If the projector is upside down or displaying behind a screen the user may need to rotate and flip it.

This is a setting in config.txt. From eLinux.org:

display_rotate rotates the display clockwise on the screen (default=0) or flips the display.

display_rotate=0 Normal
display_rotate=1 90 degrees
display_rotate=2 180 degrees
display_rotate=3 270 degrees
display_rotate=0x10000 horizontal flip
display_rotate=0x20000 vertical flip

Note: the 90 and 270 degrees rotation options require additional memory on GPU, so won't work with the 16M GPU split. Probably the reason for:

So it looks like the first two bits are rotate and bit 16/17 are flip. It's unclear if you can do both rotate and flip at the same time.

This needs to be added to launcher as two keyboard sequences:
  1. Ctrl-r: rotate 180 degrees
  2. Ctrl-f: flip

Launcher needs to read the config file, parse this setting (it should always be hex) and then write out the updated value. Rotate toggles between 0 and 2 and flip toggles between 0 and 1. The default config.txt in the rpi tree (scripts/config.txt) needs to be modified to have the NORMAL setting enabled (re: not commented out). That's the line that Launcher will modify.

These changes require a reboot. Just using xrandr won't work because that doesn't affect omxplayer. omxplayer does have an --orientation option but this doesn't include flip, which would be needed to display from behind the screen.

Associated revisions

Revision 474f7f31
Added by Hammel almost 2 years ago

RM #441: Added display_rotate default to config.txt, so it can be properly handled by user-space tools and libpibox.

History

#1 Updated by Hammel over 2 years ago

  • Description updated (diff)

#2 Updated by Hammel over 2 years ago

  • Description updated (diff)

#3 Updated by Hammel over 2 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

Code updates in launcher.c. Need to verify that config.txt is

/media/mmcblk0p1/config.txt

Then I need to test this without rebooting so I can check the log to make sure it did what it's supposed to do.

#4 Updated by Hammel over 2 years ago

This needs to be a new app that can support, long term, a variety of configuration changes to the config.txt and cmdline.txt. It may need to support other configuration tools such as performing on-demand updates.

#5 Updated by Hammel about 2 years ago

  • Priority changed from Immediate to Urgent
  • Severity changed from 01 - Critical to 04 - Low

#6 Updated by Hammel almost 2 years ago

  • % Done changed from 10 to 20

Config file api (rpi* functions) have been added to libpibox. Now I just need to integrate it into a UI.

#7 Updated by Hammel almost 2 years ago

  • Priority changed from Urgent to Immediate
  • Severity changed from 04 - Low to 01 - Critical

#8 Updated by Hammel almost 2 years ago

  • % Done changed from 20 to 30

Added display_rotate with default value (0x00000) to config.txt in pibox build tree. This will make it available (without having to add it via the API) to libpibox and any user space UI I write for this file.

#9 Updated by Hammel over 1 year ago

  • Severity changed from 01 - Critical to 02 - High

#10 Updated by Hammel over 1 year ago

  • Priority changed from Immediate to High

#11 Updated by Hammel over 1 year ago

I forgot about this code and hadn't checked it in. I'm not sure what state it's in. So I created a new branch for it: mjhammel/rotate-and-flip. I pushed the changes there. I can come back to it later.

#12 Updated by Hammel about 1 year ago

  • Target version changed from 0.11.0 to 0.12.0

Forgot to say what repo this was in: launcher.

Moving out to a later target version.

Also available in: Atom PDF