VOGONS


First post, by mcihelka

User metadata
Rank Newbie
Rank
Newbie

Hi guys,

I have set up a PC for running emulators. It's way overkill for the task but it's what I had in spare parts:

• Intel DP67BA mainboard
• Intel Core i7-2600 3.4 GHz CPU
• 4GB DDR3 1333 RAM
• Onboard sound
• Dell GeForce 9300 GE PCI-E video card
• Windows XP SP3 fresh install + updates
• Latest DOSBox 0.74

I'm using this old Dell video card because it has S-Video output which means I can connect the PC to an old-school CRT television. The intention is to obtain an authentic experience with Commodore 64 and Playstation emulators. The TV output is more than good enough to play DOS games too like Epic Pinball, Lemmings, Alone in the Dark, Comanche, etc.

And that's where the problems start. On S-Video connection, in full-screen mode, DOSBox is jerky/stuttery and sound effects broken up. The gameplay speed isn't consistent (for example in Epic Pinball the game slows down as the table/ball moves around and speeds back up at moments where things are not happening). Other games are affected in a similar way.

So far as I can see, only DOSBox seems to be affected. YouTube videos, movie DVDs, x264 AVI files, other emulators all play back beautifully over S-Video.

I have tried different desktop resolutions - 640x480, 800x600, 1024x768. This is not a multi-monitor setup, the TV is the only thing connected. Incidentally it seems the video card sets itself to 50Hz refresh rate on the S-Video output because that's the PAL standard. Does DOSBox care about video card refresh rates?

I have tried surface, overlay, DirectDraw, and OpenGL output. OpenGL seems somewhat better than the rest but still not good. Double buffering makes things even worse. Adjusting sound buffers doesn't help. Adjusting the type of CPU emulation, cycles, turning off all unneeded emulated devices, etc. doesn't help.

If I unplug the TV and use a monitor over DVI, DOSBox runs beautifully!

To exclude the possibility of a dodgy video card, I sparked up an old Core2 Duo machine with an EVGA GeForce 6200 PCI video card that also has S-Video output. Guess what – exactly the same problem. DOSBox was perfect over VGA or DVI, jerky/stuttery over S-Video.

So that's two NVIDIA cards from different manufacturers exhibiting the same issue. I wish I had a Radeon card with S-Video output to compare but alas I do not.

So I'm wondering if anyone else has experienced anything like this? Or examples of successful S-Video setups? Or just further ideas of what I could/should try to do to fix it.

Many thanks in advance for your help 😀

Michal

Reply 2 of 19, by leileilol

User metadata
Rank l33t++
Rank
l33t++

Most DOS games run at 70hz... so you'll get some noticable dropped frames and stuttered motion if you do it anyway. You'll have the best luck with those few ModeX/VESA games that operate in 320x240, 320x480, 360x480 and 640x480 since they're 60hz.

apsosig.png
long live PCem

Reply 3 of 19, by mcihelka

User metadata
Rank Newbie
Rank
Newbie

OK that's interesting, thanks for the info so far.

So the ideal solution would be to use a display that will happily switch to 70Hz (or whatever DOSBox asks for). Which a 50Hz PAL TV clearly cannot do. I think leileilol's got a point, using NTSC @ 60Hz might be no better. Will give it a go anyway, see what happens.

This raises another question: is anyone happily using DOSBox over a modern LCD TV? Not a monitor, but TV via HDMI or DVI. I'd expect a TV to be capable of 50 or 60Hz but nothing else thus presenting the same kind of problems I'm experiencing over S-Video.

EDIT: OK I've read up on this, heaps of LCD TVs accept a variety of resolutions and refresh rates including VGA 70Hz. So you'd expect DOSBox to work very well on those right?

Will do more testing tonight and come back with an update.

Reply 4 of 19, by Mau1wurf1977

User metadata
Rank l33t++
Rank
l33t++

Yes of course DOS games run at 70Hz, but not DOSBox 😀 It is an emulator and used to the 60Hz refresh rates under Windows.

Infact it requires a lot of tricks to get DOSBox to output at the real 70Hz and I never even attempted it.

My website with reviews, demos, drivers, tutorials and more...
My YouTube channel

Reply 5 of 19, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

dosbox runs on whatever the DOS game wants it to run at. So that includes 70.... Hz

Water flows down the stream
How to ask questions the smart way!

Reply 6 of 19, by mcihelka

User metadata
Rank Newbie
Rank
Newbie

That stacks up with my observations – DOSBox often goes with 720x400 @ 70Hz if I use the option fullresolution=original. I have yet to see it go with something other than 60 or 70Hz though.

Anyway I have done more testing tonight and I think the answer is clear now:

My CRT TV only understands 50Hz, the PAL standard. If it were possible to force a higher refresh rate over the S-Video connection then the TV would fail to display a picture. This particular TV doesn't even support NTSC 😳 so that's that.

