rsta2 / circle

A C++ bare metal environment for Raspberry Pi with USB (32 and 64 bit)
https://circle-rpi.readthedocs.io
GNU General Public License v3.0
1.81k stars 240 forks source link

Ability to set HDMI output refresh rate #454

Open pizzarollsroyce opened 2 months ago

pizzarollsroyce commented 2 months ago

I don't believe that Circle exposes a way to set the HDMI video output refresh rate to 50hz, which I'd like for a project I'm working on.

I tried looking for a mailbox register I could poke to do this, but I'm not able to find anything.

I'll note that if I boot into Raspbian, I can set it to 1280x720@50hz, so the hardware appears to support this.

rsta2 commented 2 months ago

The only way to set the HDMI mode with Circle are the firmware settings in config.txt:

https://elinux.org/RPi_config.txt#Video_mode_options

Unfortunately this does not work on the Raspberry Pi 5 and your wanted target mode is not listed and thus probably not supported by the firmware.

Raspberry Pi OS uses a kernel mode video driver now, not the firmware video support any more, and supports different options.

pizzarollsroyce commented 2 months ago

Ah, thanks for the detailed answer. Wish I had asked earlier.

I guess to allow a user to switch video modes, I'd need to use the SD card filesystem and update the config.txt file with that new configuration, then reboot (potentially after pulling down the EDID list to limit options to modes that the current monitor is compatible with)?

rsta2 commented 2 months ago

You are welcome. Yes, the method, you have described, should work.