Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesigned OLED menu. Better UI, easier development. #527

Merged
merged 6 commits into from Jan 31, 2024

Conversation

PSHarold
Copy link
Contributor

@PSHarold PSHarold commented Jan 26, 2024

Main features:

  • Easier development and cleaner codes. You can now dynamically create menu items, thus supporting showing preset names rather than 1234567. (16 presets max, use WebUI for more)
  • Translations. Menu items that need to be translated use xbm images instead of C/C++ strings. Run generate_translations.py to update translations. Menu items can have varying font sizes.
  • Long text will automatically scroll.
  • Better UI. A unified status bar for navigation and pagination.
  • Two new menu items for checking WiFI info and clearing connection (reset to AP mode).
  • Shows a screensaver after 3 minutes of inactivity.
  • OLEDMenuConfig.h contains some options. Be careful with these options as you can easily run out of BSS.
  • OSD menu
    • Brightness
    • Constrast
    • Hue: Not in use.
    • Volume: Not in use.
    • Horizontal Shift
    • Vertical Shift
    • Horizontal Scaling
    • Vertical Scaling

Generate translations for menu items:

  1. Open generate_translations.py and locate menu_items.
  2. Translate all items in the list by adding "key: value" to the dictionaries, where key is the language code (can be any string) and value is the translated string in the target language.
  3. Run python generate_translations.py -font size1@path_to_font1 size2@path_to_font2 ... LANG, where size1, size2, ... are the sizes specified in menu_items. path_to_font1, path_to_font2,... are paths to font files. LANG is the language code used as keys in menu_items
    For example:
    python generate_translations.py --font 12@/Users/xxx/Library/Fonts/MesloLGLNerdFontMono-Regular.ttf 16@/Users/xxx/Library/Fonts/MesloLGLNerdFontMono-Regular.ttf will update English strings (en-US is default and can be omitted)
    python generate_translations.py --font 12@some-font.ttf 16@some-other-chinese-font.ttf zh-CN will translate the strings into Simplified Chinese and use 2 different fonts.

Misc:

  • Move some struct definitions to header files.

Need testing.

@PSHarold
Copy link
Contributor Author

PSHarold commented Jan 26, 2024

I do not have a rotary encoder on my gbsc (only buttons). Could someone help me test this?

@Metaln00b
Copy link
Contributor

Metaln00b commented Jan 26, 2024

I have one and could test. But we need more testers.

EDIT: Encoder is working, and my first tests are good. Nice work

@PSHarold
Copy link
Contributor Author

@nyanpasu64 @rickdgray

@rickdgray
Copy link

Just hooked up the rotary encoder a couple hours ago. I'll load it up tomorrow and try it

@YoImLee
Copy link

YoImLee commented Jan 26, 2024

I really appreciate the new font, it's much easier to read. I have been testing for a little while and have found a few things.

  • There seems to be a problem when more than 10 presets are saved on the device. When entering and backing out of 3 different menus the OLED displays "Maximum number of items" on screen before rebooting. With 10 presets or less this doesn't occur.
Picture

Screenshot_2024-01-26_12-39-14

  • There still seems to be an issue where custom presets need to be loaded twice before the correct one is loaded. I have tried it with another clean ESP unit and the same happens there. Custom filter settings are also not loaded, even with the setting enabled in the web UI.

  • This is fairly minor, but the "Connected" checkmark on the wifi info screen is cut off and doesn't automatically scroll. Perhaps the checkmark symbol could just be removed or the text could be moved to the left slightly.

Picture

Screenshot_2024-01-26_12-40-10

  • The OSD is a neat addition, but the rotary encoder controls seem to be inverted currently.

@nyanpasu64
Copy link
Collaborator

The error actually says Maxmimum (misspelled),which may help in grepping the code for where it comes from.

@rickdgray
Copy link

Hey pulled down your branch and gave it a try.

Man, this is such an improvement to the old UI.

