VOGONS

Common searches


First post, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

Hi!

This problem is a little off-topic, but I hope someone has seen this before and can give me a hint.

On my VIA EPIA board (VIA C3-2 1GHz, onboard audio), dosbox has horrible sound problems. Sound stutters massively, regardless of settings.

I am using Linux with ALSA, tried various dosbox versions. I believe it is _not_ dosbox's fault, as the exact same binary works fine on my 333MHz laptop. I've tried changing video/cpu settings in order to save CPU, but it doesn't change a bit. I've tried all sample rates from 8000-48000, and various buffer sizes.

One thing I observed is: Sound seems to play exactly at half speed. One buffer of audio is played, and then I get silence for the same amount of time, then again a bit of sound, silence again. This repeats continuously. I assume it's a single audio buffer being played, as I get longer sound-silence periods when increasing the buffer size or reducing the sample rate.

The funny thing is, the box is my TV (mythtv), it runs lots of (CPU/memory/disk-intensive) stuff just fine, no problems anywhere. So I'm completely lost why dosbox is the only program not working as expected.

Any ideas?

Reply 1 of 11, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

do you have something like kfreqd running ?
dosbox likes being run at good/constant speed.
I presume you don't run 24 bits display depth

did you try the latest cvs ? as it has some changes in the priority code for linux (run dosbox as root for best effect (those changes that is))
see if that helps.

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

Reply 2 of 11, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

No, the box is running without any power/frequency management. I tried CVS as of today as well as several older versions that happened to sit on my harddisk. One of them was the binary I am (happily) using on my laptop.

I've also tried various priority settings in 0.62, didn't make a difference.

Reply 4 of 11, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

yeah, even patched the SDL alsa driver to actually use DMA. Also enabled the via-sound kernel driver to support more than just 48kHz. Well, I think I'll go and look if there are more envvars for SDL. At the moment there is also some SDL-software compiling to check if it could be SDL's fault.

Reply 5 of 11, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

Well, back I am. It seems like I already tried all existing SDL envvars, and a couple of SDL games all had the same behaviour: They worked flawlessly. Sigh. I feel an urge to scream.

Reply 6 of 11, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

FYI: found the problem.

It is (more or less) an SDL bug. When using ALSA as sound driver, it allocates only 2 periods (a.k.a. fragments), which seems to be too little on some hardware. I don't know if it's the onboard sound (via chip, while the laptop uses yamaha) or the small CPU cache or whatever. After patching SDL to allocate 4 periods, dosbox runs like a charm, with the speed I'd expect from a 1GHz cpu, and everything.

I'll probably submit my changes to the SDL authors, so others are spared.

Reply 8 of 11, by Guest

User metadata

Carrying on, I've now found out what SDL is (http://www.libsdl.org/index.php)... but how can I change SDL settings with DosBox? Must I download, fix and recompile by hand? 😜

Oh by the way, thanks for this great emulator ^^ I've been waiting for years to try some of those old CDs I have stored.