c0pperdragon / Amiga-Digital-Video

Add a digital video port to vintage Amiga machines
299 stars 30 forks source link

Amiga Support 3 #8

Closed c0pperdragon closed 3 years ago

c0pperdragon commented 4 years ago

Continuation of https://github.com/c0pperdragon/Amiga-Digital-Video/issues/4

After collecting more data and the reports from @andriodious, everything started to make less and less sense. So I started to doubt my assumption about the meaning of the +ve and -ve options in the sample menu. I always thought that +ve would mean the rising edge of the pixel clock and -ve is the falling edge. As it turns out, this it is just the other way round. So I managed to provoke image jitter with one option I previously considered safe: Trailing -ve So everything I said in the previous post is exactly the same, but with "+ve" and "-ve" reversed.

Considering the matter, using +ve (which is in fact the "safe" option) should cause Denise and SuperDenise to have the same pixel alignment. This is my profile which fits perfectly on my 1280x1024 screen: AmigaLeadingEdge+ve.txt

Could you give this profile a try when you continue with your Amiga 500+ ?

c0pperdragon commented 4 years ago

I am not sure if I am doing something wrong but with the new kernal and the Auto@50Hz-60Hz resolution, both of monitors I have tested so far run at 60Hz (would also work with 50 without issue). The profile (Amiga 50Hz is activated) uses the Genlock Adjust -5% to +5% option With the "Unlimited" option, they show 50Hz without problem.

Or does the new kernal now prevent the Amiga 50Hz mode to be auto-selected in case that the EDID does not allow 50Hz? In this case it would be OK, I guess. And I would have to just set the genlock to unlimited in the 50Hz profile and to +-5% in the 60Hz profile.

c0pperdragon commented 4 years ago

But this can also not be true. The 60Hz profile has completely different offsets and would not work with the 50Hz input. So you see, that I am terribly confused now.

c0pperdragon commented 4 years ago

Oh my! This compatibility-hell was exactly the thing I deliberately avoided with the C64 Video Enhancement and only went for analog output...

IanSB commented 4 years ago

I am not sure if I am doing something wrong but with the new kernal and the Auto@50Hz-60Hz resolution, both of monitors I have tested so far run at 60Hz.

What make/model and resolution are they and are they DVI or HDMI?

Or does the new kernal now prevent the Amiga 50Hz mode to be auto-selected in case that the EDID does not allow 50Hz?