I agree, the new font is better and more readable since it's larger. It does cut off the checkmark now, though.

I'm not really sure what the new menu item is for? OSD Menu? When clicked, I just see a timer and that's it.

IDK if it's just my rotary encoder, but the rotations are not always consistent. Sometimes I turn it and it doesn't move. Sometimes it's delayed. Seems like it maybe it is not reading input while processing a selection change? Like I have to briefly pause between each turn to make it change selection properly. Again, I'm not sure if it's just me. I did buy a pretty cheap encoder and I just have it wired up on breadboard right now.

I also find the reversed movement of the encoding kind of off. I expect the selection to go down if I turn it clockwise. Currently, it goes down if turned counterclockwise.

I haven't tried the issue with many presets, yet.

@ramapcsx2
Copy link
Owner

Okay, I think the rotary encoder stuff will be tricky. This seems to be something that needs tuned delays on parsing state changes, to debounce the reads and to try and avoid missing steps. It's not really an UI thing, but it seems it got changed in this commit?
Maybe to tune it, have a couple of options exposed for users to try different delay / debounce settings. This way, working values could be reported.. Maybe overkill though :p

Double load requirement of custom presets sounds like a new logic bug.

@YoImLee
Copy link

YoImLee commented Jan 27, 2024

The OSD menu opens a menu on screen that lets you tweak a few settings. My rotary encoder seems to work correctly where clockwise is down and vice versa. There's #define NEW_OLED_MENU_REVERSE_ROTATORY_ENCODER in gbs-control.ino to change the direction if needed.

@rickdgray
Copy link

rickdgray commented Jan 27, 2024

I wonder if perhaps your encoder is wired in reverse? Mine is wired as per this
image

Edit: oh sorry; I didn't notice it was not harold responding. Well that's two votes for both directions, then. Which direction should be default?

@PSHarold
Copy link
Contributor Author

PSHarold commented Jan 27, 2024

I wonder if perhaps your encoder is wired in reverse? Mine is wired as per this image

I do not have an encoder on my gbsc. That's why there are some problems with the encoder. I will "re-reverse" it in the code to make it behave normally. Also, There's a #define NEW_OLED_MENU_REVERSE_ROTATORY_ENCODER 0 in gbs-control.ino, if at anytime you want to reverse it again, change it to 1.

@PSHarold
Copy link
Contributor Author

PSHarold commented Jan 27, 2024

Working on the problems.

@rickdgray
Copy link

OK I just loaded up what's in master to compare (sorry, only just got my build in a running state yesterday!).

The direction of the encoder is actually the same. But I do still feel it's backwards and probably should be switched regardless. That's just my opinion; I realize this could be subjective.

I don't actually think this PR introduced a bug with debouncing or buffering the inputs. Master branch also has the same behavior. If you spin the encoder quickly, it skips a lot of inputs. I definitely feel like there's some improvement to be made, but in my opinion, it is out of scope and should be it's own PR.

I see now the on screen display; it is very cool! Very convenient to be able to change on the fly. The scroll bars are bugged currently however. A single shift left or right jumps from 0 to 100. The change still works correctly, so probably just the percent calculation for the OSD.

@PSHarold
Copy link
Contributor Author

PSHarold commented Jan 27, 2024

OK I just loaded up what's in master to compare (sorry, only just got my build in a running state yesterday!).

The direction of the encoder is actually the same. But I do still feel it's backwards and probably should be switched regardless. That's just my opinion; I realize this could be subjective.

I don't actually think this PR introduced a bug with debouncing or buffering the inputs. Master branch also has the same behavior. If you spin the encoder quickly, it skips a lot of inputs. I definitely feel like there's some improvement to be made, but in my opinion, it is out of scope and should be it's own PR.

I see now the on screen display; it is very cool! Very convenient to be able to change on the fly. The scroll bars are bugged currently however. A single shift left or right jumps from 0 to 100. The change still works correctly, so probably just the percent calculation for the OSD.

