-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Open pixel clock request #734
Comments
We want to achieve low resolutions such as 320x240 with a horizontal frequency of around 15.6kHz and vertical refresh rate of 60Hz. We want to be able to maintain those values with differing resolutions by specifying a custom pixel frequency which may reside outside of the 4.8, 6.4 or 9.6 range. |
Can you give an example of the settings you are trying that don't work? |
We can get close, but not close enough. This plays havoc with sychronsing the audio and video chips. If the horizontal frequency is out by a fraction, then it can lead to problems. 384 x 256 @ 55.017605 Hz Is the resolution and frequency for R-type. We can get close to this using the constraints of the locked Pi modeline. But achieving a match is not possible at the moment. |
99% perfect.pixel clock = 8.120000 384 408 448 520 256 261 264 284 |
Can you explain exactly how you are configuring this? Post complete config.txt settings (or whatever you are using to do this). |
The Pi can currently do |
vcgencmd hdmi_timings 506 1 8 44 52 264 1 6 10 6 0 0 0 60 0 9600000 1 |
Sorry, that results in a resolution of 506 x 264 at 55hz nowhere near to the native resolution, but a close frequency. So the game runs at close to the correct speed, but more time is being spent drawing lines that are not needed affecting the emulation. |
So are you saying |
No picture. The clock has to match 4.8, 6.4, or 9.6 exactly to display an image. If it does not match you get no picture. |
The perfect scenario would be to be able to produce any clock frequency between 4.8 and 9.6 and still get an image |
Arcade manufacturers used to tweak the pixel clocks to get odd resolutions out of the limited hardware of the time. As the pi only has 3 clock modes we can't run the games on arcade 15khz monitors as they should be. Is at all possible to unlock the pixel clock and allow us to create 'exotic' mode lines? We would be able to accurately reproduce native arcade resolutions. a program called SOFT15KHZ is used for certain graphics cards, that can produce these signals, but the clock must be able to accept values other than the 3 currently available on the pi. Is there at all a way to change this via a firmware update, or is it a hardware constraint? Perhaps a future model would be able to resolve this, if not a firmware change. |
The PLL supports abitrrary frequencies from 600MHz to 2.4GHz and the pixel clock is generated from this with an integer divisor. I'll try to have a closer look at the exact limits with clock divisors. |
Thank you for looking into this, looking forward to your response. |
Any joy with this @popcornmix :) |
Hi. I use this timings with GPIO2SCART on my rpi2. So 38.4Mhz pixel clock can be use. Usable Pixel clock are : I would like to know (as mamy people) if fixed pixel clock is a limit or not. |
As popcornmix said there is two source clock that could be used, hence a selection is made at some step and if only divisor is possible then frequency above 19,2 MHz could only be generated with the PLL which looks more versatile anyway on higher frequency. |
@Sir-Ironic so, you are attempting to get the same results as us. 15hz signals via the GPIO. Does the horizontal resolution not matter when producing the mode line? What rules do you follow for producing accurate vertical refresh rates, and how close can you get? |
@Sir-Ironic so, you are attempting to get the same results as us. 15hz signals via the GPIO. Dear es the horizontal resolution not matter when producing the mode line? What rules do you follow for producing accurate vertical refresh rates, and how close can you get? |
I use Custom Resolution Utility (CRU) to produce HDMI Timings. The Detailed Resolution fonction (Edit). Honrizontal resolution is high (1920 with a viewport of 1848), we can't see difference bitween this resolution and native resolution. For Vertical resolution. Actually i can produce 224p (visible area) at 60Hz. I know, a lot of arcade games use differents refresh rate. With another Timings in 240p, i can only see 230 lignes, there's 10 lines overscaned. I know, i must find all Timings for all resolutions but it's a hard work with pixel clock limit. ** 60Hz Timings ** ** 50Hz Timings ** Up to 256p ** 55Hz Timings ** Up to 256p ** Amiga ** |
Tell me if i'm wrong. I use this Timings on my CRT for Bad Dudes vs Dragonninja (256x240x57.41Hz) : I get this : And on the TV : I carefully look at scrolling, it is perfect. no tear/lag, pause every 1 second. The game is synchro to 57.41Hz so the screen too? |
@Sir-Ironic There is a bit of an effort to get lots of arcade resolution mode lines for various emulators on the Pi. Feel free to share your findings, and I'm sure we can help each other out. Jump on the Pi2Jamma group on facebook :) |
According to spec PLLH must be between 600MHz and 2400MHz (but we support up to 3000MHz when overclocking) But I think there is something intermittent going wrong.
So, here you can see we set the pixel clock to 74.25MHz for 720p and then set the pixel clock to 4MHz successfully. The 4MHz will be using the PLL (as it's not an integer divisor of 19.2MHz osc). But during my testing I sometimes get in a state where |
1up for your information! |
I'm not sure if I'm seeing the same issue as you but there seems to be a bug when choosing a frequency that is an integer divisor of the oscillator.
i.e. 19.21MHz initially worked But so far if I don't use a frequency that is an integer divisor of the oscillator it seems to behave correctly. But that doesn't seem to match the bug reported. |
Not getting an image when I tried the mode lines above. |
So, you are saying that it should be able to use these frequencies, but the bug is preventing it from switching? |
I don't know. Please report output of
After a working and non-working change of pixel clock frequency. |
I'm trying to get a 25Mhz pclk using the DPI to push an old mono gas plasma at 640x400. I've got a logic analyzer that I've been switching between the original equipment's output and the pi's output. Here's what I've got for hdmi_timings-
With either the stock firmware or the testing firmware listed earlier in this thread, the first hdmi_timings Shouldn't I be watching the 'vcgencmd measure_clock dpi' instead of pixel? Pixel is showing 0 even though pclk is ticking right along with the first hdmi_timings line. for src in arm core h264 isp v3d uart pwm emmc pixel vec hdmi dpi ; do echo -e "$src:\t$(vcgencmd measure_clock $src)" ; done |
@erixswanson Do you have a link to pictures of that gas plasma? Would love to see that! |
It's a Toshiba T5200. '92ish 386 clamshell luggable. Figured it could do with an upgrade :) Absolutely no specs/datasheet/anything on the display. Capable of 640x480, but boots into text mode of 640x400. Drove me nuts trying to figure out why vsync was coming 80 lines early. |
@popcornmix Can we expect any improvement soon regarding this old constraint? I've been searching and found references from years ago like this one: https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=112735 |
@popcornmix same here. Can we find out if it is at all possible to alter the firmware to allow more flexible timing. I hear someone may have produced a custom firmware that is capable of this, but they are not for letting the cat out of the bag. |
@popcornmix this issue is the keystone to reaching the _ almost perfect_ arcade/console emulation on CRT as we would match original hardware timings very closely, even surpassing what PCs can do. Can we expect some good news ? |
@popcornmix any news on this yet? |
Does the firmware provided by @popcornmix needs further testing, or can we assume that more tweaks are needed before doing so ? |
I do think more can be done. I don't have the ability to test, as I cannot remote in to my Pi. Looking into this with Broadcom the chip is capable of having an open clock. We just need someone who can alter the firmware and test as they make changes. I'm hoping the Pi4 will opt for an open pixel clock. Who do we push to see if this can be done with the next hardware, if not with this hardware? |
Well, there's already millions of existing units wich are presumably able to handle a wide range of pixel clock, i think pushing the research a little further would not be a waste of time. With all respect due : would a bounty on BountySource help ? |
Go for it! I would spread the work as much as possible. And put in! |
@popcornmix Any further thoughts on this? (Note to other posters, popcornmix v. busy at the moment, so holding breath not recommended!) |
Any movement on this? Do we know if it is a hardware issue. It looks like we came very close to getting it to work. @popcornmix ? |
I'm also very interested in this being solved. I need a pixelclock of 15.36 Mhz. Is there some workaround for now? |
Been having a look at this issue. Just been trying various pixel clocks with a 720x480p HDMI setup. I can reduce the clock to 5.750MHz without any problems (using an HDMI analyser to check the output clock, and also vcgencmd measure_clock pixel which matches). So its appears that you can produce lower pixel clock values for HDMI. So what exactly is the issue people are seeing? Is it only on DPI displays? Is it still there, as there may have been firmware changes that have affected this. |
@JamesH65 It does seem to still be an issue on DPI specifically, with the latest firmware.
I booted this Pi with these config.txt parameters:
to enable output to a TV with SCART, via the VGA666 and then this UMSA adapter to convert the VGA signal into SCART. The Linux console is visible on the TV in 320x240 resolution. Note that the pixel clock is 6.4MHz, an integer divisor of 19.2MHz. When I switch to a similar 224p mode with a 6.7MHz pixel clock (taken from here), no signal is displayed on the TV:
Then I switched back to the original mode with 6.4MHz pixel clock:
The same blank screen / "No Signal" message on the TV is encountered when booting with the 6.7MHz mode, I would also note that the limitation, that only integer divisors of 19.2MHz pixel clock work for low resolution DPI modes, is not present in the open source KMS display driver. It can set and display low resolution modes with various pixel clocks. Interlaced modes also work with a kernel patch, see raspberrypi/linux#2668 (comment) for details of this. Another bit of info that might be of interest: I have noticed that using modes with integer divisors of 19.2MHz pixel clock produce a better picture with the open source KMS display driver. Other pixel clocks below 19.2MHz tend to result in some pixel wavering / jittering on the screen, as if pixels are jittering left and right by 0.5px. Modes with pixel clocks of 6.4 and 9.6MHz are stable in comparison. |
I'm using a 320x240 DPI screen connected to a Compute Module 3 (via a Circuit Sword PCB) and I'm struggling to get it to give me a 60Hz or 50Hz output for smooth emulator VSync. Using this line in the config.txt:
I get a display that's about 90Hz according to FPS counters in VSync'd applications. Using the formula for the pixel clock (320 * 240 * 60 = 4608000) I get no display. Is that part of what this issue ticket is about? I had a brief look into using the KMS driver which sounds promising from your comments, but can't find out any info on how I might use it to drive my DPI display, or whether it's even possible - would I have to write a custom device tree overlay for my LCD? Any brief hints on how I might get started with this? Thanks! |
@dwhinham The KMS driver would definitely need some kind of custom DT overlay to describe the DPI to panel hardware connection, and the type of panel. If you're using a DPI panel with a single fixed mode / fixed timings, you could check in https://github.com/raspberrypi/linux/blob/rpi-4.19.y/drivers/gpu/drm/panel/panel-simple.c to see if your model of DPI panel is already supported and has display mode timings in there. If it is, all you need is the custom overlay mentioned below. If the panel isn't already supported, you can add a static Then add a DT overlay like this one: https://github.com/raspberrypi/linux/blob/rpi-4.19.y/arch/arm/boot/dts/overlays/vc4-kms-kippah-7inch-overlay.dts but with your specific "compatible" string in place of |
@sigmaris That's extremely helpful, thankyou for the quick response - I'll give it a shot! Presumably I would remove all the hdmi/dpi parameters from config.txt - would I also remove the dpi18 overlay that I'm currently using? Thanks again! |
Yes, actually AFAIK those parameters like
I think so - this part I am less sure about, but the function of dpi18-overlay.dts seems to be to switch GPIOs 0-21 into ALT2 mode to use them for DPI, and with the vc4-kms-kippah-7inch-overlay.dts overlay that's instead accomplished by the |
BIG BIG NEWS!!! Amazing news for the arcade and console preservation community! |
My tests indicate that this is not solved. I have a script in place that translates linux modelines (that I generate with switchres) to This is after I did |
in the youtube link he speak about a raspberry pi4.. @kamicane do u test it on pi4? |
Sorry, yes. This has been fixed on the Pi4 the clock limitations have been confirmed to be at a hardware level. With the implementation of the new Broadcom chip that supports 4K they have made the pixel clock more flexible. The only option is to upgrade sadly. |
Ah, sorry, didn't notice that small detail. My testing were on the pi3. |
Is there any way of having an open pixel clock setting without restrictions when setting frequencies via mode lines.
There is an active project using the Gert666 display driver via GPIO to recreate native arcade resolutions at 15khz, but the current firmware does not allow for exact frequencies. If there a way to make the raspberry Pi more flexible on this?
The text was updated successfully, but these errors were encountered: