VOGONS


Reply 20 of 212, by Benedikt

User metadata
Rank Oldbie
Rank
Oldbie
Tronix wrote on 2020-06-25, 16:12:

The idea is not new. The main problem is that Saleae Socket API does not allow to receive a continuous stream of data. But..
There is a very similar project using a fx2lp microcontroller Cypress CY7C68013A on demoboard LCSOFT CY7C68013A (like Chinese-clone Saleae 8 ch): https://github.com/y-salnikov/vcaptfx2 He replaces the firmware in the microcotnorler with his own (slightly modified fx2lafw version from sigrok project) and has Windows and Linux-based client for display captured image. It’s not really for CGA but very similar video output from Soviet home computers like БК0010-01 and ZX Spectrum clones. Pictures and hardware descriptions there: http://y-salnikov.github.io/vcaptfx2/

The problem here is that the author maneuvers his way around clock recovery by tapping into the original pixel clock signal.
While we can do that, as well, it is not the most practical approach.

One possible approach to the clock recovery problem would go like this:

  1. pre-select, guess or roughly measure the type of sync-frame found in the video signal
  2. guess the most likely pixel clock
  3. synthesize a facsimile sync-frame based on these parameters
  4. cross-correlate it to the sync-frame from the captured signal to measure the phase offset between pixel clock and sample clock
  5. resample the captured signal using the now fully recovered pixel clock and next-neighbor interpolation (for this should now keep exactly the right pixels)
Predator99 wrote on 2020-06-25, 18:29:

Thanks for the links, didnt find this. Was surprised nobody tried before. Will try to install this, but I dont think it runs with CGA out of the box.

As mentioned above, I believe that he taps into the pixel clock signal.
I, personally, wanted to do this kind of thing with clock recovery a year or two ago, but I did not get past the concept stage.

Reply 21 of 212, by Predator99

User metadata
Rank l33t
Rank
l33t

Just made another test picture (640 pixels per line) to further analyse the jaggies. A white line is drawn every 5 pixels. In the screenshot of Saleae you see the channels I used. On the top is the 15.7 khz HSYNC. The other channels are RGB and should be identical as its a white line. Only 1 line is shown.

lines5s.jpg
Filename
lines5s.jpg
File size
89.95 KiB
Views
1043 views
File license
Fair use/fair dealing exception

Below you see what my program makes out of it. I take the end of the HSYNC as base (when it goes from 1 to 0). Then a single line is drawn using all data captured - because of this you see more than 640 pixels. And this causes the jaggies as not every bit captured is assigned to the same pixel on each line.
All 3 RBG channels are put together to determine the color. Then it detects when HSYNC goes to 1 again and the next line is drawn...before this aonther pixel is drawn to mark the end of the line.

The output is scaled*3 using Irfanview. There is a clear pattern in it. You also see that the lines have differnt lenghts. I think it will be possible to eliminate this with some calculations based on the length...

lines55b.jpg
Filename
lines55b.jpg
File size
540.07 KiB
Views
1042 views
File license
Fair use/fair dealing exception

Reply 22 of 212, by BloodyCactus

User metadata
Rank Oldbie
Rank
Oldbie
Predator99 wrote on 2020-06-22, 21:48:

I recently bought this China (6€!) logic analyzer. It can capture signals with 24 MHz on 8 channels! Software available for free here:
https://www.saleae.com/de/downloads/

so I'ma be that guy and say how unethical it is, that Saleae did the R&D to make their products and invest in their software, not ideally for cheap chinese clones to use it.

but whatever.

sigrok is free.

