Gamecube Digital AV to direct HDMI / VGA mod...

Portables, case replacements, mods etc, all in here!
OzOnE
Posts: 24
Joined: Thu May 09, 2013 4:10 am
Location: UK

Gamecube Digital AV to direct HDMI / VGA mod...

Post by OzOnE » Sat May 11, 2013 6:03 pm

Hi, all,

I created this new thread, as didn't want to hijack megalomaniac's component / VGA thread...

I had some better luck with the HDMI output last night... ;)

EDIT: replaced with better pic...
Image

Image

Finally got the YCbCr-to-RGB code working at about 6am this morning.
So no longer need to run it through my ancient Pioneer plasma to see the correct colours.

This is still very much a proof-of-concept at this stage 'cos there's still lots to sort out.

The first photo is on my 46" Samsung LCD via HDMI.
Basically, whatever works through HDMI works via the VGA output on my dev board too.

(ignore the "error", you can see this was the GC where I ripped off the drive connector during earlier experiments).

So, it's running through the scandoubler now so it can display 480i / 576i stuff.
The colour depth isn't great atm, 'cos the scandoubler uses an SDRAM framebuffer and only accesses 16-bits at a time.
I have to pass the GC pixel data through in 5-6-5 format for now (5-bit red, 6-bit green, 5-bit blue).

(this also causes the slight colour fringing around the text and the weird lines on parts of the cube logo).

What I'll try next is to pass the YCbCr data through the scandoubler instead.
The YCbCr bytes have a limited range of values, so it might be possible to squeeze more bits through...
(see the paragraph next to the photo of the Barn) - http://en.wikipedia.org/wiki/YCbCr

The image is also stretched / shifted right and downwards slightly 'cos it's using the 480p output timings on a PAL / 576i source.
Once the correct timing values are sorted, I can then add auto detection for each video format.

480p / 576p should work straight through without the annoying scandoubler junk.
I need to find a better / simpler scandoubler code, that will makes things a ton easier.

HDMI can support 480i / 576i interlaced format directly ofc, but it's difficult to get working since it has to clock-in / repeat every pixel twice.

OK, all for now.
Getting somewhere at least. 8-)

OzOnE.
EDIT: Downscaled those huge photos.
Last edited by OzOnE on Sat May 11, 2013 10:28 pm, edited 3 times in total.
User avatar
megalomaniac
Posts: 2480
Joined: Sun Aug 21, 2011 5:33 am
Location: Drunk in Texas
Contact:

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by megalomaniac » Sat May 11, 2013 6:11 pm

hehe...nice
finally a possible alternative to the MX chip
emu_kidid wrote: beer is like WD40 for megalomaniac's brain, gets the gears moving
>>> BadAssConsoles.com <<<

Image Image Image
OzOnE
Posts: 24
Joined: Thu May 09, 2013 4:10 am
Location: UK

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by OzOnE » Sat May 11, 2013 6:23 pm

Hi, mega,

That's a good point actually.
I think it will work OK for analog Component output (with a simple DAC chip) since it doesn't require the extra timing stuff that HDMI does for interlaced modes.
This would do away with the SDRAM as well, so only a small (cheap!) FPGA and DAC chip will be required.

Component should work OK with the prog scan 480p / 576p modes too.
I'll must give that a try next. :)

VGA is in a similar state to HDMI in that it needs the scandoubler before it will work on most modern monitors.
Some monitors / TV's might support interlaced via VGA (like my Pioneer), but it's not as common these days.

EDIT: Oh, and audio support... I tried outputting to the audio DAC on that dev board, but it's connected in a way that only allow the clock inputs TO the FPGA (slave mode) instead of allowing the GC clocks TO the DAC.

So, I didn't test the audio output as yet, but I'm sure it will work fine with an external DAC or if I modify this board slightly.
Passing audio via HDMI is a different challenge altogether - The encoding is quite complex, and would likely take weeks to figure out the code.

