# Rotate Screen boot / config settings

**URL:** <https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403>\
**Category:** General\
**Created:** [August 19, 2021, 3:44pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403 "2021-08-19T15:44:29Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rolyantrauts](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@Rolyantrauts](https://emuelec.discourse.group/u/Rolyantrauts)\
**Post date:** [August 19, 2021, 3:44pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/1 "2021-08-19T15:44:29Z")

</div>

Is there a boot.ini or config.ini setting to rotate the screen as currently have portrait mode on my 4" LCD but should be landscape.

Thnx

---

<div class="post-metadata">

**Author:** ![EmuELEC](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/emuelec/32/26_2.png) [@EmuELEC](https://emuelec.discourse.group/u/EmuELEC)\
**Post date:** [August 19, 2021, 5:42pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/2 "2021-08-19T17:42:19Z")

</div>

There is no setting to rotate the screen. What device? what version?

---

<div class="post-metadata">

**Author:** ![Rolyantrauts](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@Rolyantrauts](https://emuelec.discourse.group/u/Rolyantrauts)\
**Post date:** [August 19, 2021, 8:21pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/3 "2021-08-19T20:21:22Z")

</div>

Radxa Zero and one of these.

[http://www.lcdwiki.com/4inch\_HDMI\_Display-C](http://www.lcdwiki.com/4inch_HDMI_Display-C)

Unlike other OS it does detect 800x480 but its portrait rather than landscape and the boot.ini / config.ini seems to be ignored but something else seems to configure correctly just not orientation.

It was my 1st play with emuelec but is the some sort of script that detects the display?

 ![Rzero-lcd](https://global.discourse-cdn.com/free1/uploads/emuelec/original/1X/20013ef5e333b6d7c7ce1729f277cb26219c60c2.jpeg)

---

<div class="post-metadata">

**Author:** ![EmuELEC](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/emuelec/32/26_2.png) [@EmuELEC](https://emuelec.discourse.group/u/EmuELEC)\
**Post date:** [August 19, 2021, 8:48pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/4 "2021-08-19T20:48:09Z")

</div>

Its all kernel based, AFAIK there is no script to detect orientation, which means your display is actually meant to be used in vertical mode. Kinda like the RK3326 handhelds. You have several possibilities.

1.- Patch SDL2 to handle the rotation, this is more or less what we do in the RK3326 handhelds, but it needs to be done for the Amlogic side.  
2.- Create a DTB with the screen information and handle the rotation there, but this is much more difficult AFAIK  
3.- Change the launching scripts to include -rotation for Emulationstation, BUT you will still have to handle all the emulators and change the rotation for those as well, this is easy in Retroarch, but most others will not be as easy.

BTW, where did you get that screen? would like to play with one of those myself.

---

<div class="post-metadata">

**Author:** ![Rolyantrauts](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@Rolyantrauts](https://emuelec.discourse.group/u/Rolyantrauts)\
**Post date:** [August 19, 2021, 8:52pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/5 "2021-08-19T20:52:59Z")

</div>

I got this one as it has a 3.5mm audio out from the hdmi as with the radxa zero with the limited info I couldn’t work out if the pin mux had spi & I2S on the same which could be a choice of one or other.  
So idea is use hdmi audio and spi for touch but we may get further info on the pin mux.

> **[18.36US $ 5% OFF|\[Series\] 3.5 inch/4 inch/5 inch/7 inch Raspberry Pi 4th...](https://www.aliexpress.com/item/1005001685599115.html?spm=a2g0s.9042311.0.0.730c4c4dHfagaG)**
>
> Smarter Shopping, Better Living! Aliexpress.com

---

<div class="post-metadata">

**Author:** ![EmuELEC](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/emuelec/32/26_2.png) [@EmuELEC](https://emuelec.discourse.group/u/EmuELEC)\
**Post date:** [August 20, 2021, 1:25am UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/6 "2021-08-20T01:25:08Z")

</div>

I wonder if the code here could be used somehow [GitHub - goodtft/LCD-show: 2.4" 2.8"3.2" 3.5" 5.0" 7.0" TFT LCD driver f](https://github.com/goodtft/LCD-show)

---

<div class="post-metadata">

**Author:** ![Rolyantrauts](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@Rolyantrauts](https://emuelec.discourse.group/u/Rolyantrauts)\
**Post date:** [August 20, 2021, 1:53pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/7 "2021-08-20T13:53:21Z")

</div>

Yeah it gives us details how to set but the env variables are all for the pi.

```auto
sudo echo "hdmi_force_hotplug=1" >> ./boot/config.txt.bak
sudo echo "hdmi_force_edid_audio=1" >> ./boot/config.txt.bak
sudo echo "dtparam=i2c_arm=on" >> ./boot/config.txt.bak
sudo echo "dtparam=spi=on" >> ./boot/config.txt.bak
sudo echo "enable_uart=1" >> ./boot/config.txt.bak
sudo echo "display_rotate=3" >> ./boot/config.txt.bak
sudo echo "max_usb_current=1" >> ./boot/config.txt.bak
sudo echo "config_hdmi_boost=7" >> ./boot/config.txt.bak
sudo echo "hdmi_group=2" >> ./boot/config.txt.bak
sudo echo "hdmi_mode=1" >> ./boot/config.txt.bak
sudo echo "hdmi_mode=87" >> ./boot/config.txt.bak
sudo echo "hdmi_drive=2" >> ./boot/config.txt.bak
sudo echo "hdmi_cvt 480 800 65 6 0 0 0" >> ./boot/config.txt.bak

```

The naming is slightly different and seems to be handled in boot.ini / config.ini but my changes seemed to be ignored and autoset.

Chewi posted some new images to the radxa site for libreelec and going to have a look if I can gleam anything else as I am not even sure what graphics driver is used as expected to see a Mali Panfrost driver.

---

<div class="post-metadata">

**Author:** ![EmuELEC](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/emuelec/32/26_2.png) [@EmuELEC](https://emuelec.discourse.group/u/EmuELEC)\
**Post date:** [August 20, 2021, 5:01pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/8 "2021-08-20T17:01:53Z")

</div>

Yeah but those params/variables need to be loaded by something, like the driver I posted. They will not work just like that unfortunately. I assume you already tried to place those on the `config.ini` in the main `EMUELEC` partition?

---

<div class="post-metadata">

**Author:** ![Rolyantrauts](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@Rolyantrauts](https://emuelec.discourse.group/u/Rolyantrauts)\
**Post date:** [August 20, 2021, 9:48pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/9 "2021-08-20T21:48:42Z")

</div>

Yeah config.ini there are a whole rake of params for a custom mode but not sure what they should be.  
But from /sys the mode I am running is 1080p so the hdmi chip must be scaling to native I guess which is really not what I wanted.

I was interested what the Mali G31 @ 800x480 would return with FPS of some games that you usually struggle with.  
Maybe we need to add a section in setres.sh?

`/sys/kernel/debug/mali0` so would seem to be using the panfrost driver.  
`/sys/devices/platform/meson-fb/graphics/fb0` doesn’t seem to do much though.

---

<div class="post-metadata">

**Author:** ![EmuELEC](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/emuelec/32/26_2.png) [@EmuELEC](https://emuelec.discourse.group/u/EmuELEC)\
**Post date:** [August 20, 2021, 10:28pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/10 "2021-08-20T22:28:30Z")

</div>

Considering that the Rk3326 devices use the G31 as well, and they run at a native 320x240, 640x480 and 854×480 , and they yield no performance gain at all.

There is a new `setres.sh` in this PR that you might try

> <https://github.com/EmuELEC/EmuELEC/pull/688/files>
>
> Sorry about the space fixes. I can't seem to change it in the editor yet

---

<div class="post-metadata">

**Author:** ![EmuELEC](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/emuelec/32/26_2.png) [@EmuELEC](https://emuelec.discourse.group/u/EmuELEC)\
**Post date:** [August 20, 2021, 10:31pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/11 "2021-08-20T22:31:10Z")

</div>

I still think that the best way to do it is by patching SDL2, unfortunately I do not know where to patch it exactly.

EDIT: Looking at the mali patch for SDL2 this could be a good start:

> <https://github.com/EmuELEC/EmuELEC/blob/dev/packages/sx05re/tools/SDL2-git/patches/Amlogic/SDL2-git-001-enable_mali.patch#L503>

if you know how to compile it you could test it out by switching the x and y variables. If you can’t let me know and I will compile one with those switch, I do not have such screen so I cannot test it, sorry.

---

<div class="post-metadata">

**Author:** ![Rolyantrauts](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@Rolyantrauts](https://emuelec.discourse.group/u/Rolyantrauts)\
**Post date:** [August 21, 2021, 1:00am UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/12 "2021-08-21T01:00:35Z")

</div>

> [@EmuELEC](#):
>
> Rk3326

I did run the compile the other day and the setup is super easy and being an idiot it banged out near the end and forgot what the error was.  
I will give it a go again but thinking it should be just a mode setting, but still trying to work out if the old FB blob is being used or the new panfrost drivers and maybe because OpenGL isn’t used but with OpenGL screen size obviously makes mych difference as the pixel count is much less.  
I have no idea what drives the emulators though as completely a noob to all this 🙂

I posted onto coreelec the same

> **[4" HDMI Monitor](https://discourse.coreelec.org/t/4-hdmi-monitor/16576)**
>
> Hi I recently purchased one of these 4inch HDMI Display-C - LCD wiki to work on a Radxa Zero. I am trying to work out how to set a custom resolution of 800x480 and also rotate by 270 degrees. Currently the GPU mode is 1080p so guess the HDMI...

---

<div class="post-metadata">

**Author:** ![EmuELEC](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/emuelec/32/26_2.png) [@EmuELEC](https://emuelec.discourse.group/u/EmuELEC)\
**Post date:** [August 21, 2021, 1:02am UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/13 "2021-08-21T01:02:54Z")

</div>

Panfrost is not used in EmuELEC, its all Mali Blobs

---

<div class="post-metadata">

**Author:** ![Rolyantrauts](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@Rolyantrauts](https://emuelec.discourse.group/u/Rolyantrauts)\
**Post date:** [August 21, 2021, 1:10am UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/14 "2021-08-21T01:10:16Z")

</div>

I might have a look at TwisterOS again as its debian based and I am more at home to get the resolution set and it has various emulators already installed with Panfrost and just check.

I thought CoreElec had gone Panfrost and TwisterOS doesn’t really interest me for use as like the device nature of EmuElec but prob can set resolution and orientation and now also interested if panfrost makes a difference.

I will see if coreelec mentions anything and just play with other installs just to see if it helps my understanding 🙂

---

<div class="post-metadata">

**Author:** ![Rolyantrauts](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@Rolyantrauts](https://emuelec.discourse.group/u/Rolyantrauts)\
**Post date:** [August 21, 2021, 6:18pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/15 "2021-08-21T18:18:18Z")

</div>

```auto
Cannot get spring sources : https://github.com/valadaa48/spring-libretro/archive/443d2a83584a6ea26cba797a88b5f4dae2258402.tar.gz
Try later!
FAILURE: scripts/install spring has failed!
[365/464] [FAIL] install spring

```

Seems that source is not avail?

```auto
$ git clone https://github.com/shantigilbert/EmuELEC.git
$ cd EmuELEC
$ git checkout master
$ PROJECT=Amlogic-ng ARCH=aarch64 DISTRO=EmuELEC make image

```

[GitHub - slaminger/spring-libretro](https://github.com/slaminger/spring-libretro) ?

---

<div class="post-metadata">

**Author:** ![EmuELEC](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/emuelec/32/26_2.png) [@EmuELEC](https://emuelec.discourse.group/u/EmuELEC)\
**Post date:** [August 21, 2021, 7:37pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/16 "2021-08-21T19:37:04Z")

</div>

> [@Rolyantrauts](#):
>
> `git checkout master`

use

```auto
git checkout devel

```

---

<div class="post-metadata">

**Author:** ![Rolyantrauts](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@Rolyantrauts](https://emuelec.discourse.group/u/Rolyantrauts)\
**Post date:** [August 21, 2021, 7:58pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/17 "2021-08-21T19:58:06Z")

</div>

> [@EmuELEC](#):
>
> ```auto
> + data->native_display.width = vinfo.xres;
> + data->native_display.height = vinfo.yres;
> 
> ```

Are you thinking of just swapping those around?

I did change config.ini and 800x480p60 480x800p60 do change the resolution but you end up with a small band across the top of the screen.  
Its as if the screen stays 1920x1080 but SDL does get the 800x480 so you end up with the band using top part of screen in the wrong rotation.

Are you thinking I shoud

```auto
   data->native_display.width = vinfo.yres;
   data->native_display.height = vinfo.xres;

```

---

<div class="post-metadata">

**Author:** ![EmuELEC](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/emuelec/32/26_2.png) [@EmuELEC](https://emuelec.discourse.group/u/EmuELEC)\
**Post date:** [August 21, 2021, 8:26pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/18 "2021-08-21T20:26:05Z")

</div>

yeah, not sure if that would work. I think the image still needs to be rotated.

---

<div class="post-metadata">

**Author:** ![Rolyantrauts](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@Rolyantrauts](https://emuelec.discourse.group/u/Rolyantrauts)\
**Post date:** [August 21, 2021, 8:28pm UTC](https://emuelec.discourse.group/t/rotate-screen-boot-config-settings/403/19 "2021-08-21T20:28:49Z")

</div>

Might as well see what it does.  
Its compiling now (i7 6700 so not the fastest)

[https://forum.odroid.com/viewtopic.php?t=38045](https://forum.odroid.com/viewtopic.php?t=38045)