--/\-[ Stu : Bloody Cactus :: [ https://bloodycactus.com :: http://kråketær.com ]-/\--

Reply 23 of 212, by pentiumspeed

User metadata
Rank l33t
Rank
l33t

Still noisy, once you get clear pulses without artifacts in each pulse (zoomed in) then you are golden. That requires better logic analyzer, that 6 buck thing will not cut it.

Cheers,

Great Northern aka Canada.

Reply 24 of 212, by Deksor

User metadata
Rank l33t
Rank
l33t

My god ! this is absolutely brilliant !
I can't wait to see what you folks can do 😀

Trying to identify old hardware ? Visit The retro web - Project's thread The Retro Web project - a stason.org/TH99 alternative

Reply 25 of 212, by Predator99

User metadata
Rank l33t
Rank
l33t
BloodyCactus wrote on 2020-06-25, 21:13:

so I'ma be that guy and say how unethical it is, that Saleae did the R&D to make their products and invest in their software, not ideally for cheap chinese clones to use it.

but whatever.

sigrok is free.

I agree to that. I was not aware of the situation as I ordered the device.

pentiumspeed wrote on 2020-06-25, 22:21:

Still noisy, once you get clear pulses without artifacts in each pulse (zoomed in) then you are golden. That requires better logic analyzer, that 6 buck thing will not cut it.

Cheers,

Sure its still noisy, currently there is no picture improvement implemented at all. Look how BreakPoint started and how he ended...
EGA/CGA capture with High-Speed Digital I/O Card

Reply 26 of 212, by Benedikt

User metadata
Rank Oldbie
Rank
Oldbie
pentiumspeed wrote on 2020-06-25, 22:21:

Still noisy, once you get clear pulses without artifacts in each pulse (zoomed in) then you are golden. That requires better logic analyzer, that 6 buck thing will not cut it.

Cheers,

I have to disagree. The sample rate is fully sufficient. The issue here is clock recovery or rather the lack thereof.
The technique that I outlined a couple of posts back (i.e. phase offset determination via cross-correlation of measured and synthesized sync-frame) should result in a clean reconstructed signal.

Reply 27 of 212, by Predator99

User metadata
Rank l33t
Rank
l33t

As already mentioned, at a resolution of 640x200 you get 1066+-1 bits per line, each with RGB colors.

In my test pattern posted above, I have drawn a row every 5 pixels. So there is one row at Position 0,5,10,15,....630,635,640.

I have now checked, for which rows all bits are the same, also for each color. In other words: When only drawing these rows there is no distortion at all and the picture is perfect.

Thats the list of bits I get:

0 (thats the row at pixel 0)
8 (thats the row at pixel 5)
25 (thats the row at pixel 15)
33 (thats the row at pixel 20)
42
50
67
75
92
109
117
134
142
159
176
184
201
218
226
243
251
260
285
293
310
327
335
352
377
394
402
419
436
444
461
469
478
486
503
511
528
545
553
570
578
595
612
620
654
662
679
687
696
704
721
729
746
754
763
771
788
796
813
830
838
855
872
880
897
905
914
922
939
947
964
972
981
989
1006
1014
1031
1048 (thats the row at pixel 630)
1056 (thats the row at pixel 635)

The are 83 entries. In total the test picture has 640/5=128 rows. Thats a very good rate!

Assumed I repeat this with other test pictures (as the one I made covers only every 5th pixel) and keep the same rate I would get 83*5=415 (of 640) rows where I get a perfect picture without any distoration. Only for the remaining ones I need a calculation.

On below screenshot only the above mentioned rows are drawn on the top part...no noise 😉 On the bottom part the original image

linestr.jpg
Filename
linestr.jpg
File size
179.12 KiB
Views
984 views
File license
Fair use/fair dealing exception

Reply 28 of 212, by Predator99

User metadata
Rank l33t
Rank
l33t
pentiumspeed wrote on 2020-06-25, 22:21:

Still noisy, once you get clear pulses without artifacts in each pulse (zoomed in) then you are golden. That requires better logic analyzer, that 6 buck thing will not cut it.

Cheers,

:-p :-p :-p

Solved all problems for 320x200. Dont care about the colors, maybe I exchanged the RGB cables. Not important, will work with 16 color EGA the same way.

rd.jpg
Filename
rd.jpg
File size
98.69 KiB
Views
977 views
File license
Fair use/fair dealing exception
sq3.jpg
Filename
sq3.jpg
File size
161.95 KiB
Views
977 views
File license
Fair use/fair dealing exception
sq32.jpg
Filename
sq32.jpg
File size
191.84 KiB
Views
977 views
File license
Fair use/fair dealing exception
jb1.jpg
Filename
jb1.jpg
File size
114.46 KiB
Views
977 views
File license
Fair use/fair dealing exception
jb2.jpg
Filename
jb2.jpg
File size
106.79 KiB
Views
977 views
File license
Fair use/fair dealing exception

Reply 30 of 212, by Predator99

User metadata
Rank l33t
Rank
l33t

Fixed the colors but doesent look much better...thats CGA.

Picture quality is perfect.

Will now show the same for 640x200 before switching to a EGA card. CGA is very convenient as I can connect my LCD via Cinch and the logic analyser at the same time...

jb2c.jpg
Filename
jb2c.jpg
File size
112.33 KiB
Views
965 views
File license
Fair use/fair dealing exception
cgacol.jpg
Filename
cgacol.jpg
File size
68.53 KiB
Views
965 views
File license
Fair use/fair dealing exception

Reply 31 of 212, by BreakPoint

User metadata
Rank Member
Rank
Member
Predator99 wrote on 2020-06-26, 22:49:

Solved all problems for 320x200. Dont care about the colors, maybe I exchanged the RGB cables. Not important, will work with 16 color EGA the same way.

Looks really great! Great job!
How you get rid of jitter?

My CPU collection - Looking for hardware in Ukraine - Ukraine vintage PC forum

Reply 32 of 212, by Predator99

User metadata
Rank l33t
Rank
l33t

Thanks! 😀

At 320 resolution this was very easy. Again I captured my test pattern with a row on every 2nd pixel. Therefore there should be a row at pixels
0,2,4,...,318 and nothing at 319

Then I inspected the CSV with excel. I selected the data of 3 random lines, starting with HSYNC going to 1, put them in rows and took a look where the 1st and the last pixel is:

HSYNC start at offset 0
HSYNC ends at offset 106/107
The 1st pixel is at offset 305.
The last pixel, corresponding to row 318, is at offset 1371.

All values in between are simple interpolation . So the code looks like...

IF x = 305 + 0 THEN PSET (0, y), color1
IF x = 305 + 8 THEN PSET (1, y), color1
IF x = 305 + 25 THEN PSET (2, y), color1
IF x = 305 + 33 THEN PSET (3, y), color1
....

All other bits are simply ignored. I checked with test patterns if all pixels are displayed..yes they are 😀

Last edited by Predator99 on 2020-06-27, 11:04. Edited 1 time in total.

Reply 34 of 212, by pentiumspeed

User metadata
Rank l33t
Rank
l33t

Much better. 😀 Understand why the need for *active* conversion is very tricky these days?

I was thinking about active converter so you can game in CGA and EGA output via a well designed up-converter box driving the LCD or OLED monitor without needing a old monitor instead of static picture.

Quality thing about video conversion made me say off-topic:
Off topic, I was thinking about this closer to my personal search finally found:
Took me long search for good up converter years ago to play DVDs on 1080p TV *with* true tele-capation font style and found a player that can do it. And very beautiful what set this apart from other players is the DVD player inserts telecaption style text into upconverted 1080p resolution and outputs as whole via HDMI.

Had this like this:

https://www.ebay.com/itm/TeleCaption-II-Close … 6-/401790953006

This is easy to read text this example:

https://www.youtube.com/watch?v=6SL6zs2bDks&vl=en

Many disc players violates from this standard and is very hard to read and commonly no way to adjust to background to black, with white text on bluray players. Worst is transparent background with text right on the picture.

Back to topic, keep at it. 😀

Cheers,

Great Northern aka Canada.

Reply 35 of 212, by Predator99

User metadata
Rank l33t
Rank
l33t

EGA implemented. Only added the color, everything else worked the same as with the CGA-card. Looks fantastic.

Hope BreakPoint can get this running in real time....

Somebody else likes to try the program..?

pop1.jpg
Filename
pop1.jpg
File size
197.79 KiB
Views
970 views
File license
Fair use/fair dealing exception
pop2.jpg
Filename
pop2.jpg
File size
173 KiB
Views
970 views
File license
Fair use/fair dealing exception
sq3e.jpg
Filename
sq3e.jpg
File size
167.04 KiB
Views
970 views
File license
Fair use/fair dealing exception
zak1.jpg
Filename
zak1.jpg
File size
104.61 KiB
Views
970 views
File license
Fair use/fair dealing exception
zak2.jpg
Filename
zak2.jpg
File size
82.74 KiB
Views
970 views
File license
Fair use/fair dealing exception

Reply 36 of 212, by Predator99

User metadata
Rank l33t
Rank
l33t

No comment? 🙁 For me above EGA pictures are outstanding. Remember: Cost 6€ incl. shipment from China, no soldering required for connecting.

It seems indeed not to be easy to remove the jitter from a 640x350 picture..below is unfiltered and resized. Looks quite OK and if you use it only for starting games..so what.

EGA640-BIOS.jpg
Filename
EGA640-BIOS.jpg
File size
146.75 KiB
Views
932 views
File license
Fair use/fair dealing exception

Reagrdless, this was the 1st time I had the opportunity to test one of my HGC Hercules cards. This is from one with aTD3088A. Works in my SS7 board together with VGA without problems. I used a sample frequency of 16 MHz for this as the HGC also runs a dot clock of 16 MHz. Pictures are uncorrected too, only some very minor errors.

HGC-DOS.jpg
Filename
HGC-DOS.jpg
File size
81.36 KiB
Views
940 views
File license
Fair use/fair dealing exception
HGC-QB.jpg
Filename
HGC-QB.jpg
File size
82.22 KiB
Views
940 views
File license
Fair use/fair dealing exception
HGC-SQ31.jpg
Filename
HGC-SQ31.jpg
File size
142.08 KiB
Views
940 views
File license
Fair use/fair dealing exception
HGC-SQ32.jpg
Filename
HGC-SQ32.jpg
File size
136.28 KiB
Views
940 views
File license
Fair use/fair dealing exception
Last edited by Predator99 on 2020-06-29, 21:26. Edited 1 time in total.

Reply 39 of 212, by Deksor

User metadata
Rank l33t
Rank
l33t

This ... is ... AWESOME.

Do you think some treatment could be done to have "Sharp composite artifacting" by just interpreting two nearby pixels as just one larger one in a specific color ? This would help europeans/people with no IBM CGA card to watch CGA in 16 colors without having to invest too much money and even take "screenshots" of it 😀

Trying to identify old hardware ? Visit The retro web - Project's thread The Retro Web project - a stason.org/TH99 alternative