Rotate Screen boot / config settings

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

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

Radxa Zero and one of these.

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?

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.

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.

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

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

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.

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?

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.

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

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:

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.

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 :slight_smile:

I posted onto coreelec the same

Panfrost is not used in EmuELEC, its all Mali Blobs

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 :slight_smile:

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?

$ 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 ?

use

git checkout devel
1 Like

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

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

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

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

https://forum.odroid.com/viewtopic.php?t=38045