VOGONS

Common searches


First post, by Daniil

User metadata
Rank Newbie
Rank
Newbie

Hi everyone!

I'm using DosBOX 0.61 under Mandrake Linux (2.6.2th kernel, 4.4pre2 XFree86), both tried mandrake rpm and a self-compiled version.

I've tried several pinball games (Pinball Fantasies, Pinball Dreams, Psycho Pinball) and everywhere sound is faltering.

I've tried different sound card model settings (SoundBlaster, SoundBlaster Pro) and sound quality settings (High to Low) in games' setup programs, but it has actually no audible effect (except for stereo or mono for sb pro and sb). I've tried different mixer buffer settings in dosbox conf file, but the default 2048 seems to be the best.

There are no problems with graphics smoothness (speed).

I have turned off GUS and PC-Speaker emulation in the configfile.

CPU cycles are set to 2300 and frameskip to 1. I can increase cycles to about 3000, but this doesn't help with sound.

I suspect there is a sound thread priority problem here. Where in the source I can change it?

Motherboard: ABIT BE-6
CPU: Pentuim3, see cpuinfo below
RAM: SDR SDRAM, 103 MHz, 640Mb
OS: Linux (2.6.2)
Display: XFree86 4.4pre2, dosbox settings below, Matrox G400

[dan@shinestar ~]$ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 8 […]
Show full quote

[dan@shinestar ~]$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 8
model name : Pentium III (Coppermine)
stepping : 10
cpu MHz : 618.708
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse
bogomips : 1224.70

DosBox display config:

fullscreen=false fulldouble=false fullfixed=false fullwidth=0 fullheight=0 output=surface hwscale=1.00 autolock=true sensitivity […]
Show full quote

fullscreen=false
fulldouble=false
fullfixed=false
fullwidth=0
fullheight=0
output=surface
hwscale=1.00
autolock=true
sensitivity=100
waitonerror=true

/dev/brains: no such file or directory

Reply 1 of 22, by voyageur

User metadata
Rank Newbie
Rank
Newbie

Humm... I have the same problem now, but as I switched from kernel 2.4 to kernel 2.6 and from a 1 month old dosbox to 0.61 at the same time, I can't tell which one is responsible for this sound problem.

I used to run OMF 2097 without any problems before, but now (as in many other games), sound is stuttering. At loudest sound level, one can hear clicks when sound is stuttering.

As for the source of the problem: dosbox itself, threads, SDL? Who knows (other linux applications don't have any sound problem on my box though).

I run dosbox (home compiled) at around 5000 cycles, frameskip 1, on my athlon-4 900Mhz

I'll try on my old 2.4.20 kernel, see if it changes something.

Voyageur

Reply 2 of 22, by Unavowed

User metadata

I ran into the same problem, using Gentoo with kernel 2.4.24-ow1. I managed to fix it by removing some lines from MIXER_Mix() in src/hardware/mixer.cpp. I tried to understand how this mixer thing works and create a decent fix but it would take too much time as the source is lacking comments or it's just me being too little of a coder, never mind. Removing these lines alone makes it work fine for me and that's all that matters ;-)
If you decide to do the same, the lines are 215-217:

        Bitu size=MIXER_BUFSIZE+mixer.out.write-mixer.out.read;
if (size>=MIXER_BUFSIZE) size-=MIXER_BUFSIZE;
if (size>mixer.blocksize*2) return;

I have also produced another hack, a FPS limiter which does just that - limit FPS to 30. That's a much better way to improve performance than just skip n frames before rendering one. If anyone's interested, I'll be glad to post it.[/code]

Reply 3 of 22, by Unavowed

User metadata

I ran into the same problem, using Gentoo with kernel 2.4.24-ow1. I managed to fix it by removing some lines from MIXER_Mix() in src/hardware/mixer.cpp. I tried to understand how this mixer thing works and create a decent fix but it would take too much time as the source is lacking comments or it's just me being too little of a coder, never mind. Removing these lines alone makes it work fine for me and that's all that matters ;-)
If you decide to do the same, the lines are 215-217:

        Bitu size=MIXER_BUFSIZE+mixer.out.write-mixer.out.read;
if (size>=MIXER_BUFSIZE) size-=MIXER_BUFSIZE;
if (size>mixer.blocksize*2) return;

I have also produced another hack, a FPS limiter which does just that - limit FPS to 30. That's a much better way to improve performance than just skip n frames before rendering one. If anyone's interested, I'll be glad to post it.

