RetroArch icon indicating copy to clipboard operation
RetroArch copied to clipboard

Menu ignores video_rotation configuration

Open natinusala opened this issue 7 years ago • 28 comments

Description

The menu doesn't rotate with the video_rotation configuration set to something else than 0. Unless we can rotate the framebuffer (which we can't yet), this will be needed to have Lakka on the Nintendo Switch.

Expected behavior

The menu should rotate as well as the cores, without any stretching issues.

Actual behavior

Nothing happens for the menu, and the cores image is stretched.

Steps to reproduce the bug

  1. Open RetroArch in a menu
  2. Set the video rotation to some degree in the options
  3. See that the menu is not rotated
  4. Open some content, see that it's stretched

Bisect Results

This option was never meant to rotate the menu.

Version/Commit

  • RetroArch: d360265

Environment information

  • OS: Lakka on the Nintendo Switch (no xorg server)
  • Compiler: Lakka build script

natinusala avatar May 12 '18 14:05 natinusala

Not sure if we can use this code to do it ?

Source

gouchi avatar May 14 '18 18:05 gouchi

This code is about knowing that the display should be rotated.

Here (Lakka on the Switch), we're targeting very specific hardware where we already know that the display should be rotated. The issue being : how should we rotate it ? For now, we can't.

natinusala avatar May 14 '18 18:05 natinusala

This should be considered a fairly major issue in all regards, simply because physically rotating a display is a real thing. Hopefully it's not a majorly difficult thing to accomplish, but it's certainly impressive to see not already implemented!

Huntereb avatar May 19 '18 15:05 Huntereb

@natinusala Yes right it is just for knowing the orientation.

It seems there is rotation kms properties.

gouchi avatar May 20 '18 19:05 gouchi

There is now a screen_orientation setting for handling this.

ghost avatar Feb 23 '19 15:02 ghost

@bparker06 Screen Orientation rotates all screen, not only Retroarch window content.

ofry avatar Mar 08 '19 12:03 ofry

That's correct

On Fri, Mar 8, 2019, 07:37 ofry [email protected] wrote:

@bparker06 https://github.com/bparker06 Screen Orientation rotates all screen, not only Retroarch window content.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/libretro/RetroArch/issues/6770#issuecomment-470914274, or mute the thread https://github.com/notifications/unsubscribe-auth/ABpC0Lm_6QqSLOiXP052m6N69khXEbXFks5vUlmPgaJpZM4T8cXb .

andres-asm avatar Mar 08 '19 13:03 andres-asm

As I can see in the commits implementing this, it only work with X11 and Win32 drivers.

(I'm trying to configure rotation in Lakka-Generic.x86_64-2.2.2.img and it does not work.)

smokku avatar Aug 01 '19 14:08 smokku

@smokku it is working on X11 and on Lakka Generic we are using DRM/KMS not X11.

gouchi avatar Aug 08 '19 12:08 gouchi

I tried to use it on latest Lakka on a PC with nVidia card and:

  • the menu option is not visible in UI (with advanced options enabled)
  • when changing screen_orientation=1 by directly editing the config file - rotation did not change

smokku avatar Aug 08 '19 13:08 smokku

@smokku May you try with image.

gouchi avatar Aug 10 '19 20:08 gouchi

@gouchi Are you talking about the screen_orientation setting working in Lakka? Because I don't see a display server in RA for DRM, so I don't see how that could work.

ghost avatar Aug 11 '19 01:08 ghost

I browsed briefly through DRM/KMS docs and there is plane rotation property. I will look into adding support for screen_orientation to DRM/KMS diriver.

smokku avatar Aug 11 '19 09:08 smokku

The screen rotation property is just for information purposes - we still need to flip the coordinates and rotate the display inside of retroarch

natinusala avatar Aug 11 '19 09:08 natinusala

I thought it looked too easy. ;-)

smokku avatar Aug 11 '19 09:08 smokku

@bparker06 the image provided is special one for nVidia card which runs X11.

gouchi avatar Aug 11 '19 09:08 gouchi

Any hints on workflow for developing DRM/KMS driver? When switch to VTY and run retroarch it works, but I have no keyboard controls (no matter which input driver I enter in config) - to the point I cannot switch back to X. I need to ssh to my machine and kill retroarch to regain keyboard. ;-)

smokku avatar Aug 11 '19 09:08 smokku

Are you in the input group ?

You may try this documentation about DRM/KMS. Also you can use modetest from libdrm (autotools | meson) to get display information and set resolution.

There is this code in RA but somebody more familiar will have better answer.

gouchi avatar Aug 11 '19 10:08 gouchi

Thanks for the /dev/input tip. I also needed ./configure --enable-udev.

Now it works on VTY. :)

smokku avatar Aug 11 '19 13:08 smokku

A bit more digging through code and I see that screen_orientation is a setting specific to a display server (currently: android, null, win32, x11) and uses display server facilities to rotate the whole display on the OS level.

The setting video_rotation is for core only, so even implementing it in drm_gfx driver would not help rotating the menu.

OK. This is a lot more involved. Any information on why menu is not affected by video_rotation setting?

smokku avatar Aug 13 '19 20:08 smokku

Because it's not implemented, and it's also not meant to rotate the menu

natinusala avatar Aug 14 '19 08:08 natinusala

Is there a use case, when one would like to rotate the core, but not the menu?

smokku avatar Aug 14 '19 09:08 smokku

Arcade or Nintendo DS cores for instance

natinusala avatar Aug 14 '19 09:08 natinusala

I do understand that there are games and emus that use vertical screen layout. In fact, I've built an arcade cabinet with vertical screen, because I play mostly vertical shooters. That's why I am interested in working on this feature - I would like to use Lakka with my cabinet.

It puzzles me though for an use case when you would like the menu not rotated, but rotated game/core. I guess for devices which you can easily rotate, like mobile phone, this could be useful to have horizontal menu and vertical game... IDK

smokku avatar Aug 14 '19 18:08 smokku

As I said, desmume has the ability to request a rotation to the frontend because whatever current content needs the display to be rotated - I'm sure it's not the only core

And that rotation request directly overrides that video rotation settings I believe

natinusala avatar Aug 14 '19 18:08 natinusala

Hard to follow this thread with regards to screen_orientation setting. Seems like it works on some systems and not others? I'm wondering why this is a Lakka or RA issue. Doesn't linux support setting the screen orientation?

unformatt avatar Feb 22 '21 04:02 unformatt

@unformatt We don't use Xorg by default on Lakka, so you can't use screen_orientation, but there is an experimental version dedicated for Nvidia cards which is using Xorg so you could change screen orientation with this version.

gouchi avatar Feb 28 '21 19:02 gouchi

Any update on this topic about screen_orientation working in a KMS/DRM environment?

rtomasa avatar Jul 13 '22 20:07 rtomasa

Any further update on an implementation for menu rotation with DRM/KMS?

I'm assuming there is an limitation within RetroArch which is making this a difficult feature to add.

ChristopherHaynes avatar Jan 12 '23 00:01 ChristopherHaynes