Sorry, haven't pushed yet. I also think it's subjective. Sometimes I feel it's reverserd and the next day I feel it's normal. So
I stopped using the encoder and replaced it with buttons (there are some pins not in use).
As for the OSD, only Brightess and Constrast can be adjusted progressively (percent bar). The other settings either don't have upper/lower boundaires or have just 2 values (on/off), so the bars are either full or empty.

@YoImLee
Copy link

YoImLee commented Jan 27, 2024

@rickdgray have you tried changing #define NEW_OLED_MENU_REVERSE_ROTATORY_ENCODER to 1? I think wiring the rotary encoder one way or another depends on the way you interpret the symbol on the schematic and this option makes it a non-issue anyway.

@rickdgray
Copy link

As for the OSD, only Brightess and Constrast can be adjusted progressively (percent bar). The other settings either don't have upper/lower boundaires or have just 2 values (on/off), so the bars are either full or empty.

Right, that makes sense.

@rickdgray have you tried changing #define NEW_OLED_MENU_REVERSE_ROTATORY_ENCODER to 1? I think wiring the rotary encoder one way or another depends on the way you interperet the symbol on the schematic and this option makes it a non-issue anyway.

Yeah, I did just now. It felt perfect after that. No big deal either way. I'll probably make a PR for the documentation; I think the direction should be mentioned there.

@PSHarold
Copy link
Contributor Author

PSHarold commented Jan 27, 2024

@rickdgray
You can now reverse control for menu navigation and OSD navigation separately in OLEDMenuConfig.h via REVERSE_ROTARY_ENCODER_FOR_OLED_MENU and REVERSE_ROTARY_ENCODER_FOR_OSD

@YoImLee

  • Custom presets loading should be working correctly now, I think. I don't have a retro console to test it.
  • The menu can now list up to 16 custom presets. If you have more, there will be a prompt saying you need to use WebUI to access the remaining ones.

@YoImLee
Copy link

YoImLee commented Jan 27, 2024

Custom presets now load first try! It would be nice if filter settings saved to the presets were loaded in as well. The old menu didn't do this either though, so if it's not possible it's no big deal.

The REVERSE_ROTARY_ENCODER_FOR_OLED_MENU option works as expected. REVERSE_ROTARY_ENCODER_FOR_OSD doesn't seem to work for me however.

Having more than 10 presets no longer causes the "Maximum number of items" error and works properly all the way up to 16. Having more than 16 indeed shows a prompt.

The menu seems quite stable now, I like it.

@PSHarold
Copy link
Contributor Author

PSHarold commented Jan 27, 2024

Custom presets now load first try! It would be nice if filter settings saved to the presets were loaded in as well. The old menu didn't do this either though, so if it's not possible it's no big deal.

The REVERSE_ROTARY_ENCODER_FOR_OLED_MENU option works as expected. REVERSE_ROTARY_ENCODER_FOR_OSD doesn't seem to work for me however.

Having more than 10 presets no longer causes the "Maximum number of items" error and works properly all the way up to 16. Having more than 16 indeed shows a prompt.

The menu seems quite stable now, I like it.

I'm glad you like it. I don't understand how saving and loading presets work and hopefully someone can make that happen.

REVERSE_ROTARY_ENCODER_FOR_OSD should now work correctly.
(btw did you set both REVERSE_ROTARY_ENCODER_FOR_OLED_MENU and REVERSE_ROTARY_ENCODER_FOR_OSD to 1? In that case the old code just reversed osd nav to normal, kinda like -1*-1=1 because osd nav depended on oled nav)

@YoImLee
Copy link

YoImLee commented Jan 27, 2024

Yeah, I did try all combinations and I don't remember exactly what caused it to not behave as expected. Either way this new code seems to work correctly for me.

@rickdgray
Copy link

Awesome work!

@rickdgray
Copy link

