VOGONS

Common searches


(Sound?) stutters if not using fixed cycles?

Topic actions

  • This topic is locked. You cannot reply or edit posts.

First post, by sndwv

User metadata
Rank Member
Rank
Member

This is a minor issue I have been having with DOSBox (0.74 and later SVN builds) I've never been able to solve: if cycles=max or auto, many, maybe all games occasionally have very slight 'hitches' or 'stutters' in the audio, most noticeable in background music. Setting an appropriate fixed cycles setting alleviates the problem.

Is this expected behaviour, is setting a fixed cycle count preferred? What are other .conf settings that could be related? Or could this also be host-platform specific?

Reply 1 of 14, by collector

User metadata
Rank l33t
Rank
l33t

Stuttering is usually from setting cycles higher than what the host machine can handle. If you are trying to run a more demanding game on older or lower end hardware this is more likely to happen. What game and what CPU?

The Sierra Help Pages -- New Sierra Game Installers -- Sierra Game Patches -- New Non-Sierra Game Installers

Reply 2 of 14, by sndwv

User metadata
Rank Member
Rank
Member

That's the strange thing, many games: Mechwarrior 2 @ 1024 (demanding) or Dune 2 (not demanding). This is on an Intel i7 @ 3.4GHz. It's also not really stuttering per se (I know the crackling at too high a cycle rate), it's an intermittent hiccup here or there, like the game speed is slightly uneven: a slight pause or speed-up, a slightly longer held or overlapping MIDI note, that sort of thing. Completely disappears at any fixed cycle rate the game and host cpu like.

Do both settings (auto and max) 'settle' on a constant cycle rate once a program is running, or does DOSBox adapt continuously? Or maybe OS background processes interfering? Nothing significant is active in the background though.

Reply 3 of 14, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

yeah, with max, dosbox constantly adapts and try to run at the highest value possible.
Maybe, try running with max 95% (press ctrl-f11 once) and see if increasing the frameskip helps.

If you are up to it, we can debug this together a bit as to why it happens on your system. Send me an email or pm if you are up to that

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

Reply 5 of 14, by filipetolhuizen

User metadata
Rank Oldbie
Rank
Oldbie

Sorry for reviving this, but I found out I'm having the exact same issue. I noticed, however, if I run dosbox with max cycles just after a fresh reboot, it runs without any stuttering. This only happens if the OS is running for a while and then you run dosbox. Coincidence or not, when dosbox stutters, so does Interstate '76. Dosbox didn't have stutter issues when I ran it on WinXP. I'm on Win7 32 bits.

Reply 6 of 14, by James-F

User metadata
Rank Oldbie
Rank
Oldbie
core=dynamic
cputype=auto
cycles=fixed 40000
cycleup=5000
cycledown=5000

Try these settings.

In my experience when dosbox exceeds the cycles your actual CPU is capable emulating, the emulation starts to stutter.
I use 40,000 fixed cycles as a start which equates to a slow Pentium which is fine for most games, sometimes I raise the cycles to 200,000 for a Pentium II range, if needed.
I always use FIXED cycles which is much more reliable way to get accurate CPU clocks with games than Auto with % values.

Using % of you actual CPU is a random hit or miss, I suggest sicking to FIXED cycles and using the Cycle UP/DOWN with a large value like 5000 to fine tune in game.
Here is a small chart of what cycles equals to what CPU: http://www.dosbox.com/wiki/performance
Anything from 10,000 to 200,000 will equate to about 386 to Pentium which is what you want from DOSBox.


my important / useful posts are here

Reply 7 of 14, by Kisai

User metadata
Rank Member
Rank
Member
James-F wrote:
In my experience when dosbox exceeds the cycles your actual CPU is capable emulating, the emulation starts to stutter. […]
Show full quote

In my experience when dosbox exceeds the cycles your actual CPU is capable emulating, the emulation starts to stutter.

...

Here is a small chart of what cycles equals to what CPU: http://www.dosbox.com/wiki/performance
Anything from 10,000 to 200,000 will equate to about 386 to Pentium which is what you want from DOSBox.

Two other things are also in play. If you are capturing video, the video capture code is in the main thread, and typically cuts the maximum emulation speed in half (due to having to copy the screen image, and audio a second time.)

The second thing in play is disk speed. For all intents, no dos game should actually be hitting the hard drive, it should be reading from the disk cache in the host OS. But this doesn't apply to using disk images. Case in point, copy files from two disk images on the same host drive inside dos box. It will look like it's doing nothing for a minute or two, and then say it's copied all the files all at once.

When I play games, without capture on, there will be the occasional audio stutter, which I've chalked up to the audio buffer being not quite the right size. But what IS interesting is that if you capture the audio, there is no stutter at all in the captured audio, which means it's more likely the OS is causing the stutter. It would be interesting to find out if OSX or Linux experience the same problem or if it's just isolated to DOSBOX 32-bit on 64-bit Windows OS.

Reply 10 of 14, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

yep, during investigation, i found that there are unexplainable jumps in the cycles to 4 times the amount your pc can handle. (which results in the stuttering).
Setting a sensible limit does help against that, if that limit is chosen to be lower that the " wrong" guessed amount of cycles.

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

Reply 11 of 14, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

When using DOSBox I always use the high performance power plan in windows so that the CPU will not downclock.
When the CPU is stable I can raise the emulated cycles in dosbox to find the maximum emulated cycles my real CPU can handle just by noting at what cycle a game (Quake for example) starts to stutter.
Now that I know the maximum emulated dosbox cycles my real CPU can provide it is much easier not to go over it.

Once again, i always use Fixed cycles in DOSBox for stability and to get an average speed of the emulated CPU like 386, 486, Pentium.


my important / useful posts are here

Reply 12 of 14, by filipetolhuizen

User metadata
Rank Oldbie
Rank
Oldbie
Qbix wrote:

yep, during investigation, i found that there are unexplainable jumps in the cycles to 4 times the amount your pc can handle. (which results in the stuttering).
Setting a sensible limit does help against that, if that limit is chosen to be lower that the " wrong" guessed amount of cycles.

These stutterings didn't happen when I had Windows XP on the exact same hardware. Could it be related to the host OS?

Reply 13 of 14, by davepyne

User metadata
Rank Newbie
Rank
Newbie

I had a similar issue. I think it started when I upgraded to Windows 7. Anyway I was able to solve it by changing the prebuffer to 80 as suggested in this post by "Old PC Gaming" https://www.oldpcgaming.net/how-to-stop-stutt … usic-in-dosbox/

prebuffer=80 (before I had it set to 20 when it was stuttering)