Sound is stuttering using libsdl1.2debian-pulseaudio and alsa packages.

Bug #429373 reported by Vidar Waagbø
122
This bug affects 20 people
Affects Status Importance Assigned to Milestone
dosbox (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: dosbox

DOSBox audio is not working properly with the libsdl1.2debian-pulseaudio or the alsa package. The sound is constantly stuttering. Works fine if you use the libsdl1.2debian-esd. This problem applies to both v0.72 and v0.73.

Revision history for this message
Matt Giuca (mgiuca) wrote :

Here's what I'm experiencing (I think it's the same bug but not sure): The sound works fine *except* every 3 or 4 seconds, it speeds up to a high-pitched speed for a tiny fraction of a second. This creates a high-pitched click sound on what is otherwise normal.

This is in Jaunty, package version 0.72-1.1build1. Also affects a source build from upstream 0.73, but only on Ubuntu (works fine for me in Windows).

I can't figure out how to change between libsdl1.2debian-pulseaudio and libsdl1.2debian-esd (as recommended in the above report). I don't even know which one I'm using.

Revision history for this message
Matt Giuca (mgiuca) wrote :

Oh, I see. You apt-get install libsdl1.2debian-esd and it will remove pulseaudio.

Revision history for this message
rCX (rcx) wrote :

For those who want to stick with pulseaudio, reducing the mixer's rate in the dosbox.conf file often fixes this problem. If the dosbox.conf hasn't been created already, run dosbox and type "config -writeconf dosbox.conf" into the prompt. This should create a "/home/username/dosbox.conf" file. Open it and scroll down to the line that says "rate=22050" and change it to "rate=11025" or something lower like 8000.

Revision history for this message
Vidar Waagbø (waagbo) wrote :

Hmm... a possible workaround, but not a satisfactory solution. DOSBox is fully capable to run DOS application wich ouputs a samplingrate of 44100 (CD quality audio). Is this a problem with the way DOSBox handles audio or is it perhaps a problem with the SDL/Pulseaudio plugin (I've only been able to reproduce this using dosbox + libsdl1.2debian-pulseaudio, other applications works fine with the pulseaudio lib)!?!

Revision history for this message
Julien Olivier (julo) wrote :

Hi,

I've just upgraded to karmic and, while I had perfect sound in dosbox 0.73 on Jaunty, now I have crackling sound with the same dosbox 0.73.

I tried different libsdl outputs and I found out that libsdl-pulseaudio is actually way better for me than libsdl-esd. Esd output is more crackled and has much more latency.

I also tried removing pulseaudio completely and using libsdl-alsa, but the result is very similar to using libsdl-pulseaudio with pulseaudio running.

So I guess we have two problems here:
 1) libsdl-esd is broken in comparison to libsdl-pulseaudio (bad sound quality and high latency).
 2) dosbox sound is somewhat broken on karmic, independently from pulseaudio ou sdl.

I also did some tests unrelated to dosbox: I tried running sdlmame on the same computer (the common point being SDL, of course). If I try a CPU-intensive game, I can have the exact same problem with crackling sound, but I don't see much difference between libsdl-pulseaudio and libsdl-esd.

I also tried Odd (http://happypenguin.org/show?Odd), a game using SDL, and I get perfect sound with libsdl-pulseaudio, but crackling sound with linsdl-esd.

PS: Sorry if some information is unrelated to this bug, but I have the feeling that maybe all the problems described are somewhat related...

Revision history for this message
Michał Gołębiowski-Owczarek (mgol) wrote :

@Vidar Waagbø
I can confirm this workaround, setting rate to 44100 "sort of" helps (many of my apps, like Lemmings, don't have sound but I'm not sure when I run them last time, so...).

Revision history for this message
ezekiel000 (ezekiel000) wrote :

I have the same problem with dosbox but switching between libsdl-alsa, libsdl-pulseaudio or libsdl-all didn't changed anything but switching to libsdl-esd fixed the problem.

I'm running Ubuntu 9.10 amd64 with a 5880B AudioPCI sound card.

rCX (rcx)
Changed in dosbox (Ubuntu):
status: New → Confirmed
Revision history for this message
rCX (rcx) wrote :

Two threads have been created about this problem in the last week. Both were users who upgraded to karmic...
http://ubuntuforums.org/showthread.php?t=1300669
http://ubuntuforums.org/showthread.php?t=1306711
I'm marking this as confirmed because of the number of reported problems. Was libsdl1.2debian-pulseaudio changed between Jaunty and Karmic?

Revision history for this message
Adam (adamcbrewer) wrote :

I had the same problem.

I just played around with all the settings until I increased the mixer prebuffer from 10 to 50.
My mixer rate is even set at 44100, and so far no problems. Still kept the blocksize at default.

Revision history for this message
Adam (adamcbrewer) wrote :

P.S. on my above comment...

I'm using Pulseaudio from a standard Karmic install.

Revision history for this message
Vidar Waagbø (waagbo) wrote :

Hi,
Setting all the rates mixing rates in dosbox.conf to 44100 instead of the default value 22050 will decrease the intensity of the stuttering and sound glitches (confirmed by me and Michał Gołębiowski). This is probalbly

As Adam told us in the last post. I can confirm that increasing the buffer in the config file will reduce problems even further (to a near perfect situation). Tested with 'dunemidi.exe' Adlib playback program and 'lotus.exe' from Lotus - The Ultimate Challenge.

Are there any buffering differences between the esound and pulseaudio SDL libraries as the pulseaudio driver apparently needs a bigger buffer to work properly?

Note:
Dosbox 0.73 does not create a config file unless you tell it to (by typing config -writeconf). I have included my dosbox.conf file. It is optimized for use with the libsdl1.2debian-pulseaudio package. All the playback rates are set to 44100 and the mixer buffer is set to 50ms instead of 10ms as Adam recommended.

Revision history for this message
Vidar Waagbø (waagbo) wrote :

Hmm...
Posted the wrong attachment.
This comment contains the dosbox.conf file i use to get correct audio output.

Revision history for this message
E.L.K. (some-any-key) wrote :

Hello.

I'm expirienced similar problems with alsa output of dosbox.

I had tried to switch to different outputs and found out that with pulseaudio or oss output sound more-less normal, but it remains behind it should be at half of second or so on.

When using alsa output, along with stuttering, sound also remains behind is should be at second or two or so on.

Revision history for this message
Michał Gołębiowski-Owczarek (mgol) wrote :

For anyone who wants to have usable DOSBox without multiple hacks - removing PulseAudio helps (otherwise You don't have true ALSA but only PA's ALSA emulation which supports only ~ 70% of ALSA specs). And ALSA in Karmic even supports hardware mixing so you don't need to install esound.

PA causes so many problems these days, still. I will keep away of it as long as possible...

Revision history for this message
igorsh (ishipenkov) wrote :

i use ubuntu karmic 64-bit version and dosbox 0.73 with default libsdl1.2debian-pulseaudio.
i just set rates in mixer, sblaster and gus sections to 44100 and set prebuffer=100 in mixer section.
sound isn't sluttering now.

Revision history for this message
jasonmporta@gmail.com (jasonmporta) wrote :

As Vidar Waagbø posted, I set my dosbox.conf playback rates to 44100 and buffer to 50. No more stuttering, and I didn't have to remove any packages.

Revision history for this message
tlp (tlp) wrote :

I can confirm that using rate=11025 corrects the problem on Lucid Lynx. Tested with Prince of Persia.

Revision history for this message
Nomax (nomax) wrote :

Setting playback rates at 44100 and buffer to 40 did it for me too.

shankao (shankao)
tags: added: jaunty
tags: added: karmic
tags: added: lucid
Revision history for this message
shankao (shankao) wrote :

In the latest version of dosbox (tested on raring), the rate seems to be set to 44100 and prebuffer to 20 by default everywhere. Can anybody experiencing this problem check if it's being resolved?

As a side note, uninstalling any pulseaudio package is not a good solution but just a temporal workaround. It is the sound server used in ubuntu in the default installations.

Changed in dosbox (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for dosbox (Ubuntu) because there has been no activity for 60 days.]

Changed in dosbox (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers