Damian96
Posts: 2
Joined: Fri Aug 02, 2019 12:16 pm

Raspberry Pi 4 - screen rotation

Fri Aug 02, 2019 12:21 pm

Hello, I just got my new Raspberry Pi 4 and I'm trying to rotate the screen. Usually on previous Raspberry versions I did that simply by putting display_rotate=1 to config.txt, but when doing this on Raspberry 4 the screen is partly black and it's not rotated properly. Any ideas? Thanks in advance.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5932
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Raspberry Pi 4 - screen rotation

Fri Aug 02, 2019 1:53 pm

Don't use display_rotate.
Boot to desktop. Run screen configuration utility from preferences menu and choose the correct orientation of display.
Click the green tick button and display should be rotated.

Damian96
Posts: 2
Joined: Fri Aug 02, 2019 12:16 pm

Re: Raspberry Pi 4 - screen rotation

Sat Aug 10, 2019 11:48 am

Great, it worked. Thank You.

hallur
Posts: 1
Joined: Mon Aug 12, 2019 4:09 pm

Re: Raspberry Pi 4 - screen rotation

Mon Aug 12, 2019 4:10 pm

Is it possible to do this remotely via SSH?

james1122
Posts: 4
Joined: Mon Aug 12, 2019 10:02 pm

Re: Raspberry Pi 4 - screen rotation

Mon Aug 12, 2019 10:04 pm

@DOM

How to rotate the screen in headless mode?
Many thanks in advance

James

dannyk6
Posts: 29
Joined: Thu Sep 13, 2012 6:18 pm

Re: Raspberry Pi 4 - screen rotation

Tue Aug 20, 2019 2:35 pm

Looking for a way to rotate the display from command line/programmatically as well. I've also tried adding the following to /etc/xdg/lxsession/LXDE-pi/autostart

Code: Select all

@xrandr --output HDMI-1 --rotate right
However, this doesn't seem to have any effect. Any help or suggestions would be appreciated! Thanks.

dannyk6
Posts: 29
Joined: Thu Sep 13, 2012 6:18 pm

Re: Raspberry Pi 4 - screen rotation

Tue Aug 20, 2019 3:06 pm

Figured it out. This file: /etc/xdg/autostart/arandr-autostart.desktop was overriding my settings in /etc/xdg/lxsession/LXDE-pi/autostart. Commented out the arandr-autostart.desktop file and my screen now rotates on startup.

MattNYC
Posts: 6
Joined: Fri Jul 12, 2019 3:10 am

Re: Raspberry Pi 4 - screen rotation

Mon Jan 20, 2020 12:18 am

I have been trying for a few days to rotate the screen on my raspberry pi 4, the suggestions here aren't working nor updating the config.txt file with display_rotate=3

I don't even see the LXDE folder on the Pi 4, is there another way to accomplish this? Any tutorials anywhere?

Where would I be putting this: @xrandr --output HDMI-1 --rotate left

Also read somewhere to do this from terminal:
DISPLAY=:0 xrandr --output HDMI-1 --rotate left
but I'm getting a xrandr: command not found... plus would I need to run this each time in terminal... if I could get it working perhaps there's a way to run it as a cron job!?

So confused, any help appreciated.

aqb
Posts: 1
Joined: Thu Jan 30, 2020 1:44 pm

Re: Raspberry Pi 4 - screen rotation

Thu Jan 30, 2020 1:48 pm

Hello guys,

i there any alternate solution of display_rotate = 1 . As it's breaking the display also affecting the boot of the device.

noviceradiomaker
Posts: 3
Joined: Sun Dec 08, 2019 3:39 am

Re: Raspberry Pi 4 - screen rotation

Sat Mar 28, 2020 3:43 am

Is it true that there is no known solution to this problem for Raspberry Pi4? I want to rotate my 5" touchscreen LCD (ELECROW 5-inch HDMI Display-B) 90 degrees. The display itself will rotate fine using Preferences > Screen Configuration just fine,but the cursor movement with the touchscreen is off by 90 degrees. I looked for solutions and found plenty--for the RPi3---none of which work with the RPi4. Is this still the case as of 3/27/20?

Any help is appreciated.

Ernst
Posts: 1378
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Raspberry Pi 4 - screen rotation

Sat Mar 28, 2020 7:36 am

noviceradiomaker wrote:
Sat Mar 28, 2020 3:43 am
The display itself will rotate fine using Preferences > Screen Configuration just fine,but the cursor movement with the touchscreen is off by 90 degrees.
This could be helpful: https://www.raspberrypi.org/forums/view ... 9#p1561419
The road to insanity is paved with static ip addresses

User avatar
DougieLawson
Posts: 41898
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspberry Pi 4 - screen rotation

Sat Mar 28, 2020 9:42 am