When any of the Auto resolution modes are selected, they override the Genlock Adjust -5% to +5% setting if the following conditions are met: (Text doesn't change)

Auto50Hz-60Hz - override if EDID allows 50Hz AutoForce50Hz-60Hz - override if source equal to or less than 60Hz AutoForce@Unlimited - override always

Oh my! This compatibility-hell was exactly the thing I deliberately avoided with the C64 Video Enhancement and only went for analog output...

Running monitors at 50Hz has always been a problem although it is better with more recent ones.

IanSB commented 4 years ago

There might be bugs in the EDID parser so here is a version that dumps the EDID data to the file "EDID.bin" in the root of the SD card on each bootup. Please post the EDID files from your monitors: kernelrpi.zip

c0pperdragon commented 4 years ago

These are the two files: EDID.zip

IanSB commented 4 years ago

They both only claim 55 or 56Hz minimum support and are quite old as they don't have any HDMI EIA/CEA-861 extension block to the EDID. I think that virtually all old DVI monitors except HP ones will fail the 50Hz test and all more modern HDMI ones will likely pass the test.

I have figured out how to set different config.txt defaults for simple and normal mode so I could set the default for simple mode to "AutoForce@50Hz-60Hz" if you would prefer that so it will always try 50Hz and you can use the link to fix any no output problems (i.e. same as before EDID detection).

Normal mode is keeping the default as "Auto@50Hz-60Hz" as that is more likely to always give an image on initial startup and then the menu can be used to set any desired output mode.

One thing you might want to check: One of the monitors I tested was also a Dell (2007FP) which didn't allow 50Hz support in the EDID although it worked at 50Hz when forced but it did an internal 50-60 conversion so smooth scrolling still juddered. Maybe check your Dell for the same thing?

Another idea might be to have a list of monitors known to work at 50Hz based on User feedback and if one of those is detected then "Auto@50Hz-60Hz" would ignore the EDID and use 50Hz anyway.

c0pperdragon commented 4 years ago

Both screens for which I sent you the EDID data run perfectly smooth with 50Hz. So using the EDID is pretty useless to decide on 50Hz. I am sure we dont' want to build and maintain a database for 50Hz compatibility.

All these considerations are becoming much too complex already. Maybe you could revert to a more simple overal solution: Previously the output resolution Default@60Hz worked nicely in conjunction with unlimited range genlock for all my monitors that were even somehow able to show 50Hz. This is for sure exactly the mode of operation everyone would like to use, except when the monitor does not work and the user has no other monitor. But in this case the whole upscaler solution is already completely missing the point. To still provide some sort of fallback in this already pretty useless scenario, the jumper link can be used to at least check if the board is working at all (no need to bother installing a button in this case).

I would suggest the jumper/button at startup should actually just disable any genlock completely for this session. This would give just the best behaviour. It would even allow a super-compatible 60Hz output on NTSC Amigas for any monitor that is so picky to not even tolerate the slight deviation in frame rate.

I think this would completely remove the need to have any special output modes besides the dedicated ones (resolution + framerate) and the one default@60hz. In the Amiga profiles there would be just genlock set to unlimited, which could be temporarily overriden by the button/jumper.

IanSB commented 4 years ago

Here is the latest test version: AmigaTest-v0-06.zip

This is a full set of files as several others have changed. Wipe the SD card and unzip.

Changes: There are still 3 new Resolution files but they have been renamed: Default@EDID - Selects 50Hz if EDID indicates it is OK (will likely fail 50Hz on most DVI and work on most HDMI monitors) Auto@50Hz-60Hz - Forces 50Hz if source is 50Hz otherwise 60Hz Auto@Unlimited - Output always tracks input frequency.

On first startup of a fresh install: Simple (Amiga) mode selects Auto@50Hz-60Hz as the resolution. CPLD mode selects Default@EDID as the resolution.

Fitting the link in Simple mode or holding down Menu during bootup forces 60Hz and reselects the above resolution combinations.

I think this covers what is needed: In simple mode you always get 50Hz to test without requiring the menu and if you get no output you fit the link. In CPLD mode you get a safer default output that is more likely to produce a display on first startup at the expense of sometimes getting 60Hz but it then allows the menu to be used for further experimentation.

I called the EDID mode "Default" rather than "Auto" to indicate that it shouldn't be relied upon to select 50Hz (although it will get it right a lot of the time).

EDIT: I also added a message at powerup to display the output resolution and refresh rate.

c0pperdragon commented 4 years ago

I have tested the fresh install, and everything works perfect. I really like the startup-message to show the resolution and frame rate. The message about recovery mode is also a very nice touch. So basically the Amiga solution is finished now. Will try to get reviews on some youtube channels. No luck yet...

I'm right in the process of soldering a bunch of adapter boards. To test the boards without the need to install them into the real Amiga (which would be difficult, because my Denise still has a broken leg), I rigged a test circtuit with an Arduino to generate test signals. The Arduino runs at 16MHz and creates an 8MHz pixel clock. By overclocking the Pi core to 450Mhz, this gives a stable picture. 430Mhz is just too little. So I also guess, the Atari ST should be no problem in this regard.

IanSB commented 4 years ago

There is a new full build of the software available: https://github.com/hoglet67/RGBtoHDMI/releases/tag/20201010_4c8ca86 Direct link: https://github.com/hoglet67/RGBtoHDMI/releases/download/20201010_4c8ca86/RGBtoHDMI_20201010_4c8ca86.zip

This is a release candidate for the next official version and has various additional changes from the above test version including a new log saver feature in the info menu which saves the serial port log to the SD card to aid in debugging any problems users might have.

There haven't been any specific changes to simple mode but can you do a clean install to check that everything still works OK.

c0pperdragon commented 4 years ago

I have tested this release (clean install on the SDcard) and everything I tried just works flawlessly: 1280x1024/1640x1050, 50Hz/60Hz, interlace/non-interlace in all possible combinations. The recovery mode also works fine.

Then I have updated the software download link in my repo to point to this prelease version. As I have already sent one adapter board to "Jan Beta" for review on his youtube channel we may get some user feedback in the future (depending on the outcome of this review, of course).

IanSB commented 3 years ago

There is another new build available here: https://github.com/hoglet67/RGBtoHDMI/releases/tag/20201113_0471da6 Direct link: https://github.com/hoglet67/RGBtoHDMI/releases/download/20201113_0471da6/RGBtoHDMI_20201113_0471da6.zip

The main change that will affect the Amiga is improved menus in interlaced mode. Previously they were a flickery mess, now capture is switched to progressive mode when the menus are on so you don't get any flicker but only 1 field is displayed under the menu so reduced vertical resolution. Interlaced capture is re-enabled when the menu is switched off.

Also there is a "Test monitor for 50Hz" option which is mainly for the normal CPLD version as that uses Default@EDID so it will default to 60Hz with many monitors and you can use this to check if the monitor works at 50Hz easily. Also the quick start guide and reference guide in the wiki have been updated to reflect all the recent changes.

Can you do a clean install to test and confirm it is OK with your board.