I just pulled down the latest and everything discussed works correctly. The only things I would mention is that the 2 OSD menus are still disabled, and that in 1080 resolution, the OSD is stretched and doesn't follow the same aspect ratio.

@PSHarold PSHarold marked this pull request as ready for review January 28, 2024 01:26
@YoImLee
Copy link

YoImLee commented Jan 30, 2024

Very interesting. I always found it a bit odd how that particular setting was saved in the browser.

@rickdgray
Copy link

@lito69
Copy link

lito69 commented Jan 30, 2024

@lito69 https://ramapcsx2.github.io/gbs-control/Wiki/Software-Setup.html

Hello, yes, the bin to flash my esp8266 with the files can be compiled, but I don't know how to implement everything they edit here for these mods

@ramapcsx2
Copy link
Owner

Sounds like the entire server stuff should be redone, ideally when moving to other hardware (exploit their improvements, such as multi core).
This PR though sounds good. Let's hope the server will manage :)

@ramapcsx2 ramapcsx2 merged commit 5293343 into ramapcsx2:master Jan 31, 2024
@ramapcsx2
Copy link
Owner

Thanks for the work done here everyone!
It would be great if you could monitor a bit, see whether people have issues they can't solve :)

@lito69
Copy link

lito69 commented Jan 31, 2024

I have found an error: When I select 1289x960 it is not marked in the web interface. The OSD sometimes when you raise or lower the bar goes to extremes, it does not go up percentage wise. The osd cannot select volume or what I think is color. GBSC is wonderful now! Thank you very much, I am happy with these things, if there could be temporarily an osd with basic resolution and hz information that would be wonderful.

https://www.youtube.com/watch?v=EyoqJvYDYd8

@PSHarold
Copy link
Contributor Author

PSHarold commented Jan 31, 2024

I have found an error: When I select 1289x960 it is not marked in the web interface. The OSD sometimes when you raise or lower the bar goes to extremes, it does not go up percentage wise. The osd cannot select volume or what I think is color. GBSC is wonderful now! Thank you very much, I am happy with these things, if there could be temporarily an osd with basic resolution and hz information that would be wonderful.

https://youtu.be/EyoqJvYDYd8?si=IfbWwkx-vgS3QJqN

  1. Only Brightess and Constrast can be adjusted progressively (percent bar). Scaling and Moving cannot because I used exisiting code to achieve these two functions and haven't implemented percentage. It requires refactoring some functions. I'll fix it.
  2. Volume and Hue are disabled because there are no corresponding controls in gbsc, I think.
  3. As for WebUI, can someone help confirm and locate the problem?

@lito69
Copy link

lito69 commented Jan 31, 2024

Thank you, it's fun for me to try, I put in my previous message a link to YouTube where I try it, I'm proud of the community.

https://www.youtube.com/watch?v=43IozivnS9Y

Is there a possibility of making an osd with basic resolution and hz information? As on the OLED screen but on the TV, a duration of 5s is enough

@YoImLee
Copy link

YoImLee commented Jan 31, 2024

I have found an error: When I select 1289x960 it is not marked in the web interface.

1280x960 will only work with 60Hz. It seems like you're using a 50Hz source in your video, which will only work with 1280x1024. I think this is by design and not a bug.

When using a 50Hz and selecting 1280x960 the GBS will automatically switch to 1280x1024, and vice versa.

Screenshot_2024-01-31_17-33-55

@lito69
Copy link

lito69 commented Jan 31, 2024

He encontrado un error: Cuando selecciono 1289x960 no está marcado en la interfaz web.

1280x960 sólo funcionará con 60Hz. Parece que estás usando una fuente de 50 Hz en tu vídeo, que sólo funcionará con 1280x1024. Creo que esto es por diseño y no un error.

Cuando utilice 50 Hz y seleccione 1280 x 960, el GBS cambiará automáticamente a 1280 x 1024 y viceversa.

Captura de pantalla_2024-01-31_17-33-55