OzOnE.
User avatar
megalomaniac
Posts: 2480
Joined: Sun Aug 21, 2011 5:33 am
Location: Drunk in Texas
Contact:

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by megalomaniac » Sat May 11, 2013 6:49 pm

OzOnE wrote:Hi, mega,

That's a good point actually.
I think it will work OK for analog Component output (with a simple DAC chip) since it doesn't require the extra timing stuff that HDMI does for interlaced modes.
This would do away with the SDRAM as well, so only a small (cheap!) FPGA and DAC chip will be required.

Component should work OK with the prog scan 480p / 576p modes too.
I'll must give that a try next. :)

VGA is in a similar state to HDMI in that it needs the scandoubler before it will work on most modern monitors.
Some monitors / TV's might support interlaced via VGA (like my Pioneer), but it's not as common these days.

EDIT: Oh, and audio support... I tried outputting to the audio DAC on that dev board, but it's connected in a way that only allow the clock inputs TO the FPGA (slave mode) instead of allowing the GC clocks TO the DAC.

So, I didn't test the audio output as yet, but I'm sure it will work fine with an external DAC or if I modify this board slightly.
Passing audio via HDMI is a different challenge altogether - The encoding is quite complex, and would likely take weeks to figure out the code.

OzOnE.

remember you are testing in 576i, once you are able to boot 480p/576p, then you can test without the scan doubler and have better confirmation about HMDI

...and for the audio, i have a few ideas about that also....lets meet up again on IRC



edit: heh, just thought about another chip that can be used also to make things much more simple....and would possibly save you the trouble of figuring out the audio integration to hdmi
Last edited by megalomaniac on Sat May 11, 2013 7:01 pm, edited 1 time in total.
emu_kidid wrote: beer is like WD40 for megalomaniac's brain, gets the gears moving
>>> BadAssConsoles.com <<<

Image Image Image
OzOnE
Posts: 24
Joined: Thu May 09, 2013 4:10 am
Location: UK

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by OzOnE » Sat May 11, 2013 7:00 pm

megalomaniac wrote:remember you are testing in 576i, once you are able to boot 480p/576p, then you can test without the scan doubler and have better confirmation about HMDI
Yep, should be much nicer / easier in prog mode. :P
Interlaced support will be added to make it simpler to use the menus and non-prog games etc.
megalomaniac wrote:...and for the audio, i have a few ideas about that also....lets meet up again on IRC
Cool. I'll be on in a minute if you're not busy.
pr0ton
Posts: 186
Joined: Mon Dec 12, 2011 9:40 pm
Location: NL

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by pr0ton » Sat May 11, 2013 8:48 pm

Hey, that's brilliant! I don't think many believed you when you said 'let's do this in some hours'. HDMI on a GC, haha. Congrats!

If you have hopes one day for Wii too, you can have or lend mine ;).
DOL-001&DOL-101 <- PAL
OzOnE
Posts: 24
Joined: Thu May 09, 2013 4:10 am
Location: UK

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by OzOnE » Sat May 11, 2013 10:08 pm

Thanks pr0ton!

I seem to have that effect on people. lol
(That's why I thought I'd post my previous work as in intro, in case it sounded like a pipe dream.)

Had a good chat with mega on IRC just now though.
He has some great ideas about making the board smaller, and how to simplify the mod etc.

btw, the sparklies / lines on the image are now gone.
I just needed to shorten that ribbon cable by another inch.
The picture is quite nice now, even with only 16-bit colour.

Pure HDMI black levels and colours. :)

Thanks for the offer on the Wii.
I'm in the UK btw (really should add that to my profile), but I might be buying a Wii soon to try the mod.

Still lots to do.
Must find some better scandoubler code and get 576i working with the correct timing ratio etc.

I'll be soldering the cable to the "working" GC tonight so I can play that ONE disk that I own (yes, really. Rainbow Six. lol).
Good job I've still got a Torx security bit in my tool box.
Diminuendo
Posts: 305
Joined: Tue Sep 18, 2012 12:32 am

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by Diminuendo » Sun May 12, 2013 6:36 am