On the other hand, a PC monitor/LCD TV over VGA/DVI/HDMI does support various refresh rates. I downloaded a couple of LCD TV manuals to check what they support. The lists are quite long starting at 640x480 @ 60Hz, including 720x400 @ 70Hz, and ending up at 1920x1080 @ 60Hz.

Anyway, I think I'm going to ditch the CRT TV and find a nice CRT monitor instead. If there's any of those still around that is. Or perhaps a 4:3 LCD monitor, if only to maintain the classic shape of the screen (and avoid stretching or having black bars on the sides).

Thanks all for your replies and help on this, much appreciated 😀

Reply 7 of 19, by Mau1wurf1977

User metadata
Rank l33t++
Rank
l33t++
Qbix wrote:

dosbox runs on whatever the DOS game wants it to run at. So that includes 70.... Hz

Hmm clearly I don't understand this then 🙁

I have never managed to get DOSBox to run at 70Hz or my monitor. I can't even change the refresh rate under Windows to anything other than 60.

My website with reviews, demos, drivers, tutorials and more...
My YouTube channel

Reply 8 of 19, by ripa

User metadata
Rank Oldbie
Rank
Oldbie

@mcihelka:
Try setting "fulldouble" to false. You'll get ugly tearing artifacts, but you wont' get slowdowns. Alternatively, you can increase frameskip (value of 1 should be enough) and keep fulldouble=true.

"This raises another question: is anyone happily using DOSBox over a modern LCD TV? Not a monitor, but TV via HDMI or DVI. I'd expect a TV to be capable of 50 or 60Hz but nothing else thus presenting the same kind of problems I'm experiencing over S-Video."

I'm using Dosbox with a video projector (= limited to 60Hz). I have to use the above workaround or my own patch (which I'll publish if I can get it working with Nvidia video cards) to get Dosbox working without stuttering. Also, compared to HDMI or DVI, S-Video is limited to interlaced modes, so it's technically 25 or 30 Hz instead of 60 Hz.

SDL, which Dosbox uses for rendering video, does not work well if the rendering rate is higher than the monitor refresh rate and double-buffering (= fulldouble = "vsync") is enabled. A large portion of DOS games use 70Hz refresh rate, while most monitors today are restricted to 60 Hz. If Dosbox is emulating a 70Hz game and if double-buffering is enabled, SDL will block Dosbox for huge amounts of time, and Dosbox's auto frame cycle adjustment reduces emulated CPU cycles too much.

@Mau1wurf1977
If you can't set 70Hz in Windows, SDL (and thus Dosbox) can't either. If you know your monitor can sync to 70Hz, you can try adding custom video modes. Dosbox should then be able to use those custom 70Hz video modes.

Reply 9 of 19, by VileR

User metadata
Rank l33t
Rank
l33t
Mau1wurf1977 wrote:

I have never managed to get DOSBox to run at 70Hz or my monitor. I can't even change the refresh rate under Windows to anything other than 60.

Does your monitor support 70Hz? if so, have you tried a VGA cable? My card/monitor combo is limited to 60Hz over DVI (and most likely HDMI as well), but with VGA the 70Hz option is suddenly available, and all those smooth scrolling mode 13h games work very nicely.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 11 of 19, by mcihelka

User metadata
Rank Newbie
Rank
Newbie

@ripa

Thank you for the excellent info. SDL blocking makes sense, it certainly seems to explain why the audio stutters so badly and gameplay speed is all over the place. Indeed, disabling double buffering improves things but you get the nasty tearing.

If my TV was capable of NTSC 60Hz then I guess a few more games would have worked just fine. But then 70Hz games would cause trouble anyway. Best get a CRT monitor I think.

One thing I'm left slightly confused about is whether games running in DOSBox actually care/know about refresh rates. For example, if DOSBox allowed you to force a 50Hz refresh rate on all resolutions, would Epic Pinball still work OK? Or would that screw up its internal timings because it expects the hardware to conform to a standard (320x240 @ 60Hz in this case if I remember correctly).

Reply 12 of 19, by leileilol

User metadata
Rank l33t++
Rank
l33t++

OH IT'S PAL 50HZ!?

Good luck with that.... I can't even think of a game that can even go that low. I do know Super Star Wars and Turrican II had manual refresh rate control to go into the higher 50's though...

apsosig.png
long live PCem

Reply 13 of 19, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author
mcihelka wrote:

One thing I'm left slightly confused about is whether games running in DOSBox actually care/know about refresh rates. For example, if DOSBox allowed you to force a 50Hz refresh rate on all resolutions, would Epic Pinball still work OK? Or would that screw up its internal timings because it expects the hardware to conform to a standard (320x240 @ 60Hz in this case if I remember correctly).

DOS games often time themselves to the refresh rate. So they would run at the wrong speed if DOSBox were to change the display timing (the part visible to them). They do this to avoid tearing themselves. (update during vertical retrace)

