VOGONS

Common searches


First post, by jrial

User metadata
Rank Newbie
Rank
Newbie

I am having issues getting sound to work in DOSBox. Sound sometimes plays, but when it does, it's intermittent. It will play for half a second, then nothing for a while, then perhaps a second, or a quarter of a second. Etc...

I've already played with the settings. I solved the Midi issue (use the correct port), but the issue is not Midi related, so that resolved nothing.

Currently, my settings look like this:

[sdl]
fullscreen=true
fulldouble=false
fullresolution=original
windowresolution=original
output=opengl
autolock=true
sensitivity=100
waitonerror=true
priority=higher,normal
mapperfile=mapper.txt
usescancodes=true

[dosbox]
language=
machine=svga_s3
captures=capture
memsize=16

[render]
frameskip=0
aspect=false
scaler=normal2x

[cpu]
core=auto
cycles=auto
cycleup=1000
cycledown=1000

[mixer]
nosound=false
rate=44100
blocksize=1024
prebuffer=80

[midi]
mpu401=intelligent
device=default
midiconfig=14:0

[sblaster]
sbtype=sb16
sbbase=220
irq=7
dma=1
hdma=5
mixer=true
oplmode=auto
oplrate=44100

[gus]
gus=false
gusrate=22050
gusbase=240
irq1=5
irq2=5
dma1=3
dma2=3
ultradir=C:\ULTRASND
Show last 27 lines

[speaker]
pcspeaker=false
pcrate=22050
tandy=auto
tandyrate=22050
disney=false

[joystick]
joysticktype=4axis
timed=false
autofire=false
swap34=false
buttonwrap=true

[serial]
serial1=dummy
serial2=dummy
serial3=disabled
serial4=disabled

[dos]
xms=true
ems=true
umb=true
keyboardlayout=none

There's a second config file that reads as such:

[glide]
glide=false

[ipx]
ipx=false

[autoexec]
@echo off
cls
mount C "./S2"
imgmount d "./S2/GAME.DAT" -t iso
c:
cls
s2.bat
cls
exit

This comes from the game Screamer 2 (Steam version), but the intermittent sound has occurred in other DOSBox games as well, also GOG versions, so I'm posting this in the general forum.

System info:

I'm running Linux Mint. The issues have persisted over various versions of Mint on this machine.
Kernel version: 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
The audio is piped over the HDMI output of my videocard, a GeForce GTX 750 Ti
Audio server is Pulseaudio, using Alsa

When starting this particular game, my output is:

Starting DOSBox
DOSBox version 0.74
Copyright 2002-2010 DOSBox Team, published under GNU GPL.
---
CONFIG:Loading primary settings from config file ./dosbox_screamer2.conf
CONFIG:Loading additional settings from config file ./dosbox_screamer2_single.conf
MIXER:Got different values from SDL: freq 44100, blocksize 512
ALSA:Client initialised [14:0]
MIDI:Opened device:alsa
DOSBox switched to max cycles, because of the setting: cycles=auto. If the game runs too fast try a fixed cycles amount in DOSBox's options.
Done.

I always get the MIXER warning: regardless of what I set for blocksize, the DOSBox mixer always gets half that from SDL. Not sure what's going on there. I even tried commenting the blocksize and prebuffer out, and it appears to default to 1024 for blocksize, because I get the warning for 512 in that case.

I also tried manually setting the clockspeed, tried everything between 80.000 to 200.000 cycles/millisecond, and some appeared to work better than others, but none worked fine. It's also very inconsistent: when setting to auto, sometimes I get the intermittent sound, sometimes no sound at all, so "some appeared to work better than others" may be just a roll of the dice.

If more info is needed, let me know.

Reply 2 of 12, by jrial

User metadata
Rank Newbie
Rank
Newbie

[DIT] Both the 0.80 staging version and 0.81 release candidate have the same issue.

Decided to dig some more into this issue, and it appears to be related to fullscreen. When I remove all settings from the first file, but leave "fullscreen=true" in, I get the sound issues. When I leave all settings as above, but comment the fullscreen line out, or set it to false, sound plays normal. Haven't tried this with all games, but can confirm this holds true for at least Screamer 2 (Steam) and Master of Orion 2 (GOG).

Last edited by jrial on 2023-12-24, 00:13. Edited 1 time in total.

Reply 6 of 12, by zirkoni

User metadata
Rank Member
Rank
Member

I have Linux Mint on my laptop and have no sound issues with either DOSBox SVN or DOSBox Staging. I even tested Screamer 2 (SVGA, non-Steam version) in fullscreen and sound was fine.

https://youtube.com/@zirkoni42

Reply 7 of 12, by jrial

User metadata
Rank Newbie
Rank
Newbie

