All-in-one component video solution

Discussion in 'Sega Dreamcast Development and Research' started by Samson, Nov 19, 2011.

  1. Samson

    Samson Active Member

    Joined:
    Nov 18, 2011
    Messages:
    37
    Likes Received:
    0
    I'm thinking about a new component solution. I did my homework, and the common (useful) response is to use a VGA box and a VGA-to-Component box.
    I could use that and be done with it, but I want a compact solution that doesn't add yet another power adapter to my equipment. And I don't need the upscaling you sometimes get.
    So this is the well known VGA box circuit to switch on VGA mode:
    http://www.mmmonkey.co.uk/console/sega/dc-vga.htm
    And I found this circuit to convert RGB into YCbCr colourspace and add a component sync:
    http://www.keohi.com/keohihdtv/interfaces/diytranscoder_johrhees.html
    Again, I could just put them together and see how they work, but I'd like the best and minimum version.
    So I assume people here have all built their own VGA box and did some experimenting, so I hope someone can answer my questions. Or at least probe some lines with an oscilloscope.
    1) Does RGB select actually switch the DAC between RGB and Chroma/Luma/Composite mode? Yes Does the SCART cable pull this permanently low?
    2) Does VGA select switch off composite sync, or is H/V sync disabled without the VGA switch?No Or is it only used to signal the software that a VGA box is connected and 480p can be safely displayed?
    3) If C-Sync (pin 10) is always available, can it be directly added to the component output, so I can throw away all the gubbins that merge H and V sync? Does anyone have docs how component expects the sync?
    4) If Luma (pin 12) is always available, can it be used directly for component Y? The math for both is the same ( Y' = 0.2126 R' + 0.7152 G' + 0.0722 B' ), though I can't find anything on the sync signal. Luma is not available
    5) Does anyone know of good integrated circuits to do the RGB-YCbCr colourspace conversion, so I won't need a forest of resistors and op-amps? Or for the H/V to Composite sync merge? Or a good all-in-one solution?
    6) If the VGA select switches between C-sync (pin 10) and H/V-sync (pin 8+9), is there a good way to use either as a sync source, so you can display both 480i and 480p with the same cable?C-Sync is available in both modes
    Thanks!
    Update: Luma is not available. Thanks!
    Update: C-Sync. Thanks!
     
    Last edited: Nov 20, 2011
  2. TmEE

    TmEE Peppy Member

    Joined:
    Aug 13, 2008
    Messages:
    362
    Likes Received:
    1
    Luma is not available with Chroma and Composhit when RGB is enabled, this means both RGB SCART and VGA so you cannot use them for the transcoder.
    H, V and Csync are only available in RGB mode too, nothing happens in composhit/s-video mode.
     
  3. APE

    APE Site Supporter 2015

    Joined:
    Dec 5, 2005
    Messages:
    6,417
    Likes Received:
    141
    And what is so wrong with using VGA? Personally I'd rather see work put into making a quality HDMI transcoder given component isn't really worth it.
     
  4. Samson

    Samson Active Member

    Joined:
    Nov 18, 2011
    Messages:
    37
    Likes Received:
    0
    Nothing is wrong with VGA, though I'd like component for my TV.
    Has anyone cracked one of those scart-to-hdmi boxes open to see which chip does the encoding? And has anyone seen one where you can switch off upscaling? I guess a simple solution would be to put the VGA box logic directly inside, and get it powered from the dreamcast (if it doesn't draw too much current).
    I thought about how to do it for N64, because the data format between display controller and DAC was decoded. So you could write an FPGA design that pretends to be an N64 DAC and generates a DVI or HDMI signal in turn. Though development boards for FPGA with DVI or HDMI out are too expensive IMHO for a pet project.
    The GC's digital out is decoded as well, and AFAIK the Wii contains the chip from the component cable internally.
    If the DAC on Dreamcast is a separate chip and someone works out the interface you could try it, if it is integrated into the display controller it will not be possible.

    Back to the original problem, I found this on an Amiga board:
    http://eab.abime.net/showpost.php?p=635282&postcount=13
    I haven't compared the circuit in detail, but it seems to use the same idea. I guess it depends on if C-Sync is active and compatible in VGA mode.
    Or this one for just the colour space conversion:
    http://eab.abime.net/showpost.php?p=667843&postcount=1
     
    Last edited: Nov 19, 2011
  5. TmEE

    TmEE Peppy Member

    Joined:
    Aug 13, 2008
    Messages:
    362
    Likes Received:
    1
    video DAC is indeed external in DC, the small QFP near AV out
     
  6. Samson

    Samson Active Member

    Joined:
    Nov 18, 2011
    Messages:
    37
    Likes Received:
    0
    Then I guess it shouldn't be impossible to find a rough pinout, and hook it up to a logic analyser. Unfortunately I don't have any test equipment other than a voltmeter
    Is it a standard device or a custom design? Maybe some PowerVR datasheets have details?

    A friend sent me a link to this device a while ago:
    http://www.ti.com/product/tfp410
    For Dreamcast you'd need a CPLD or FPGA to interface to the motherboard, similar to the N64 solution above, but instead of pushing the data to a resistor ladder or DAC you'd push them into the DVI transmitter. And AFAIK HDMI is downwards compatible with DVI. No idea how to combine that with audio, though. But I guess you could do a similar trick to bypass the audio DAC and push it to a S/P-Dif transmitter.
    You could probably make a general PCB for this and sell it as a general solution to output digital video from retro consoles. :)
     
    Last edited: Nov 19, 2011
  7. Samson

    Samson Active Member

    Joined:
    Nov 18, 2011
    Messages:
    37
    Likes Received:
    0
    Okay, first sketch with Eagle.
    Don't build this!
    This is basically the VGA box circuit together with the Jon Rhees component converter and the c-sync used directly like in the Amiga versions. Only VGA Select is connected to a switch.
    1) This depends on the C-Sync always to be available, both in VGA and non-VGA mode. Can anyone confirm if it is? Do I need any pull-up, like the VGA box has for H/V sync? What's inside the RGB Scart cable?
    2) I just grabbed a random circuit from the internet to produce -5V for the Op-Amp. Does anyone have an idea if it is suitable for video applications?
    3) Can anyone recommend a different OpAmp? The 4-in-one in the Amiga circuit seems to be cheaper than 3 from the Rhees diagram.
    4) I'm pulling RGB Select always low. Can anyone think of a reason not to?
     

    Attached Files:

    Last edited: Nov 19, 2011
  8. TmEE

    TmEE Peppy Member

    Joined:
    Aug 13, 2008
    Messages:
    362
    Likes Received:
    1
    Csync is definitely available in VGA mode, and H & V sync are available in low-res RGB mode aswell.
    Your only problem right now is getting the negative supply for the opamps.
     
  9. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    Most op amps don't need a negative supply, but you'll need single-supply circuits. Don't AC couple the video and it shouldn't be too hard. It's not a good idea to AC couple an input unless necessary anyway and here it's actually a problem because AC video needs clamping to be processed.

    Also if this is intended to be used in VGA/480p mode good luck, 480p video is >25 MHz so you should use unity gain and drive two 75 ohm loads (~20mA) instead of the standard +6dB output (which you don't have).

    In this diagram there are a number of problems:

    -You aren't buffering the RGB lines so everything is loading everything else
    -The component mixing doesn't look linear..
    -Sync is not added properly. First of all you should attenuate the LVTTL signal (probably will measure to 2.5Vpp) to TV level ~0.286V, then SUM it to the Y component, not weighted average it.
    -The outputs dont' have 75 ohm impedance.
     
    Last edited: Nov 19, 2011
  10. Samson

    Samson Active Member

    Joined:
    Nov 18, 2011
    Messages:
    37
    Likes Received:
    0
    Thanks for the comments! I'll now have to get out the textbooks to understand them. :)
    The component mixing is done by the narmi circuits or the Rhees circuits in a similar way (unless I made a mistake transferring it into Eagle).
    If I understand correctly the narmi circuit is meant to do:
    Y' = 0.299 * R' + 0.587 * G' + 0.114 * B'
    Pb' = 0.57 * (B' - Y')
    Pr' = 0.71 * (R' - Y')

    And the Rhees circuit does (I assume):
    Pb' = - 0.168736 * R' - 0.331264 * G' + 0.5 * B'
    Pr' = 0.5 * R' - 0.418688 * G' - 0.081312 * B'

    The relation from voltage to perceived brightness is not linear anyway, so maybe a small error is not noticeable. I'm still looking for an IC to do it all in one go, though.

    Is the C-Sync actually at LVTTL level? http://www.gamesx.com/avpinouts/dricasryu.htm just uses it directly for a scart cable. Of course, that doesn't need to mean anything, and people who use that mod may rely on the tolerance of their TV sets. I'm just ripping off the narmi circuit ( http://eab.abime.net/showpost.php?p=635282&postcount=13 ) when it comes to C-Sync, because I couldn't find docs how it was supposed to be done.

    So you mean I should take the capacitors on the RGB lines out? I just put them there because they were in the VGA box circuit.

    And with the buffered RGB lines, do you mean something like this: http://eab.abime.net/showpost.php?p=667843&postcount=1 ? Of course, then I need to get both +3.3V and -3.3V, or redesign it for single-supply. Doesn't that mean the ground level of the output changes?

    (Forgive me, it's decades since I did analogue electronics, I'll need to learn it all over again. And I was never very good in the first place.)
     
    Last edited: Nov 20, 2011
  11. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    I'm not sure if the mixing is linear but I suppose it is. I'm not great at analog either. And it should matter if mixing is linear because video gets gamma corrected in the display (non-linear) so there will be exponential error.

    I'm not sure about C sync's level but Gamesx is probably right, I'm not sure why I assumed it was digital. In that case it needs to be summed directly, no attenuation.

    Yes that diagram will work for buffering, it's just a matter of actively driving the lines so the load is taken out of the picture. Note that there is gain there, so you'd need 50 MHz op amps now. I'd make the input stages unity gain instead for that reason (and probably even the output stages). http://upload.wikimedia.org/wikiped...er.svg/220px-Op-Amp_Unity-Gain_Buffer.svg.png
     
  12. TmEE

    TmEE Peppy Member

    Joined:
    Aug 13, 2008
    Messages:
    362
    Likes Received:
    1
    You can use opamps in single supply fashion but then you got to lift your signals to VCC/2 and that will mess up all those precise resistor ratings and your colors will be lost...


    but you could have input stage in voltage follower mode and then with another set of opamps you can do some amping, without having to worry about the conversion resistors
     
    Last edited: Nov 21, 2011
  13. Mr Sippy

    Mr Sippy Active Member

    Joined:
    Jul 22, 2011
    Messages:
    45
    Likes Received:
    0
    When using as a SD A/V splitter, this A/V distribution amplifier allows users to have up to total of 24 video displays and speakers to be driven by 3 different composite video/audio input devices for simultaneous presentation !
    There are 3 composite video inputs on this splitter and each input will buffer and replicate its own video feed for up to 8 simultaneous outputs, resulting in total of 24 video outputs from all 3 inputs with excellent signal strength and quality for transmission.
    This splitter device supports worldwide video systems including all NTSC, PAL or SECAM signals and the package also provides DC power adapter with universal plug kits for use in all countries.

    This splitter can also be daisy chained together for an unlimited number of installation with numerous TV/monitoring displays and speakers. A built-in booster/amplifier circuit will boost the signal to the needed level to prevent signal loss and picture degradation during long cable run. It allows for the audio and video signal to be carried through effectively for 500 ft or more far away from the source location.
     
    Last edited: Nov 29, 2011
  14. Samson

    Samson Active Member

    Joined:
    Nov 18, 2011
    Messages:
    37
    Likes Received:
    0
    Hmm, SPAM? Could be a random topic repost bot?
    Anyway, I copied the Amiga circuit into Eagle, but combined all the parallel/series resistor networks into single resistors. The Pr/Pb calculation in there by subtracting it from Y may be more precise than trying to match resistors to all elements of the matrix.
    I still have to go over the maths, though.
     
  15. Samson

    Samson Active Member

    Joined:
    Nov 18, 2011
    Messages:
    37
    Likes Received:
    0
    I ran a spice simulation on the circuit from the Amiga board. I still have to tweak some details, though, and do some of the modifications suggested in the thread. But it is quite close!
    Does anyone know where I could get a Dreamcast AV connection plug with all pins? I don't want to install the mod internally, and my RGB cable doesn't have a contact for VGA select. At the moment I'm considering if I can transplant a few pins from my old composite cable.
     

    Attached Files:

  16. Samson

    Samson Active Member

    Joined:
    Nov 18, 2011
    Messages:
    37
    Likes Received:
    0
    Small update: I tried transplanting the missing pins to an RGB cable from my old composite cable. The +5V pin was easy enough, though the mode select 1 pin was extremely fiddly and does not fit really that well. The connector uses two rows of pins to fit the high density contacts, and the contacts seem to be slightly offset. Is the AV connector some kind of standard format? Where do 3rd party cable manufacturers get their conectors from?
    The circuit seems to simulate quite well by now, including sync. Though I'll still need to tweak a few bits and pieces before I make a prototype.
     
    Last edited: Jan 7, 2012
  17. Melchior

    Melchior Rapidly Rising Member

    Joined:
    Jun 12, 2011
    Messages:
    79
    Likes Received:
    3
  18. APE

    APE Site Supporter 2015

    Joined:
    Dec 5, 2005
    Messages:
    6,417
    Likes Received:
    141
    Be tempting to see if its possible to tap a more "raw" signal from the Dreamcast internally and upscale it with an FPGA. Assuming the X-RGB type devices are insufficient.

    No point reinventing the hammer if the current one is just as good.
     
  19. Samson

    Samson Active Member

    Joined:
    Nov 18, 2011
    Messages:
    37
    Likes Received:
    0
    That's quite a good price for a VGA box. It may even have enough room to add the required circuit for rgb to component conversion.
    It's mostly limitations of my TV. The VGA input is quite picky and I've got leftover component inputs. In theory component should be equivalent to VGA, but there'll be a bit of loss in the conversion. It'll depend on the quality of the circuit, and I wouldn't do it for anything above 480p. In any way it will be an interesting project.
    The circuit diagrams for dreamcast posted a while ago show the DAC (BU1426KS) pinout. I didn't find a datasheet for the exact device, but maybe devices with similar model numbers can give some information. Though someone with a logic analyser will be able to decode exactly what comes in to D0-D11. (Are MONI0-MONI14 not connected to anything?)
    There seem to be a few projects doing this on N64 because the default DAC removed RGB support. I've seen one project with a CPLD and resistor ladders, and one with an FPGA and VGA output (and I guess an upscaler).

    By the way, I just went over the circuit diagram, and if I don't miss anything then H/V sync should absolutely always be present because it gets grabbed from the GPU and used by the DAC to create the various video signals. And it makes sense that C sync is always present in RGB mode. Or am I missing anything? This guy seems to do quite some work to create a C sync and switch it: http://www.gamesx.com/wiki/doku.php?id=av:dreamcast_480i-480p_scart_cable
    Where is the fun in that?
     
    Last edited: Jan 14, 2012
  20. Lum

    Lum Officer at Arms

    Joined:
    Sep 30, 2010
    Messages:
    3,234
    Likes Received:
    43
    The tough part with dreamcast is some games are incompatible with either RGB or VGA. To get perfect results, you need a circuit switching which of the two component is generated from.
     
    Last edited: Jan 19, 2012

Share This Page