hallur wrote:
Mon Aug 12, 2019 4:10 pm
Is it possible to do this remotely via SSH?
No, not without tunnelling an Xwindows session.
You may be able to do it with VNC. You may be able to do it with MobaXterm.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on Twitter/LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

noviceradiomaker
Posts: 3
Joined: Sun Dec 08, 2019 3:39 am

Re: Raspberry Pi 4 - screen rotation

Sat Mar 28, 2020 8:57 pm

answering my own question, I found that the method here worked for me:

https://www.instructables.com/id/Rotate ... uchscreen/

CodeMonkeyX
Posts: 2
Joined: Thu May 21, 2020 12:28 am

Re: Raspberry Pi 4 - screen rotation

Sat Jul 04, 2020 6:12 am

Is there any plan to fix this so the functionality will work from the command line again? I am using a 3D printer interface that uses a stripped down X11 server and just boots a browser. So booting in the desktop to change this is not really an option.

cyberpunkrocker
Posts: 2
Joined: Mon Jul 06, 2020 12:50 pm

Re: Raspberry Pi 4 - screen rotation

Mon Jul 06, 2020 1:00 pm

Comment out the line

Code: Select all

dtoverlay=vc4-fkms-v3d
(or whatever your vc4-* line is) in /boot/config.txt and reboot.

You lose the 3D-acceleration, but regain the ability to rotate/resize the framebuffer, like in Pi 3

cyberpunkrocker
Posts: 2
Joined: Mon Jul 06, 2020 12:50 pm

Re: Raspberry Pi 4 - screen rotation

Mon Jul 06, 2020 6:46 pm

Comment out the

Code: Select all

dtoverlay=vc4-kms-v3c
line in your /boot/config.txt and reboot.

You'll lose 3D-acceleration, but regain the ability to rotate and resize the framebuffer, just like in RPi3

bomilkar
Posts: 10
Joined: Tue Nov 24, 2015 9:28 am

Re: Raspberry Pi 4 - screen rotation

Mon Sep 21, 2020 8:39 am

I can confirm: in /boot/config.txt you can have either

Code: Select all

display_rotate=2
or

Code: Select all

dtoverlay=vc4-fkms-v3d
Both together don't work.
That is very unfortunate because the application (xcsoar) I'm trying to port to Raspbian OS on Pi4 wants to use DRI which is unavailable unless with "dtoverlay=vc4-fkms-v3d".

Any ideas how I can display orientation and still have DRI?
What @dom suggested "Run screen configuration utility from preferences menu" is not working for me since that seem to apply do X11 only.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 30151
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi 4 - screen rotation

Mon Sep 21, 2020 11:35 am

Yes, the config.txt rotations are deprecated when using FKMS - they are incompatible.

You can set rotation on the kernel command line.

https://www.raspberrypi.org/documentati ... ine-txt.md
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Working in the Applications Team.

aBUGSworstnightmare
Posts: 3881
Joined: Tue Jun 30, 2015 1:35 pm

Re: Raspberry Pi 4 - screen rotation

Mon Sep 21, 2020 6:53 pm

cyberpunkrocker wrote: Comment out the

Code: Select all

dtoverlay=vc4-kms-v3c
line in your /boot/config.txt and reboot.

You'll lose 3D-acceleration, but regain the ability to rotate and resize the framebuffer, just like in RPi3
why should one do that if the simple fix is the touch coordinate transformation matrix? Changing it will rotate your touch input to be aligned with your screen orientation.
viewtopic.php?f=108&t=219333&p=1348198& ... n#p1348198

bomilkar
Posts: 10
Joined: Tue Nov 24, 2015 9:28 am

Re: Raspberry Pi 4 - screen rotation

Tue Sep 22, 2020 9:53 am

jamesh wrote:
Mon Sep 21, 2020 11:35 am
Yes, the config.txt rotations are deprecated when using FKMS - they are incompatible.

You can set rotation on the kernel command line.

https://www.raspberrypi.org/documentati ... ine-txt.md
Thanks jamesh!
I see the display reacts to the settings in cmdline.txt. But doesn't come out right and I fail to translate all the other settings from config.txt to cmdline.txt.

Here is what I used in config.txt for a 7" LCD display, 1024x600 , DPI interface, no touch:

Code: Select all

[pi4]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]
dpi_timings=1024 0 0 0 88 600 0 0 0 0 0 0 0 60 0 26000000 6
gpu_mem=64
dtoverlay=dpi24
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=0x6f005
disable_overscan=1
And here is what I added to cmdline.txt:

Code: Select all

video=DSI-1:1024x600M@60,margin_left=0,margin_right=0,margin_top=0,margin_bottom=0,rotate=0
There is a lot of information in config.txt which I don't know how to map to cmdline.txt .
Can somebody help or point to documentation which helps with this??