I don't understand a lot of what your saying but from what I can gather your getting HDMI buy getting an interlaced signal from a PAL board and de-interlacing the two fields into progressive right?
Benni
Posts: 259
Joined: Mon Oct 17, 2011 7:45 am

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by Benni » Sun May 12, 2013 7:25 am

hdmi is also possible for NES!
There are some NES´s with HDMI for sale...
OzOnE
Posts: 24
Joined: Thu May 09, 2013 4:10 am
Location: UK

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by OzOnE » Sun May 12, 2013 7:37 am

Diminuendo wrote:I don't understand a lot of what your saying but from what I can gather your getting HDMI buy getting an interlaced signal from a PAL board and de-interlacing the two fields into progressive right?
Yep,

I'm waiting for a reply from someone about a Xeno chip so I can try native prog scan modes on this PAL GC.
But, interlaced support is also necessary since the "BIOS" menus are interlaced, and many games don't support prog scan output (PAL games for example).

I have to use a scandoubler to write the two fields of the image into an SDRAM buffer.
The lines then get read in a progressive / sequential fashion so most VGA monitors and the HDMI output will work.

HDMI is capable of supporting interlaced directly, but the timing is quite complex to work out (I'm hoping to sort that out too).

Most modern monitors won't support the 15KHz interlaced signal via VGA either, so the scandoubler is used for that as well.

Normally with an interlaced signal, the odd lines of the image are output first, like this...
ODD field: 1,3,5,7,9

...the TV then receives a Vertical Sync signal and starts drawing the even lines "in between" the odd lines...
EVEN field: 2,4,6,8,10

In the scandoubler memory, the two fields are written to two separate parts (buffers) in SDRAM.
It then alternates between the two buffers when reading back and outputting to the monitor...

1st buffer: Line 1
2nd buffer: Line 2
1st buffer: Line 3
2nd buffer: Line 4
1st buffer: Line 5
2nd buffer: Line 6
1st buffer: Line 7
2nd buffer: Line 8
1st buffer: Line 9
2nd buffer: Line 10

Tada! A progressively-scanned image.

I wish it were than simple though. This scandoubler is way overcomplex tbh.

I've been working on the audio stuff last night.
Starting to get S/PDIF encoding working, so the FPGA will output the GC's digital audio from a single pin.

In fact, it's even working using an on-board LED, just like this (not my vid)...
http://www.youtube.com/watch?v=prpLSlHjU1Y
Benni wrote:hdmi is also possible for NES!
There are some NES´s with HDMI for sale...
I don't think it's possible to get a direct digital HDMI working on a stock NES...

IIRC, the NES PPU outputs composite video directly.
So unless you have some sort of NES clone with a better output, you can only get HDMI by converting the composite output (which probably wouldn't improve the image very much).

Watch out for some of the "HDMI" NES's though, some of them are just a mini-PC inside a NES case. :o

It should be possible to use the FPGA method for many other types of console though...

Many older consoles use a separate video DAC which allows direct access to it's digital video bus.
If the pins can be soldered too fairly easily, and the data format is understood, then it's likely it can be done.

The Dreamcast and Xbox 1 might be good candidates for an HDMI mod.

OzOnE.
User avatar
MockyLock
Posts: 330
Joined: Tue Aug 07, 2012 8:12 pm
Location: France

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by MockyLock » Sun May 12, 2013 7:53 am

If I can add something, it does exist a NES mod to ouput true RGB, using Playchoice games PPU.
Here the link of the main thread :
http://nfggames.com/forum2/index.php?topic=1592.0
moosman worked a lot on this.
I've tried to start the project, but the hard thing was to find cheap playchoice PPU / games.
And since I wanted to build the thing with a PAL NES (using the video cable socket) i had to exchange crystal and other stuff. pretty complicated.
I left this project as is, but i know i will do it one day.
OzOnE
Posts: 24
Joined: Thu May 09, 2013 4:10 am
Location: UK

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by OzOnE » Sun May 12, 2013 8:22 am

Ahh, I thought there must be a NES PPU with better video output.

tbh, if you want the ultimate NES using modern parts, you can just run the NES directly on an FPGA board.

There are quite a few NES projects now...
http://www.youtube.com/watch?v=NyhbJ-KhHaM
http://www.youtube.com/watch?v=xiEZIma5FI0
http://fpganes.blogspot.co.uk/2013/01/l ... a-nes.html
http://cegt201.bradley.edu/projgrad/proj2006/fpganes
https://github.com/brianbennett/fpga_nes

OK, I know it's not a "real" NES, but remember, most of these projects are NOT emulators...
As long as the code is well written, they are essentially an accurate recreation of the original hardware at gate level. ;)

The other advantage is that you can store many thousands of games on an SD card ofc, and get really nice VGA output (or HDMI if somebody wanted to add it).

I've been having fun playing Amiga games on my DE1 FPGA board recently.
Many other machines like the Atari ST and SNES have been ported to FPGA as well. Tis the future of retro gaming. 8-)

