Turro75 / MyMinUI

A Fork of a custom launcher and libretro frontend for the Miyoo Mini (and Plus), Anbernic RG35XX original
https://github.com/Turro75/MyMinUI
67 stars 2 forks source link

Is it possible to add new features? #5

Closed free-gen closed 3 months ago

free-gen commented 3 months ago

Is it possible to implement screen color calibration in this distribution? Through three channels for red, green and blue. Is it possible to add the display of scanlines to the kernel settings?

I really like the MinUI, but these two functions are very lacking. I'm not asking you to do this for me, but at least to clarify - is it possible to add such functions? With best wishes.

Turro75 commented 3 months ago

Thanks for the request, I try to answer:

  1. scanlines were available in the legacy rg35xx and miyoomini release of minui, I had a quick look in the code and it should be not so hard re-introducing them, by the way that code wasn't modular so it won't work on rk3566 devices (rgb30, rg353..) which I plan to extend the support so I'm not confident I'll do that. I guess the reason for its removal on MinUI was due to lack of portability.
  2. MinUI and MyMinUI works in RGB565 16bits pixel format only which means 5 bits (32 values) for Red, 6 bits (64 values) for Green and last 5 bits (32 values) for Blu, no transparency. I think any kind of filter (a filter basically multiply the original value by a factor) will bee too aggressive and not adjustable at all.

In the next release I'll add a run button specific for retroarch so for every core You can easily choose between minarch (press A) and retroarch (press Y) so for the games You like the advanced features available on retroarch only (bezels, overlays, scanlines, etc...) You'll be able to get them.

To be honest I tested scanlines when using the legacy releases mentioned above, While I agree it is important when connected to an HDMI monitor, I can't see the point of that feature on a 3.5" screen.

free-gen commented 3 months ago

Thank you for your answer!

If you can release this update I will be very glad.

And about the color calibration of the display, I am still trying to find a solution. I have already posted the question in one discussion, but I will repeat it here, maybe you can suggest something about this?

UPD: The screen issue resolved itself as soon as I installed your fork. Perhaps your build has some changes in image output, or the "screen repair" utility helped. Therefore, the issue of color calibration is no longer relevant. I don't understand why everything was green in stock, onion and minui, but now it's somehow magically fixed.

QUOTE: My MM+ has a very poorly calibrated screen. Green looks too overexposed, red looks a bit pink. The default image settings do not produce an acceptable result. I found a compromise solution in Koriki. There is a gamma adjustment (from cold to warm). But I do not like the Koriki interface, I prefer MinUI. MinUI has hard-coded parameters for the default settings (lumon file):

params.stCsc.u32Luma = 45;
params.stCsc.u32Contrast = 50;
params.stCsc.u32Hue = 50;
params.stCsc.u32Saturation = 45;

I read the documentation for mi_disp, and found that there are also additional properties for display settings:

u16RedOffset
u16BlueOffset
u16GreenOffset
u16RedColor
u16GreenColor
u16BlueColor

Using the documentation, I came up with the following code sketch:

//Set Colors
    MI_DISP_ColorTemperature_t params;
    memset(&params,0,sizeof(MI_DISP_ColorTemperature_t));
    MI_DISP_DeviceGetColorTempeture(dev, &params);

    //00~FF, 0x80 is default
    params.u16RedOffset = 0x80; 
        params.u16GreenOffset = 0x80;
        params.u16BlueOffset = 0x80;
    params.u16RedColor = 0x80;
    params.u16GreenColor = 0x80;
    params.u16BlueColor = 0x80;

    MI_DISP_DeviceSetColorTempeture(dev,&params);

Is it possible to use these properties? And what is even more desirable - to use them from an external configuration file (available for modification even after the build).

Turro75 commented 3 months ago

can You try if it works as You expect? I attached some files: lumon.elf (overwrite /mnt/SDCARD/.system/miyoomini/bin/lumon.elf) lumon.cfg (copy it to /mnt/SDCARD/.system/miyoomini/lumon.cfg launch.sh (overwrite /mnt/SDCARD/.system/miyoomini/paks/MinUI.pak/launch.sh lumon.c if You want to see the code, it's not refined but it seems to work.

Removing or renaming one parameter in the cfg file (i.e "LUM = 45" to "_LUM = 45") it ignores all the color custom params and loads the old hardcoded values. It must read all 5 values. The same happens for color temperature values, it must read all 6 values otherwise it doesn't pass anything as original lumon.elf used to do. I had to edit the minui launch.sh as lumon was launched and kept in background with (apparently) no reasons, this made it not well working as minui started when lumon didn't complete it's job so it took me awhile understanding while it was working bad (green screen even here).

The values are read and updated only at boot. For testing I suggest You to start the miyoomini without any sdcard to let it boot into stock firmware where there is a Colors tool which allows You to change values and seeing quickly how the values work. Or, if Oyu prefer You can create Your own tool to run lumon.elf.

I ask to share the values You are gonna finding and some screenshots to see if it would make sense creating some presets (especially for color temp).

If it is working fine for You I'll add this to the next release.

myfolder.zip

free-gen commented 3 months ago

Thank you for the build, all the settings work! This is a really useful feature, which unfortunately is not available in any available distribution. So I'm glad it appeared here. I want to note that the changes are applied, but in games now everything is not as smooth as it was in the release version.

Regarding calibration, I will repeat myself once again, perhaps I expressed myself incorrectly last time (I use a translator).

I came across a console with a slightly defective color calibration, I described above that there were problems with the green color (also the yellow color had green shades). I tried the stock firmware, Onion OS, MinUI and even Koriki. In all of them there is the ability to configure the same parameters as in the stock firmware, and changing them did not improve the image in any way.

Then I wrote here with a description of my problem, and only then installed your fork on the SD card. And by some miracle, it was in your build (I took the latest build from the releases section) that the colors returned to normal. Right after installation, nice colors without any shifts! Although in the source code I see the same values ​​in the lumon file as in MinUI. But on my Miyoo Mini Plus in your build, the colors and shades are initially correct. Which was not the case with any other firmware. I don’t know how it works, but it’s a fact.

And I noticed something else interesting. Using the release version of MyMinUI (which initially displays the correct colors on my device), I went to the file manager and simply explored the root structure of the console. In the /DEV directory, I saw the mi_disp file. I decided to open it, thinking that it was a text file. After clicking on this file, the colors immediately reset to a nasty pale green shade. I exited the file manager, launched the game, and observed all the same problems that were at the beginning. After rebooting the device, the colors returned to normal.

I don’t know what happened when I did this, but perhaps you will understand the reason better. But as I understand it, you obviously added something to the code to adjust the image, and this is what brings the colors to a normal value on my console. Probably the problem is that the manufacturer uses different revisions of displays, but the calibration is always the same. This explains why no one has complained about the screen before me. Probably there are too few such screens, as well as too few people who pay attention to such trifles.

But still, it was a useful experience. And I hope that in the future this will help at least one person if he encounters the same problematic version of the screen.

Turro75 commented 3 months ago

Added lumon.cfg to make the screen values adjustable (only for MiyooMini)