brainbaking/content/post/2022/11/capturing-vga-output-from-d...

6.1 KiB

title date tags categories
Capturing VGA Output From DOS On Windows XP 2022-11-30T10:00:00+01:00
screenshots
winxp
dos
am486
retro

It took a long time to fill that last available slot on the WinXP build motherboard: the PCI-E 1x is now officially claimed by an Avermedia C127 VGA/HDMI capture card, also known as the Game Broadcaster HD. I've had this on my retrocomputing projects list for almost a year now. I occassionally wander around in the old hardware section on eBay and happened to spot one for only €35---sold! It's quite a slim card with a low profile, as you can see:

I wanted a capture card with the following properties:

  • One that's compatible with Windows XP and functions in a PCI-E 1x slot, since my "best" desktop computer is the WinXP machine. It never stopped being 2003 here!
  • One that's still able to record analog VGA signals instead of being optimized for modern HDMI-enabled machines.
  • Ideally, one that can do both, as it would be cool to be able to capture GameCube stuff (that one is already outputting HDMI)

Therefore, I had zero interest in buying a modern (and expensive!) Gato USB3+ external device that would work with a MacBook. It's more fun to use (semi-)vintage equipment to record vintage equipment---we need to go deeper!

Unfortunately, AverMedia removed all their older drivers since they don't have anything in their lineup anymore that can capture VGA. After a bit of digging, I uncovered http://www.ibmfiles.com/pages/avermedia.htm where C127 Win32 drivers can still be found, together with either "AVer MediaCenter 3D" or the later "RecCenter". I went with the former. The installation process was painless, and the fist thing I tried to hook up was my MacBook.

Out of range. Crap.

I figured the laptop is too new and its resolution/refresh rate is incompatible with the capture card, and reverted to my a few years older Windows work laptop: success! Okay, so HDMI works, but the real challenge is VGA, since old DOS resolutions can be all over the place according to Nerdly Pleasures. Only VGA mode 12h runs at 60Hz, all others run at 70Hz, which of course most cheap capture cards don't support. Let's see here, boot Duke Nukum I, connect the VGA cable from the Cirrus Logic CL-542X-VLB-U to the Broadcaster in port, and...

Out of range. Crap!

I turned to the VOGONS forums looking for answers. In the VGA Capture thread, Elia1995 says:

Every single VGA to HDMI converter I tested with my capture card (Avermedia live gamer HD lite) just gives me an "Out of range" or pure black screen in RECentral.

Okay, that means there's no point in investing in a HDMI upscaler like MiSTeR? The MiSTeR project is geared specifically towards vintage console hardware, not PC DOS hardware, but I've read reports of it working there, and I'm sure it's those blasted VGA modes that are causing trouble again. Luckily, someone else chimes in:

Before I found a good VGA to HDMI converter, I used to work around it using a TSR I wrote that intercepts INT 10h and forces the VGA output to 480-line modes. It worked as long as DOS was able to boot (so, no BIOS setup screens). Most assume 640x480 instead of 720x480 so the TSR also allows you to force the 8-pixel wide alphanumeric mode.

The answer is the DOSLIB, a collection of useful libraries for writing MS-DOS software that contains vga240.exe which, while initiated, forces VGA mode to output in 60Hz instead of 70Hz, hopefully getting rid of the capture card's confusion along the way. The binary from the hw/vga/dos860T folder did the trick:

As soon as the vga240.exe utility is loaded, I notice the DOS prompt looks weird, but at least the AverMedia card recognizes the video signal! However, the tool chokes on something like 3DMenu, which apparently runs at yet another resolution, so the workaround of the workaround (similar to the one as proposed in this thread) is to first run something that works, like Duke's CGA adventure, and then switch to something else.

I now can finally capture material that I couldn't before, like during a benchmark or sysinfo application:

The only downside with the vga240 trick is its scope: it needs to load first before the C127 recognizes the vieo stream, meaning capturing BIOS screens is impossible. Or is it? Apparently, once you're good to go using the above method, simply rebooting---thereby unloading the 60Hz trick---does not immediately cause the signal to drop. Here's the Award Software SysConfig overview just before starting the OnTrack partition from my embedded SD card:

Its resolution is still a bit messy: AverMedia's software isn't great at dynamically switching or correctly configuring it. You can also use VLC to directly "open" a capture device; the C127 should be in the combobox as a DirectShow device. In VLC, configuring the resolution is easier, but switching between capture software while both are active doesn't work as the stream is in use.

There's still much to discover: booting Windows 3.11 on 800x600 drops the signal after the logo (that still uses the VGA mode from the DOS prompt) and I have yet to try the more demanding games. But I'm one step closer to taking my own screenshots on native hardware. Consider me happy!