ok, perfect

@TaHo82
Copy link

TaHo82 commented Feb 9, 2024

I recently switched to this version.
And I've noticed that all my profiles for the 50 Hz consoles only output a "squeezed" picture like 16:9.
The resolution is 1280x1024.
If I then set the resolution to 1920X1080 everything is back to 4:3 but I lose the Wifi connection to the GBS-C.

Am I the only one who has this problem?

@nyanpasu64
Copy link
Collaborator

Do you get different results here vs. older software versions? Are you applying profiles from the web UI (behavior inadvertently changed in this PR?) or the OLED menu (rewritten)?

@TaHo82
Copy link

TaHo82 commented Feb 9, 2024

In the old version, the aspect ratio was correct at a resolution of 1280x1024.
The profiles were created in the old version via the web UI and also worked.
It is possible that a value was changed by mistake, but I am not sure what can cause such behavior?
I have also tried to do a complete reset and create new profiles.
But unfortunately with the same result.
I will switch to an old software version when I get the chance and see if it works again.

@nyanpasu64
Copy link
Collaborator

Are you applying profiles from the web UI or the OLED menu?

@TaHo82
Copy link

TaHo82 commented Feb 9, 2024

I have tried both, with the same result.

@Metaln00b
Copy link
Contributor

I have tried both, with the same result.

Can you show us the output of the console? Use the serial console via USB. Maybe then we can see why the connection breaks off and maybe we can also see if something goes wrong when switching.

@ramapcsx2
Copy link
Owner

@YoImLee By design, yea. PAL sources have a higher line count than NTSC, so they get a different ideally matching line multiplier. It comes out to "by 1024" for PAL and "by 960" for NTSC. And yea, they're the recommended profiles for each format.

@Aleksandr-S12
Copy link

The new menu looks very good ! But still there is no better full-fledged OSD. I'm sorry, I'm not doing projects on (github), but I made OSD on STV 9426 separately. If someone wants to create such a mod or integrate it into the GBS control project, I can give the source code. This is the old version https://youtu.be/mX-OPXw0_Cs. Here is the new design
2024-02-17777777ttttttttt

@Aleksandr-S12
Copy link

Completed the OSD migration to the new GPS control firmware. Here you can download the source code + instructions
https://drive.google.com/file/d/1A3cEvOVxRw7vXp-hBSo_EXhc9TweQ5E0/view?usp=sharing
Screenshot 2024-02-22 03-13-07
Screenshot 2024-02-22 03-13-22

@nyanpasu64
Copy link
Collaborator

  • Does this require more chips beyond an unmodified GBS-C?
  • Please create a new issue (or pull request) to discuss OSD, or post in an existing issue like osd menu #521. It's best not to spam users who were discussing the OLED menu as opposed to an OSD.
  • I can't review the code now, but why didn't you publish it as a Git branch/commits rather than a source code archive?

@Aleksandr-S12
Copy link

Unfortunately, there is no time to learn how to work on github (.
I hope that someone will do it for me, so I posted the archive.
To control the OSD menu, you only need to connect the STV9426 chip.
You can buy STV9426 on Aliexpress

@ramapcsx2
Copy link
Owner

@Aleksandr-S12
Hey, your work is really cool, the right spirit! :)

Please understand that this project currently has no dedicated developer with enough time on their hands.
Your OSD is neat, but it requires extra chips and extra soldering effort, so quite a lot is involved on the hardware side, in addition to new software stuff.
So I think your OSD as it is is not a good fit, mainly because of the extra hardware... It is simply unlikely that people go out and buy the extra stuff, "only" to get an OSD.

Another thing: Have you checked out the TiVo OSD? It has some very rudimentary OSD functions in it.

@Aleksandr-S12
Copy link

You are doing a very good job!
Thanks to your GBS-C project, we can enjoy retro games on old consoles!

