You could try the rotation using X instead of setting it in config.txt
. I don't promise it will fix your issue, but it seems to work fine here for me (I did not compare it to the config.txt
method, however). I believe these are two pretty distinct mechanisms.
The Xorg server on the Pi uses a generic framebuffer driver, fbdev
. Note that this was not written specifically for it and should be available in any GNU/Linux ARM distro.1
A limitation of that driver is that it cannot do a dynamic rotation; normally something like xrandr --output default --rotate left
could be used to rotate the screen with the server running, but this will fail on the Pi because the fbdev driver can't do that.
However, you can configure a static rotation. I created the following as /etc/X11/conf.d/rpi.conf
(this directory does not exist by default on Raspbian, but you can create it, and the file, as root):
Section "Device"
Identifier "RpiFB"
Driver "fbdev"
Option "rotate" "CCW" # As in, counter clockwise
EndSection
Section "Monitor"
Identifier "generic"
EndSection
Section "Screen"
Identifier "screen1"
Device "RpiFB"
Monitor "generic"
EndSection
Section "ServerLayout"
Identifier "slayo1"
Screen "screen1"
EndSection
This is pretty minimal and derived from a hint here and my reading of man xorg.conf
. You don't have to use it exactly as is, the key part is the Option "rotate"
line in Section "Device"
. The possibilities are:
- "CCW", Counter clockwise aka. left
- "CW", Clockwise, aka. right
- "UD", Upside down.
If it does not work, shut X down and have a look at /var/log/Xorg.0/log
. If you left the Identifiers
the same there should be a bit in there like:
[158797.529] (==) ServerLayout "slayo1"
[158797.529] (**) |-->Screen "screen1" (0)
[158797.529] (**) | |-->Monitor "generic"
[158797.532] (**) | |-->Device "RpiFB"
Somewhere after Using config directory: "/etc/X11/xorg.conf.d"
. If that's not there, the problem is your configuration wasn't read (but there's no reason it shouldn't be on a stock system, see man xorg.conf
again). If it is, keep reading down the log -- Xorg should report your typos/errors.
1. The driver does identify the hardware (BCM2708 FB (video memory: 600kB)
, or 4050kB
on the Pi 2) but it will do this on, e.g., a general purpose Fedora ARM distro that includes no pi specific software. I'm mentioning this to make it clear there is nothing special about the Raspbian Xorg driver and any documentation you find around for the fbdev
driver, pi oriented or not, should be applicable; witness "the hint" I found about the rotate option was from a blog about DisplayLink devices.
config.txt
, and instead use xrandr (e.g.xrandr --output HDMI-0 --rotate left
) with the GUI. Since that's a different mechanism, it may produce a better result. You can test it while X is running.xrandr --output default --rotate left
I got the error:xrandr: output default cannot use rotation "left" reflection "none"
.xrandr: output default cannot use rotation "left" reflection "none"
is also present in Ubuntu Mate.xrandr
, but apparently static rotation (i.e., configuring it to start and stay that way) is possible. I'm going to try this since I could use an actual pi xorg.conf for other reasons; check back in an hour or so.