I doubt it's SDL related. I remember having this exact same issue years ago, which is why I never bothered playing games in DOSBox on this machine. I had a laptop, also running Mint (or perhaps Debian), that didn't have that issue at the time.

So my guess is either a configuration issue, or something hardware-specific. But I can't make sense of it: the machine isn't the newest or most performant (quad core i5-4690K @ 3.5GHz, 32GB of RAM), but the laptop was even less performant. Its not like the graphics card can't output audio and video at the same time in fullscreen; it's my main game machine, and apart from DOSBox, everything seems to run fine.

I've uploaded two videos to YouTube to show the issue:

Is there a way I could get some more logging out of DOSBox, that might shed some light onto what's happening?

Reply 9 of 12, by jrial

User metadata
Rank Newbie
Rank
Newbie
leileilol wrote on 2023-12-24, 16:26:

Tried setting all the rates to 48000?

Tried that just now, no difference. Except now I get no sound at all, but it's really inconsistent. Some runs with the previous values get intermittent sound, some no sound at all.

Reply 10 of 12, by jrial

User metadata
Rank Newbie
Rank
Newbie

I resolved my issue!

For future reference, in case anyone encounters the same issue as me, here's how: I switched to staging v0.80, where the same issue manifested itself, and looked at the verbose output. Especially the warnings, which are conveniently highlighted in yellow. I removed all unknown or deprecated options from the config file, and changed the values to the suggested default where it warned me that the value was invalid. E.g. where it said "CONFIG: "higher,normal" is an invalid value for: active. Using the default: auto", I changed the corresponding config line (in this case [sdl] => priority) to "auto".

My corresponding config file now looks like this:

[sdl]
fullscreen=true
fullresolution=default
windowresolution=default
output=opengl
waitonerror=true
priority=auto
host_rate=60

[mouse]
mouse_sensitivity=100

[dosbox]
language=
machine=svga_s3
captures=capture
memsize=16

[render]
aspect=false

[cpu]
core=auto
cycles=auto
cycleup=1000
cycledown=1000

[mixer]
nosound=false
rate=44100
blocksize=1024
prebuffer=80

[midi]
mpu401=intelligent
midiconfig=14:0

[sblaster]
sbtype=sb16
sbbase=220
irq=7
dma=1
hdma=5
oplmode=auto

[gus]
gus=false
gusbase=240
ultradir=C:\ULTRASND

[speaker]
pcspeaker=discrete
tandy=auto

[joystick]
joysticktype=4axis
timed=false
autofire=false
swap34=false
buttonwrap=true
Show last 13 lines

[serial]
serial1=dummy
serial2=dummy
serial3=disabled
serial4=disabled

[dos]
xms=true
ems=true
umb=true
keyboardlayout=none

Reply 12 of 12, by jrial

User metadata
Rank Newbie
Rank
Newbie

Update: managed to get it working with the included dosbox v0.74 as well now. The issue was with the fullscreen resolution. If I set it to "original" or the game's native "640x480", sound is intermittent or absent. But by setting it to double that, and then use a 2x scaler (forced, as it refused to use it otherwise), I now get flawless sound in fullscreen on v0.74 as well.

I have no idea why 640x480 is such a problem, but at least I now know how to fix it. Did a quick test with Master of Orion 2, and the same fix works there as well. So I'm confident this is the correct solution, even though I still don't understand what the problem is. It's probably something very specific to my system, since nobody else seems to experience the same issues.

Anyway, thanks everyone for the help.

Corresponding config file, for completeness:

[sdl]
fullscreen=true
fulldouble=false
fullresolution=1280x960 # This was changed
windowresolution=original
output=ddraw
autolock=true
sensitivity=100
waitonerror=true
priority=higher,normal
mapperfile=mapper.txt
usescancodes=true

[dosbox]
language=
machine=svga_s3
captures=capture
memsize=16

[render]
frameskip=0
aspect=false
scaler=normal2x forced # This was changed

[cpu]
core=auto
cycles=auto
cycleup=1000
cycledown=1000

[mixer]
nosound=false
rate=22050
blocksize=2048
prebuffer=1024

[midi]
mpu401=intelligent
device=default
config=

[sblaster]
sbtype=sb16
sbbase=220
irq=7
dma=1
hdma=5
mixer=true
oplmode=auto
oplrate=22050

[gus]
gus=false
gusrate=22050
gusbase=240
irq1=5
irq2=5
dma1=3
dma2=3
ultradir=C:\ULTRASND
Show last 27 lines

[speaker]
pcspeaker=true
pcrate=22050
tandy=auto
tandyrate=22050
disney=true

[joystick]
joysticktype=auto
timed=true
autofire=false
swap34=false
buttonwrap=true

[serial]
serial1=dummy
serial2=dummy
serial3=disabled
serial4=disabled

[dos]
xms=true
ems=true
umb=true
keyboardlayout=none