jareware / chilipie-kiosk

Easy-to-use Raspberry Pi image for booting directly into full-screen Chrome, with built-in convenience features for unattended operation. Perfect for dashboards and build monitors.
MIT License
1.35k stars 155 forks source link

How to rotate screen with Pi4 buster ? #92

Open yanisla35 opened 4 years ago

yanisla35 commented 4 years ago

HI,

I'm looking for a way to rotate screen with the PI4, but there is no way to use 'display_rotate' because of "vc4-fkms-v3d'. But I really need this driver to run...

Then, what is the solution to rotate the screen without deactivating "vc4-fkms-v3d" ?

Thank you in advance.

jareware commented 4 years ago

I wasn't aware of the rotation not working on Pi 4.

I'd be happy to hear of any solution you might come up with!

jareware commented 4 years ago

https://github.com/futurice/chilipie-kiosk/issues/61#issuecomment-531467096 seems related.

jareware commented 4 years ago

Can confirm that you need to disable the line

dtoverlay=vc4-fkms-v3d

in /boot/config.txt if you want this to work on Rpi4.

jareware commented 4 years ago

I'll update the relevant part of the first-boot doc at least. Better than nothing.

wujood commented 4 years ago

I just found out that you do not need to disable dtoverlay by inserting a line into the .xsession file

xrandr --output HDMI-1 --rotate left

I tried a lot of things, but this seems to work. Tried it on a fresh install without changing anything else. Here is how the beginning of the file looks:

#!/bin/bash

export DISPLAY=:0.0

# Start cursor at the top-left corner, as opposed to the default of dead-center
# (so it doesn't accidentally trigger hover styles on elements on the page)
xdotool mousemove 0 0

# Set some useful X preferences
xset s off # don't activate screensaver
xset -dpms # disable DPMS (Energy Star) features.
xset s noblank # don't blank the video device

# Rotate screen 90 degrees
xrandr --output HDMI-1 --rotate left

# Set X screen background
sudo nitrogen --set-centered background.png

# Hide cursor afer 5 seconds of inactivity
unclutter -idle 5 -root &
[...]

@jareware If this could make it into the docs, that would be awesome, because i spent days until i figured this out.

jareware commented 4 years ago

Definitely! And feel free to send a PR for the docs if you have time!

marutimuthu commented 3 years ago

Rotate screen 90 degrees

xrandr --output HDMI-1 --rotate left

Tried adding ^ to .xsession file It did not work. Is there any other configuration required ?

wujood commented 3 years ago

Could you provide more context? Where did you add the line? Did you change anything else?

marutimuthu commented 3 years ago

I added the line in the .xsession file. No other changes. This worked for me: xrandr --rotate left

wujood commented 3 years ago

Does it also work if you use HDMI-2 as output? There are two outputs on the raspberry so you would need to change that accordingly

marutimuthu commented 3 years ago

I guess for that you will have to export DISPLAY=:0.1 corresponding to HDMI-2