OzOnE.
bronko
Posts: 5
Joined: Sun May 12, 2013 10:22 am
Location: Germany

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by bronko » Sun May 12, 2013 11:14 am

OzOnE this looks great and thank you for sharing so much detail about your project.

I set myself the same goal (HDMI for the Gamecube) a few weeks ago. I opened a gc, soldered my logic analyzer to the digital av out and looked at the signals.
Also an Altera Cyc III DevKit is lying next to me, including a DVI/HDMI Output.

I have not written any HDL code yet and my first design goal was to write a HDL decoder, to get the Hsync/Vsync signals etc. separated from the video data.
Next I planned on using the Altera VIP (Video & Image Proc. Suite) to buffer, deinterlace (maybe upscale?) the signal and then output it to the DVI/HDMI Transmitter IC. After that, replacing the Altera components step-by-step with my own code.

It seems, you have accomplished most of that already, so I just have to ask if you plan on sharing your code ?
User avatar
MockyLock
Posts: 330
Joined: Tue Aug 07, 2012 8:12 pm
Location: France

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by MockyLock » Sun May 12, 2013 11:51 am

FOr the SNES i remember this project
http://sd2snes.de/blog/archives/category/snes-general
Diminuendo
Posts: 305
Joined: Tue Sep 18, 2012 12:32 am

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by Diminuendo » Sun May 12, 2013 1:18 pm

couldn't you get 15hz VGA from a LMH1251 on the composite line to get H- and V-sync like Ashen did for his PS2 portable and then use a scan doubler to turn the interlaced VGA to progressive?
OzOnE
Posts: 24
Joined: Thu May 09, 2013 4:10 am
Location: UK

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by OzOnE » Sun May 12, 2013 4:31 pm

@bronko - I'm using some of the Altera blocks to do the scandoubling atm, but you've got a good point...
I forgot that they have a lot of other processing blocks which I could use. I must give that a try.
I did try the CSC (Colour Space Converter) from the Megafunctions but it wouldn't compile on 8.1 for some reason?

Can't share the code atm unfortunately, as I'm hoping to produce at least a few PCBs that people can buy (will take a while).
I can give hints on how to decode the basic GC side stuff though...

I realized that you don't even need a state machine to grab the GC data, just need to buffer "vphase" into "old_vphase",
then in the main always block, check to see if vphase has toggled (vphase != old_vphase). That will tell you when to grab the "Y" byte, then on the next clock grab either "Cr" (if vphase is high) or "Cb" (if vphase is low). ;)

Also, before you grab "Cb" or "Cr", need to check if Y = 0x00, in which case the Cb and Cr bytes will contain the flags / sync bits.

It uses the 27M clock for 480i modes, and I'm fairly certain you'll need to switch to the 54M clock for 480p modes.
I then divide down the clock to get the actual PIXEL clock (13.5MHz for 480i) so I can count the number of pixels along each line (864 pixels / 625 lines for 576i PAL).

In this case, a single "pixel" would be either Y+Cr, or Y+Cb, so the colour data is really only sampled at half the pixel rate.