BTW @cyberpunkrocker: my application doesn't run under X11 and I'm also not using a touch screen. Thanks for the comment anyway!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 30151
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi 4 - screen rotation

Tue Sep 22, 2020 10:55 am

bomilkar wrote:
Tue Sep 22, 2020 9:53 am
jamesh wrote:
Mon Sep 21, 2020 11:35 am
Yes, the config.txt rotations are deprecated when using FKMS - they are incompatible.

You can set rotation on the kernel command line.

https://www.raspberrypi.org/documentati ... ine-txt.md
Thanks jamesh!
I see the display reacts to the settings in cmdline.txt. But doesn't come out right and I fail to translate all the other settings from config.txt to cmdline.txt.

Here is what I used in config.txt for a 7" LCD display, 1024x600 , DPI interface, no touch:

Code: Select all

[pi4]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]
dpi_timings=1024 0 0 0 88 600 0 0 0 0 0 0 0 60 0 26000000 6
gpu_mem=64
dtoverlay=dpi24
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=0x6f005
disable_overscan=1
And here is what I added to cmdline.txt:

Code: Select all

video=DSI-1:1024x600M@60,margin_left=0,margin_right=0,margin_top=0,margin_bottom=0,rotate=0
There is a lot of information in config.txt which I don't know how to map to cmdline.txt .
Can somebody help or point to documentation which helps with this??

BTW @cyberpunkrocker: my application doesn't run under X11 and I'm also not using a touch screen. Thanks for the comment anyway!
So what is not coming out right?

And shouldn't the command line read DPI-1 not DSI-1? Not sure about that though.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Working in the Applications Team.

bomilkar
Posts: 10
Joined: Tue Nov 24, 2015 9:28 am

Re: Raspberry Pi 4 - screen rotation

Tue Sep 22, 2020 11:42 am

jamesh wrote:
Mon Sep 21, 2020 11:35 am
So what is not coming out right?

And shouldn't the command line read DPI-1 not DSI-1? Not sure about that though.
It doesn't fill the screen. See the "screen shots" in the next 2 posts. p1 and p2 is how it should look (excuse the fuzziness of p2) and p3 and p4 show what it looks like with the cmdline.txt settings.

Interesting is the rectangular spot on the lower right. This seems a permanent damage to the display after the attempts with the changed settings. The spot survives hours of power down state.

I tried DPI-1 which didn't work. Then changed to DSI-1 according to the Video Option table in this doc: https://www.raspberrypi.org/documentati ... ine-txt.md

bomilkar
Posts: 10
Joined: Tue Nov 24, 2015 9:28 am

Re: Raspberry Pi 4 - screen rotation

Tue Sep 22, 2020 11:44 am

bomilkar wrote:
Tue Sep 22, 2020 11:42 am
... See the "screen shots" in the next 2 posts. p1 and p2 is how it should look (excuse the fuzziness of p2) and p3 and p4 show what it looks like with the cmdline.txt settings.
Attachments
p2.jpg
display settings in config.txt
p2.jpg (144.08 KiB) Viewed 18030 times
p1.jpg
display settings in config.txt
p1.jpg (178.93 KiB) Viewed 18030 times

bomilkar
Posts: 10
Joined: Tue Nov 24, 2015 9:28 am

Re: Raspberry Pi 4 - screen rotation

Tue Sep 22, 2020 11:46 am

bomilkar wrote:
Tue Sep 22, 2020 11:42 am
... See the "screen shots" in the next 2 posts. p1 and p2 is how it should look (excuse the fuzziness of p2) and p3 and p4 show what it looks like with the cmdline.txt settings.
Notice: its not filling the screen and it has some weird rectangular distortion on the lower part of the screen.
Attachments
p4.jpg
display settings in cmdline.txt
p4.jpg (202.36 KiB) Viewed 18022 times
p3.jpg
display settings in cmdline.txt
p3.jpg (179.2 KiB) Viewed 18022 times

bomilkar
Posts: 10
Joined: Tue Nov 24, 2015 9:28 am

Re: Raspberry Pi 4 - screen rotation

Tue Sep 22, 2020 11:51 am

When I test the cmdline.txt settings I use this in cmdline.txt:

Code: Select all

console=serial0,115200 console=tty1 root=PARTUUID=b9d81869-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles video=DSI-1:1024x600M@60,margin_left=0,margin_right=0,margin_top=0,margin_bottom=0,rotate=0
and this in config.txt

Code: Select all

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]
# dpi_timings=1024 0 0 0 88 600 0 0 0 0 0 0 0 60 0 26000000 6
# display_rotate=2
gpu_mem=64
# hdmi_enable_4kp60=1
dtoverlay=dpi24
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=0x6f005
# hdmi_cvt 1024 600 60 6 0 0 0
disable_overscan=1

Return to “Troubleshooting”