composite video without moving color artifacts

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Sorgelig, Moderator Team

antoniovillena
Atari User
Atari User
Posts: 42
Joined: Mon Oct 24, 2016 9:11 pm

composite video without moving color artifacts

Postby antoniovillena » Fri Oct 11, 2019 12:02 pm

I actually sell a vga->composite/svideo adapter. With svideo there is no problem but with composite there are moving color artifacts. The only solution to avoid these moving artifacts is generating the color carrier clock by the FPGA, and send through VSYNC signal. There is no conflict with VGA->Scart cables because they use HSYNC, but it's not a bad idea disable this by menu in case people want to use VGA->Scart cables where HSYNC and VSYNC are mixed.

Here are the schematics. If someone can help I can help as tester or send a prototype.
You do not have the required permissions to view the files attached to this post.

JamesF
Captain Atari
Captain Atari
Posts: 155
Joined: Sat Dec 15, 2018 6:46 am

Re: composite video without moving color artifacts

Postby JamesF » Fri Oct 11, 2019 12:08 pm

I have this device from Antonio, and I can vouch that it looks great.
The ADV724 is probably the best modern RGB->Video encoder, very useful for people who want to use the MiSTer with a CRT that does not have RGB or YPbPr inputs, for authentic console experience.
Or even to build an arcade cabinet with MiSTer with S-Video/Composite inputs on the CRT monitor.

Thank you for publishing the schematic Antonio, so maybe Sorgelig can make an official open source "Analog Video Board".
Yes, instead of crystal oscillators, mister can provide the accurate clock on the VSync line for best results with the ADV724 since CSync is on Hsync line, and VSync line is not used on practically anything except PC CRT monitors.

According to the ADV724 datasheet (link), Synchronous Operation is best for clearest picture possible, because the generated Chroma burst is synchronized with CSync from MiSTer.
That's why the request to allow the option for 3.58MHz (NTSC) or 4.43MHz (PAL) clock on the VSync pin directly from MiSTer, instead of external oscillators.

antoniovillena
Atari User
Atari User
Posts: 42
Joined: Mon Oct 24, 2016 9:11 pm

Re: composite video without moving color artifacts

Postby antoniovillena » Fri Oct 11, 2019 1:52 pm

McLeod wrote a module for ZX-Uno to generate thes PAL and NTSC signals from a 140MHz clock input. Maybe it can be adapted this module to MiSTer.

Code: Select all

module pal_clock (
  input wire clk,  // 140 MHz
  input wire pal_ntsc, // 0: 17.734475 MHz , 1: 14.31818 MHz
  output wire out
  );
 
  reg [28:0] cnt = 29'h00000000;
  reg [28:0] nxt_cnt;
  assign out = cnt[28];
  always @(posedge clk)
    cnt <= nxt_cnt;

  reg [1:0] mode = 2'b00;
  always @(posedge clk)
    mode <= {mode[0], pal_ntsc};
   
  always @* begin 
    case (mode[1])  // esto debe ser full parallel case
      1'b0: nxt_cnt = cnt + 29'd68008027;
      1'b1: nxt_cnt = cnt + 29'd54907245;
    endcase
  end
  // Fout = 140 * pal_ntsc_value / (2^29)
endmodule

JamesF
Captain Atari
Captain Atari
Posts: 155
Joined: Sat Dec 15, 2018 6:46 am

Re: composite video without moving color artifacts

Postby JamesF » Fri Oct 11, 2019 2:30 pm

Another thing to mention is this will not work with the VGA dongle with direct_video, since there is no way to pass the "Clock on Vsync" through this adapter.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5393
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: composite video without moving color artifacts

Postby Sorgelig » Fri Oct 11, 2019 4:58 pm

RGB/YPbPr is enough for MiSTer from my point of view.
In 2019 it's hard to imagine TV having neither HDMI nor RGB nor Component input.
Also i don't understand the issue.. Why FPGA can provide correct clock while XTal cannot? May be you just need to add variable capacitor to tune the xtal clock?

antoniovillena
Atari User
Atari User
Posts: 42
Joined: Mon Oct 24, 2016 9:11 pm

Re: composite video without moving color artifacts

Postby antoniovillena » Fri Oct 11, 2019 5:57 pm

I've talked with you and I understand your point. The thread is opened if someone can create a test core. The tuning capacitor doesn't work. It only makes the moving slower. The only solution is clock generated by the FPGA.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5393
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: composite video without moving color artifacts

Postby Sorgelig » Fri Oct 11, 2019 11:00 pm

The code you posted above has no any sync with pixel clock. So it's just generic clock generator like xtal.
I know you don't like capacitors ;) but for me it looks like noise on VCC may produce colour problems. By moving clock generator to FPGA you simply isolate the generator and AD724 from each other and eliminate the noise. I would say it's quite expensive isolation.
May be try integrated clock generators instead of bare xtal?

AD724 supports also 1x and 4x clocks. You use 4x. Try 1x may be?

JamesF
Captain Atari
Captain Atari
Posts: 155
Joined: Sat Dec 15, 2018 6:46 am

Re: composite video without moving color artifacts

Postby JamesF » Sat Oct 12, 2019 7:18 am

Sorgelig wrote:The code you posted above has no any sync with pixel clock.

Unlike external crystal, fpga generated clock doesn't change phase in relation to CSync.
Thus the artifacts do not move/crawl,, that's the reason for this request.

Big reason for ownning a IO board (and MiSTer in general) is the VGA port for old CRT TVs.
Please don't underestimate the importance of analog video signal, be it RGB, YPbPr, S-Video or Composite. :)

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5393
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: composite video without moving color artifacts

Postby Sorgelig » Sat Oct 12, 2019 1:41 pm

JamesF wrote:Please don't underestimate the importance of analog video signal, be it RGB, YPbPr, S-Video or Composite.

I was adding RGB input to my TV when i was in school. This is not impossible. Especially these TVs today aren't used for TV watching, so the whole radio part can be disconnected. Not a problem to find the ppl who will add RGB input if cannot do it yourself.
But if you like masochism then old composite TV with different kind of distortions should be well welcomed :)

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5393
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: composite video without moving color artifacts

Postby Sorgelig » Sat Oct 12, 2019 1:46 pm

JamesF wrote:Thus the artifacts do not move/crawl,, that's the reason for this request.

just for pure theoretical talk (as i'm not going to do it): the master clock for color carrier frequency must come from the same PLL where core generates the video clock. It's not in framework. And different cores use different clocks. In other words, framework will require a special clock from the core to generate the colour clock. You can't use any system PLL from framework as they are not locked to video clock and you will get the same crawling artefacts.


Return to “MiSTer”

Who is online

Users browsing this forum: arit, phillymost, Vicosku and 6 guests