Hope that helps. :P
OzOnE.
bronko
Posts: 5
Joined: Sun May 12, 2013 10:22 am
Location: Germany

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by bronko » Mon May 13, 2013 6:14 pm

I thought about building a state machine too, but your way seems much faster and easier. I hope to find some time soon, to get some coding done.

As you mentioned using some of the Altera blocks yourself, i am wondered if you are using the Video In Component from Altera ? I checked the documentation but found no solid proof, how and if it can handle the 576 interlaced resoultion as an input. If I could get this to work, using most of the Altera components would be a great proof of concept in terms of image quality. Also it should be fairly easy to set up, i guess.

I thought about building some hardware too, but at the moment this seems to be far down the road for me. Guessing it would neither be easy nor become a cheap solution when using an fpga + ram + etc.. Also i could not find any sources selling the digital av connector without the really expensive component cable.
OzOnE
Posts: 24
Joined: Thu May 09, 2013 4:10 am
Location: UK

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by OzOnE » Mon May 13, 2013 11:27 pm

I've been trying to get to grips with the Altera stuff (and finally got Quartus 12.1 installed), but most of the blocks interface via Avalon or some junk.
It's really difficult to get the code talking to each other without modifying lots of stuff.

It could be made simpler if the GC decoder block inserted the SAV / EAV flags to make it like a bt.656 stream I suppose?

Yes, the Digital AV connector is a proper pain to get hold of.
megalomanic still has a good deal when it comes to the component cables (although I haven't looked through the forum for others tbh.)

The plug / socket seem to be completely proprietary to the Big N'. :(

For testing the hardware side of things, you can get small FPGA boards with both SDRAM and SRAM on them for only about $40 now.
It needs around 4000 logic elements for the basic design (with SDRAM based scandoubler). I'm sure it can be done without any external RAM though.

The HDMI socket is fairly simple, I just bought a few of these swivel couplers and ripped the connectors out...
http://www.ebay.co.uk/itm/HDMI-1-4-Fema ... 43ac157c6c

The HDMI socket can be connected directly to the FPGA.
There's still the issue of the non-standard voltage swing though, so it may not work with your TV.

I'm confident the board can be kept fairly inexpensive, but then again who will pay more than $60 for an HDMI adapter?
I need to keep it super cheap for it to be worthwhile.

The PCB's are cheap when made in quantity, so it's just the choice of FPGA really.
If the deinterlacer can be done without external memory, then the FPGA would be far cheaper / simpler.

btw, I just bought a US Gamecube today so I can start testing 480p directly.
Need to get me some disks though (forgot about that. hehe).

OzOnE.
User avatar
megalomaniac
Posts: 2480
Joined: Sun Aug 21, 2011 5:33 am
Location: Drunk in Texas
Contact:

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by megalomaniac » Mon May 13, 2013 11:57 pm

yea...not having those connectors is really gonna kill it for most people...


molding the connector might not be the hardest thing for anyone with experience, but the pins are another problem all together...i have contact many many manufactures during my design phase for the MEGA3 and no one seems to be able to get a hold of those type of pins....

i almost considered buying 2$ HDMI ebay cables and removing the pins one by one to use in my own possible plug solution....but even to try removing the pins from a hdmi mold was a problem in itself...

ive been thinking off and on about a solution but since im almost out of MEGA3 boards, at this point its almost too late for me to continue looking at trying to make connectors for the few boards i have left...
emu_kidid wrote: beer is like WD40 for megalomaniac's brain, gets the gears moving
>>> BadAssConsoles.com <<<

Image Image Image
OzOnE
Posts: 24
Joined: Thu May 09, 2013 4:10 am
Location: UK

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by OzOnE » Tue May 14, 2013 12:30 am

Actually, the pins in the GC drive / serial connectors might be suitable for a mold mod.

I thought it would be easier to just replace the connector on the GC with the HDMI thing attached, boy was I wrong.
Basically, I didn't bother to unblock the last three holes in the board and tried to melt the last few pins in.
Three or four pins got stuck and pulled out of the connector. Anyway, fixed it in the end and can now see Rainbow Six via HDMI.

The pins are very long though, but you've probably got a ton of them sitting around if you make portables? (possibly a silly question. lol).

Or, have you looked for edge connectors with the same pin pitch as the Dig AV port?
I'll have a look now to see what it is...
User avatar
megalomaniac
Posts: 2480
Joined: Sun Aug 21, 2011 5:33 am
Location: Drunk in Texas
Contact:

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by megalomaniac » Tue May 14, 2013 12:37 am

the drive connectors are not the same spacing...suitable pin yes, but would need to kill the drive port just to gain the pins....and then that person would need to set the pins and mold everything in place....
this is not really an ideal solution....

as for edge connectors, these do not come in the right combination of pins / spacing / pitch...so that would not be a solution either...
emu_kidid wrote: beer is like WD40 for megalomaniac's brain, gets the gears moving
>>> BadAssConsoles.com <<<

Image Image Image
User avatar
tesla246
Posts: 121
Joined: Tue Dec 11, 2012 1:48 pm

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by tesla246 » Fri May 17, 2013 3:32 pm

OzOnE, are you considering making a tutorial on a DIY hdmi cable when your project is done, for the non techies like me?

Major props anyway, ive been dying to get my hands on a purely digital cable, especialy since component becomes more rare on newer tvs.

Also, does this mod\your cable carry digital sound?

OzOnE is awesome! :D
Dream mod: HI-speed port device utilizing 4:4:4 RGB 32 bit colour, 720p video and variable refresh rate. :shock:
Favourite mod: GC Loader flashed with latest swiss.
Eagerly awaiting a normal, form-factor wise, wireless controller with rumble. :)
Kadano
Posts: 29
Joined: Sun Apr 15, 2012 1:11 pm
Location: Vienna (Austria, Europe)

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by Kadano » Tue May 21, 2013 12:53 pm