Reply 5 of 22, by Daniil

User metadata
Rank Newbie
Rank
Newbie
Unavowed wrote:
Removing these lines alone makes it work fine for me and that's all that matters ;-) If you decide to do the same, the lines are […]
Show full quote

Removing these lines alone makes it work fine for me and that's all that matters 😉
If you decide to do the same, the lines are 215-217:

        Bitu size=MIXER_BUFSIZE+mixer.out.write-mixer.out.read;
if (size>=MIXER_BUFSIZE) size-=MIXER_BUFSIZE;
if (size>mixer.blocksize*2) return;

Well... That works. Yep, works. But why?..

Unavowed wrote:

I have also produced another hack, a FPS limiter which does just that - limit FPS to 30. That's a much better way to improve performance than just skip n frames before rendering one. If anyone's interested, I'll be glad to post it.

Sure, post it! 😀

/dev/brains: no such file or directory

Reply 6 of 22, by Unavowed

User metadata

OK, then.
In src/gui/render.cpp, add

#include "timer.h"

after the initial includes, then add this to the very beginning of RENDER_StartUpdate():

        const static Bit32u interval = 1000/30;
static Bit32u next_frame = 0;
Bit32u now;

now = GetTicks();

if (now >= next_frame)
next_frame = now + interval;
else
return false;

I think it would be a good thing to add this kind of code to dosbox itself, making the number of FPS configurable. I could create such a patch if it were desired by the author. (So that this is not a feature request, just an offer to help ;-))

Reply 7 of 22, by Daniil

User metadata
Rank Newbie
Rank
Newbie

I've made the changes, very cool (hovewer I've increased fps to 35, 30 seems a little bit slow for Pinball Fantasies).

I've used "SDL_timer.h" instead of "timer.h" and "SDL_GetTicks" instead of "GetTicks".

/dev/brains: no such file or directory

Reply 8 of 22, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Could also try enabling ASYNC_BLITS in sdlmain.cpp i think, should help it on some systems that spend too much time blitting the graphics to the screen. Although still have to finish the new vga screen updating to go in the smaller blocks, that's the main cause for stuttering now anyway, especially since we removed the multithreaded display updates.

Reply 9 of 22, by Daniil

User metadata
Rank Newbie
Rank
Newbie

Thanks Harekiet, I'll try to.

But could you please clarify, how and why the above patch to the mixer code improves sound performance? I mean, if it's not needed, why is it here, and if it's needed, why does DOSBox works without? I couldn't actually understand that from the code.

/dev/brains: no such file or directory

Reply 12 of 22, by Daniil

User metadata
Rank Newbie
Rank
Newbie
Harekiet wrote:

Could also try enabling ASYNC_BLITS in sdlmain.cpp

Can't find it. BTW, does it use blitting in fullscreen too? Isn't it possible to do page flipping?

/dev/brains: no such file or directory

Reply 14 of 22, by Guest

User metadata

Well, I applied the fps patch, but that didnt help. Then I also applied the mixer patch, but that doenst help either.
I also tried frameskip at 1 and 4, cycles at 2500 and 3500 and as soundcard SB (mono, 16 stereo) and GUS. And also the mixer setting 2048 and 4096.

But nothing helped.

I'm using alsa and kernel 2.6.4 on a suse 9.0 box

felix

btw: I'm trying to run the 2nd Reality demo

Reply 15 of 22, by voyageur

User metadata
Rank Newbie
Rank
Newbie

Everything works fine for me on my 2.6.4 kernel by commenting out the 3 mentioned lines in src/hardware/mixer.cpp. I didn't tried the fps patch though.

Btw, I have a mixer setting of 2048, frameskip at 1 (sometimes 0), cycles between 5000 and 6500 (depends on the game).

I don't know what is 2nd reality, is it a recent game?

Voyageur

Reply 17 of 22, by Guest

User metadata

Hum... it is quite fluid here(almost no sound stutter with firefox,sylpheed & others in the background), both with SB pro and with GUS (nice demo by the way!).

I also use Alsa for my sound driver (basic via82xx for my laptop), and I often have esd lying around, but no sound problems in dosbox since I commented out the lines in mixer.cpp!

Have you checked the compilations options after you rebuilt dosbox? Without -O option, dosbox can be way slower and if you don't have the latest Opteron...