DOSBox over S-Video TV-Out stuttering/jerkiness

General information and assistance with DOSBox.

DOSBox over S-Video TV-Out stuttering/jerkiness

Postby mcihelka » 2013-10-20 @ 21:45

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
mcihelka
Newbie
 
Posts: 6
Joined: 2013-10-20 @ 19:43

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby Mau1wurf1977 » 2013-10-20 @ 22:10

Try setting the TV Out to NTSC. 60Hz might match better with DOSBox.

However PAL C-64 games and others will likely play better on 50 Hz.
User avatar
Mau1wurf1977
l33t++
 
Posts: 7652
Joined: 2010-8-27 @ 04:15
Location: Western Australia

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby leileilol » 2013-10-21 @ 00:47

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.
Voodoo2s aren't 100mhz stock
Geforce256 isn't released as a beta on New Years '99 under the Quadro brand
386DX vs SX isn't about a missing FPU
DOS gaming isn't a bilinear 320x200 16:10
DOS PCs aren't better than the Macintosh
Old PCs aren't 'aesthetic'
User avatar
leileilol
l33t++
 
Posts: 9250
Joined: 2006-12-16 @ 18:03

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby mcihelka » 2013-10-21 @ 01:55

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.
mcihelka
Newbie
 
Posts: 6
Joined: 2013-10-20 @ 19:43

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby Mau1wurf1977 » 2013-10-21 @ 07:35

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.
User avatar
Mau1wurf1977
l33t++
 
Posts: 7652
Joined: 2010-8-27 @ 04:15
Location: Western Australia

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby Qbix » 2013-10-21 @ 08:26

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!
User avatar
Qbix
DOSBox Author
 
Posts: 10594
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby mcihelka » 2013-10-21 @ 09:21

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 8-O 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 :-)
mcihelka
Newbie
 
Posts: 6
Joined: 2013-10-20 @ 19:43

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby Mau1wurf1977 » 2013-10-21 @ 09:46

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.
User avatar
Mau1wurf1977
l33t++
 
Posts: 7652
Joined: 2010-8-27 @ 04:15
Location: Western Australia

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby ripa » 2013-10-21 @ 15:47

@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.
ripa
Oldbie
 
Posts: 549
Joined: 2005-4-18 @ 00:53
Location: Finland

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby VileRancour » 2013-10-21 @ 15:51

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  /   (NEW) blog   /   tube
User avatar
VileRancour
Oldbie
 
Posts: 1618
Joined: 2003-5-14 @ 22:11
Location: 1-01-80 0:00a

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby Mau1wurf1977 » 2013-10-21 @ 23:16

Ok I see! I will play around with it :)
User avatar
Mau1wurf1977
l33t++
 
Posts: 7652
Joined: 2010-8-27 @ 04:15
Location: Western Australia

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby mcihelka » 2013-10-21 @ 23:46

@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).
mcihelka
Newbie
 
Posts: 6
Joined: 2013-10-20 @ 19:43

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby leileilol » 2013-10-22 @ 01:09

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...
Voodoo2s aren't 100mhz stock
Geforce256 isn't released as a beta on New Years '99 under the Quadro brand
386DX vs SX isn't about a missing FPU
DOS gaming isn't a bilinear 320x200 16:10
DOS PCs aren't better than the Macintosh
Old PCs aren't 'aesthetic'
User avatar
leileilol
l33t++
 
Posts: 9250
Joined: 2006-12-16 @ 18:03

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby Qbix » 2013-10-22 @ 06:13

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!
User avatar
Qbix
DOSBox Author
 
Posts: 10594
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby ripa » 2013-10-26 @ 21:06

mcihelka wrote:@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:
Code: Select all
# 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.
Attachments
dosbox-custom.zip
Custom version of Dosbox 0.74 with auto-frameskip and refresh rate override.
(1.08 MiB) Downloaded 126 times
ripa
Oldbie
 
Posts: 549
Joined: 2005-4-18 @ 00:53
Location: Finland

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby mcihelka » 2013-10-31 @ 11:12

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 ;-)
mcihelka
Newbie
 
Posts: 6
Joined: 2013-10-20 @ 19:43

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby ripa » 2013-10-31 @ 19:39

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.
ripa
Oldbie
 
Posts: 549
Joined: 2005-4-18 @ 00:53
Location: Finland

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby Domarius » 2018-5-08 @ 07:46

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.
Domarius
Newbie
 
Posts: 9
Joined: 2003-10-30 @ 00:17

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby Azarien » 2018-5-10 @ 20:58

Is there any DOS test app to see if I have true 70 Hz output or framedropping of some sort?
Azarien
Oldbie
 
Posts: 521
Joined: 2015-5-14 @ 07:14

Re: DOSBox over S-Video TV-Out stuttering/jerkiness

Postby ripa » 2018-5-10 @ 21:55

You're in luck:
viewtopic.php?t=36173

Although you need to judge frame drops by eye (= juddering or stuttering).
ripa
Oldbie
 
Posts: 549
Joined: 2005-4-18 @ 00:53
Location: Finland


Return to DOSBox General

Who is online

Users browsing this forum: No registered users and 2 guests