I have a PAL GC modded with a Qoob Pro. It can force PAL games into 480p just fine. Actually, all games that are 480p-capable as NTSC are also 480p-capable as PAL. The selection query has just been replaced by the 60 Hz query.

I don’t understand much of what you’ve been writing. Is Digital AV’s YCrCb (progressive mode) and digital audio compatible with HDMI so you just need to connect them correctly or do they need recoding?
BenoitRen
Posts: 263
Joined: Sun Jul 29, 2012 3:37 pm

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by BenoitRen » Tue May 21, 2013 10:09 pm

Kadano wrote:Actually, all games that are 480p-capable as NTSC are also 480p-capable as PAL.
That's not true. Forcing 480p on the PAL versions of the Phantasy Star Online games doesn't work. Not with Qoob, and not with Swiss.
Hardware: Wii (PAL)
Hardware configuration: System Menu 4.1E, Priiloader
Swiss boot method: Modified Wii Swiss Booter provided by Extrems
Software medium: Retail discs
psyko_chewbacca
Posts: 40
Joined: Fri Aug 12, 2011 2:36 pm

Re: Gamecube Digital AV to direct HDMI / VGA mod...

Post by psyko_chewbacca » Wed May 22, 2013 10:31 pm

That thing is pure diamond right here! I didn't quite saw what was the FPGA on the dev board in the picture. Cyclone 3 I presume?

I'm very interested in the reverse you did to decode the YCbCr bitstream coming from the GC. Is it somewhat close to the defined open standards?

I was thinking of installing a dev environement on my PC to write simple programs that would output a single pre-defined color on the whole screen and read the digital port. Did you use a similar approach or was it done trying different code variant?

Does the digital transmission from the GC to the MX chip(here FPGA) also contains sync info, back porch sequence, etc. or is it presumably added by internal logic of the DAC chip? I never really worked with YCbCr signals so I cannot really say how the logic works.

Finally, do you code in VHDL or Verilog?

I am really into this project however I don't have time to start investigating right now... Good luck!
Locked