Water flows down the stream
How to ask questions the smart way!

Reply 14 of 19, by ripa

User metadata
Rank Oldbie
Rank
Oldbie
mcihelka wrote:
@ripa […]
Show full quote

@ripa

Thank you for the excellent info. SDL blocking makes sense, it certainly seems to explain why the audio stutters so badly and gameplay speed is all over the place. Indeed, disabling double buffering improves things but you get the nasty tearing.

If my TV was capable of NTSC 60Hz then I guess a few more games would have worked just fine. But then 70Hz games would cause trouble anyway. Best get a CRT monitor I think.

One thing I'm left slightly confused about is whether games running in DOSBox actually care/know about refresh rates. For example, if DOSBox allowed you to force a 50Hz refresh rate on all resolutions, would Epic Pinball still work OK? Or would that screw up its internal timings because it expects the hardware to conform to a standard (320x240 @ 60Hz in this case if I remember correctly).

I made a custom version of Dosbox that lets you adjust the emulated refresh rate. Epic Pinball and a few other games worked just fine (slightly slower) when refresh rate was forced to 50Hz. You can also emulate higher refresh rates. I also included an auto-frameskip feature that solves any stuttering problems with 70Hz games without changing the emulated refresh rate. The auto-frameskip feature depends on the behavior of the DirectDraw driver, which differs between graphics vendors, so it might not help if you have an Nvidia card, since I've only tested it on my AMD card. You can disable the auto-frameskip feature easily if it causes problems. Both features work together, so you can force emulated refresh rate higher (e.g., 100Hz), while still having auto-frameskip drop all the extra frames that your monitor cannot display.

There's two new supported sections in the config file:

# Set either to 0 to disable the feature. Values of 1000 and less are interpreted as Hz, while larger values as 1/1000th of a Hz. So 61 and 61000 both mean exactly 61Hz.

[autoframeskip]
# Set this to near your monitor's refresh rate, e.g., 60 Hz +1 Hz. Auto-framedrop feature is disabled below this refresh rate, and enabled above.
enablehz=61000

[refreshrate]
overridehz=50000

Attached ZIP file contains a Windows binary, SDL.dll (just for convenience), an example config file, and source code as .diff to Dosbox 0.74. The source code also contains two other disabled features (PC speaker data recording and a "profiler"). Installation: unzip the contents anywhere. You can also drop the custom dosbox.exe on your normal dosbox installation, but you need to add the new config file items to your config file.

Reply 15 of 19, by mcihelka

User metadata
Rank Newbie
Rank
Newbie

ripa, this is excellent stuff, I will definitely give it a go. I hope your intention wasn't to solve my issue? I went ahead and got a half-decent Philips CRT monitor for nothing. How folks managed to stare at these things for hours on end I don't know (I should know though, I used to do it once upon a time. Still, it's better on the eyes than the TV).

Anyway, I shall hook the TV back up and use your build to prove that running the emulator at 50Hz solves the stuttering issue. Then I might try, say, 3Hz on a few games just for fun 😉

Reply 16 of 19, by ripa

User metadata
Rank Oldbie
Rank
Oldbie

ripa, this is excellent stuff, I will definitely give it a go. I hope your intention wasn't to solve my issue?

I was struggling with similar problems after getting a video projector, so I had already implemented that auto-framedrop feature. Your idea about forcing a specific refresh rate was interesting, and I was curious about how it would affect games. Implementing it was a fun exercise since it it was surprisingly easy and the few games I've tried it on worked great.

Reply 17 of 19, by Domarius

User metadata
Rank Newbie
Rank
Newbie
ripa wrote:

I was struggling with similar problems after getting a video projector, so I had already implemented that auto-framedrop feature. Your idea about forcing a specific refresh rate was interesting, and I was curious about how it would affect games. Implementing it was a fun exercise since it it was surprisingly easy and the few games I've tried it on worked great.

You are a life saver. I have been working on this almost 2 days straight, trying to get Doxbox to behave with my Component output to my TV (it's a custom built arcade cabinet). Every other emulator and Windows game behaves, but Dosbox tries to change the refresh rate in fullscreen. I put enableHz=29 (what I know Component output wants) and overrideHz=50 (the default value) and now magically all the Dosbox games go full screen and they appear to run perfectly - there was no speed change like you said. Perhaps my case was slightly different, but all I know is, this is the only thing that works, and I'm glad you did it - you're the only person in the world who thought to do it and it's just here on some random forum post, so I consider myself super lucky.

Reply 18 of 19, by Azarien

User metadata
Rank Oldbie
Rank
Oldbie

Is there any DOS test app to see if I have true 70 Hz output or framedropping of some sort?

Reply 19 of 19, by ripa

User metadata
Rank Oldbie
Rank
Oldbie

You're in luck:
VSYNC / Video Tearing Test for Dosbox

Although you need to judge frame drops by eye (= juddering or stuttering).