clockworkpi / uConsole

This code repository offers downloads for the latest images of various uConsole models, along with kernel patches, firmware for the keyboard and 4G expansion module, hardware schematics, assembly instructions, and essential technical documents.
344 stars 49 forks source link

Running kodi screen display direction is incorrect #13

Open xue-fei opened 10 months ago

xue-fei commented 10 months ago

CM4 version, running Kodi, screen display direction incorrect, How to adjust it? System is uConsole_CM4_v1.3g_64bit.img.7z IMG_20231128_200038

57Bravo commented 10 months ago

xrandr -o right

xue-fei commented 10 months ago

xrandr -o right

Have you tested it? I tried but it didn't work

57Bravo commented 10 months ago

Yes, I tested this. I didn't want to use the stock sdcard image from CPI, so I installed vanilla RPI OS. After I patched everything, it came up with the same orientation as yours. Running xrandr fixed mine.

I guess the difference is, I'm not running Kodi. I would think xrandr would work on either though. Does it show an error after you run it?

andrwj commented 10 months ago

xrandr -o right does work for most cases but it does not work for Kodi either on CPI image or vanilla RPi image. I posted in the forums about this a long time ago, but no one had a good answer. My most recent conclusion is that the Kodi source for version 19 or so has a poor implementation of screen rotation. I've been meaning to try compiling version 20 Kodi at the smallest level, but it's a lot of work, so I've put it off until now. I hope someone can point me to a solution.

57Bravo commented 10 months ago

That's a bummer. Yeah, my image is just vanilla RPI with the CPI kernel/cfg patches. I guess you could look at any Kodi specific kernel patches and find mods made to /boot/config.txt made for their distro.

57Bravo commented 10 months ago

Maybe this "display_rotate=2 in `/boot/config.txt"

Some folks reporting needing to use 4 instead of 2

https://raspberrypi.stackexchange.com/questions/136497/how-do-i-rotate-the-screen-at-boot-time-gui-is-rotated-but-boot-messages-are-st

andrwj commented 10 months ago

@57Bravo Thanks for your replies. But display_rotate=2 also does not work. Kodi seems to access the display device directly without using any kernel services or Windows services.

xue-fei commented 10 months ago

Yes, I tested this. I didn't want to use the stock sdcard image from CPI, so I installed vanilla RPI OS. After I patched everything, it came up with the same orientation as yours. Running xrandr fixed mine.

I guess the difference is, I'm not running Kodi. I would think xrandr would work on either though. Does it show an error after you run it? How to installed vanilla RPI OS? Just download and install it? Do I need to regenerate the system?

57Bravo commented 10 months ago

If you install vanilla RPI OS, the display won't work. CPI released a patch script to rebuild the kernel with various settings and code changes to support the device.

Here's their patch: https://github.com/clockworkpi/uConsole/tree/master/Code/patch/cm4/20230630

Just use RPI imager to make the sdcard, then install the patched kernel with tweaked /boot/config.txt