You're right! People do not need unnecessary difficulties with installing additional parts.
Unfortunately, in the TiVo OSD menu there is no way to replace the standard icons with your own, and there is also no way to set the text. I think it's pointless.

Have you tried working with the on-screen menu of the MTV 230?
I hope Google translator translate correctly!

@ramapcsx2
Copy link
Owner

Sorry for the offtopic here, nyan :)

Yea, I've checked out the MTV 230 also. It had some setup with the tiny analog switcher IC that is on the output of the TiVo.
I don't remember exactly, but I think there were problems with this setup, so I didn't work on it more.

The TiVo OSD is very restricted, yea. I guess nothing really fits the bill here :p
I think that adding extra chips should come with big benefits, so if instead of the STV9426, you could use another ESP (maybe ESP32?), that could have multiple other uses, making it more worthwhile.
But in this day and age, a whole extra chip just to get an OSD is kind of meh :p

@R2MGaming
Copy link

R2MGaming commented Feb 23, 2024

Completed the OSD migration to the new GPS control firmware. Here you can download the source code + instructions https://drive.google.com/file/d/1A3cEvOVxRw7vXp-hBSo_EXhc9TweQ5E0/view?usp=sharing Screenshot 2024-02-22 03-13-07 Screenshot 2024-02-22 03-13-22

You're getting a follow from me for this since you did this kind of stuff, for the GBSC project improvement. Maybe you could actually adopt the repo from Rama since you replaced the SMD chip (which I don't know which one it is on the GBS board) with the STV9426 chip to accept a universal remote for controls. If it's possible, you could find many other ways to improve on the GBS 8200 boards (including the HDMI variants) by adding in a composite and S-Video transcoder that could actually make composite and S-Video input crystal clear like the OSSC with a Koryuu transcoder, and IF there is an improved ASIC chip that is the same size as, and has the same pins as the original ASIC, or even better, an FPGA chip that is the same size as and has the surface mounted pins protruding out from all sides of the FPGA or have an FPGA to ASIC adapter made, THIS could actually improve a lot of features missing from or lost with the GBSC project like 16:9 1080p, and if something like this were to work (call me crazy), then perhaps it could also work with 4K with 4:3, 16:9, and 16:10 with aspect ratio switch buttons too. Plus IF certain adapters for certain chips were made to accommodate for the base ones on all GBS boards before adding mods, and if 4K 60 were to be possible along with a way to remove video noise, and random screen tearing or screen tearing static going from the bottom or top of the screen and vice versa without needing to add copper tape to anything on there, it would let me give the GBSC one last chance to use.

EDIT: I've actually learned that it's the ESP8266 doing all the work instead of the current GBS 8200 board chipset. Unless the 8266 got replaced with the 32, it probably could work better instead of the ESP8266.

EDIT 2: Since I am NOW giving the GBS Control one more chance for 1080p 16:9 before I save money for a PixelFX Morph 4K since it's cheaper than the RetroTINK 4K, I've found another workaround by going through my TV's hidden menu to change the overscan on the GBSC to make it all fit on all corners of my TV. I've also duplicated the same Capture Card source from my OBS software to also fit the borders of the device too.

@Nuck-TH
Copy link

Nuck-TH commented Feb 27, 2024

Please educate yourself about what FPGA is. You already been told to stop this topic, because it is absolutely not how it works.

@R2MGaming
Copy link

Please educate yourself about what FPGA is. You already been told to stop this topic, because it is absolutely not how it works.

It's Field Programmable Gate Array which you can re-program stuff about this, and I've already edited my comments saying that I found a workaround to this stuff so the FPGA thing is meaningless. At this moment, I'd rather find out if a device that CAN allow you to have a zoom function to calibrate the output's aspect ratio instead of using my TV to do this stuff exists or not.

@ramapcsx2
Copy link
Owner

Everyone is allowed to be a beginner, but this topic has derailed too much. I'm closing :)

Repository owner locked as off-topic and limited conversation to collaborators Feb 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet