Sound crackles & snaps when SDL volume not set at 100%

Bug #66483 reported by Jacob Peddicord
84
This bug affects 3 people
Affects Status Importance Assigned to Milestone
alsa-lib (Ubuntu)
Invalid
Medium
Unassigned
libsdl1.2 (Ubuntu)
Fix Released
Undecided
Unassigned
sdl-mixer1.2 (Debian)
Fix Released
Undecided
Unassigned

Bug Description

After an upgrade from Dapper to Edgy, sound in certain applications and games starts to crackle. A few affected apps are Wesnoth, Neverball, and Neverputt.
When playing the OGG files seperately, they sound fine.

http://ubuntuforums.org/showthread.php?p=1624910
The problem so far seems to only be affecting integrated Intel sound cards. (Unconfirmed for other cards)
Types are snd-hda and snd-intel8x0.

Setting in-game music and sound levels to 100% stops the crackling. Anything other than 100% volume, the sound will crackle. Sound effects, such as the sound volume fade in Neverball/putt, cause the crackle since the volume changes from 100% momentarily.

Also affects Feisty & Gutsy, however new information shows that the sound may still snap and pop even when the SDL mixer volume is set to 100%.

The problem does not occur when using an x86_64 system.

Revision history for this message
Xavier (chantry-xavier) wrote :

Since the apps where sound is crackling all seemed to use sdl mixer, I thought the issue was with it.
But I tried the sample app from there:
http://jcatki.no-ip.org/SDL_mixer/demos/

And it played one ogg sound from wesnoth just fine, while wesnoth itself apparently doesn't.

Same for neverball.
/usr/share/games/neverdata/bgm/inter.ogg is played in the Options menu.
It plays fine using sdlwav, but not using neverball.

Revision history for this message
Jacob Peddicord (jpeddicord) wrote :

Xavier, the problem may very well be the SDL mixer, since the sample app you used may have has its volume set to 100%, which is a workaround.

description: updated
Revision history for this message
Xavier (chantry-xavier) wrote : Re: [Bug 66483] Re: Sound (OGG) in certain applications crackles & snaps

Confirming that wesnoth and neverball music work fine with music
volume set to 100%
However in neverball, there are still a few crackles during the music
transition after clicking on a menu (like Options).
Also confirming the sdl sample app was setting music volume to 100%:
int volume=SDL_MIX_MAXVOLUME;
Mix_VolumeMusic(volume);

I changed it to Mix_VolumeMusic(volume-10) and I got the same crackles.

Revision history for this message
Jacob Peddicord (jpeddicord) wrote : Re: Sound (OGG) in certain applications crackles & snaps

I'm assigning this bug to sdl-mixer, since other applications that don't use it work fine. Changing the description also.

description: updated
Revision history for this message
covox (covox) wrote : Re: Sound (OGG) crackles & snaps when SDL volume not set at 100%

I'm experiencing the same problem (snd-hda-intel). The crackling isn't OGG exclusive; almost everything that SDL_mixer does is affected, and the problem is "fixed" by setting the volume to 100%.

Revision history for this message
JohGro (johan-gronqvist) wrote :

I have the same problem (in wesnoth under edgy), but my soundcard is not intel, I believe. The same "fix" of setting volume to 100% works. I also believe this bug does not affect "sound effects", but only "music" in wesnoth, although I do not know what is the difference.

From lspci:
00:14.5 Multimedia audio controller: ATI Technologies Inc IXP SB400 AC'97 Audio Controller (rev 02)

From lsmod:
snd_pcm 84612 4 snd_atiixp_modem,snd_atiixp,snd_ac97_codec,snd_pcm_oss
snd 58372 9 snd_atiixp_modem,snd_atiixp,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer

So I think this is not restricted to intel soundcards. (I use a compaq presario V5000 series laptop, sempron cpu)

Revision history for this message
simon (fast99) wrote :

Same problem here. I am using snd_intel8x0

Revision history for this message
Stinger (e-mindahl) wrote :

Exact same problem here , I have had it since dapper my sound card is Terratec Aureon sky 5.1 , it uses snd_ice1724 and lspci gives:
Multimedia audio controller: VIA Technologies Inc. VT1720/24 [Envy24PT/HT] PCI Multi-Channel Audio Controller (rev 01)

setting the inside music volume at max 100% solves the problem for Neverball but I have the exact same symptoms when I run my old Quake or HexenII games they also use sdl.

Revision history for this message
Jacob Peddicord (jpeddicord) wrote :

There seem to be enough reports now; setting this to Confirmed status.

Changed in sdl-mixer1.2:
status: Unconfirmed → Confirmed
Revision history for this message
Stinger (e-mindahl) wrote :

I have been testing Elive lately http://www.elivecd.org/ , another Debian based distro and noticed it did not suffer the same problem , so I made a note of the used libsdl packages in Elive and compared with Edgy.
It seems to be the same except one , Elive uses
libsdl 1.2 debian-esd where Edgy uses
libsdl 1.2 debian-alsa. So I thought , why not give it a try , and guess what , my problem is solved !
I have tried previously with the libsdl 1.2 debian-all package without any luck but the libsdl 1.2 debian-esd solved the darn issue lol. Ofcouse esd must be enabled for this to work , but it should be as default for Edgy.
Hope it works for other sound cards too.

Revision history for this message
Vytas (vytas) wrote :

using esd isn't a fix in fact, because it is becoming deprecated, also causes some latency, which is unwanted in realtime games I believe

Revision history for this message
Tobin Davis (gruemaster) wrote :

I was referred to this thread by one of the testers for the driver I have been developing (Conexant HD Audio support). I have been working on other Intel HD Audio Bus drivers as well (anything that uses snd-hda-intel). While I haven't been following the versions of alsa that are in each distribution, I do know there were some issues in earlier versions that have been fixed in 1.0.14 (currently at rc3).

One thing that would be beneficial is if people reporting issues included a link generated from http://bulletproof.servebeer.com/alsa/scripts/alsa-info.sh . This script was created by wishie in #alsa on irc.freenode.net, and has proven to be quite useful for debugging.

Thanks,

Tobin

Revision history for this message
Xavier (chantry-xavier) wrote :

I still have the same problem with another distrib (Archlinux), which recently upgraded to alsa 1.0.14rc3.
Since this isn't ubuntu specific, it's probably not the right place to talk about it.
So this is an alsa issue, not a sdl mixer one? Has it been reported in alsa bugzilla ?

I'm attaching the output of the script, because I don't know how long pastebin.ca will keep this :
http://pastebin.ca/458038

Revision history for this message
covox (covox) wrote :

Output of alsa-info.sh:

http://pastebin.ca/459337

Revision history for this message
Jan Kaláb (pitel) wrote :

Same problem, fresh Feisty installation, http://pastebin.ca/468616

Revision history for this message
Boris (batigolix) wrote :

similar problem (i think):

http://pastebin.ca/472199

description: updated
Revision history for this message
Elliot Winkler (elliot-winkler) wrote :

Definitely confirmed here (using snd-intel8x0). Audio sounds like it's playing through an ancient record player (as far as the crackling goes, anyway). Highly annoying, of course.

Output from alsa-info.sh: http://pastebin.ca/508984

Revision history for this message
Dennis (weerd01) wrote :

I have the same problem with an Intel Corporation 82801G chipset (snd-intel-hda). Supertux, neverball, flightgear, bzflag... they all have crackling sound :( Non SDL stuff plays perfectly.

Revision history for this message
terrax (tball) wrote :

I got the exactly the same problem. And it hasn't been fixed in the newest alsa (1.0.14rc4), if thats were the problem lies.

lspci:

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
snd-hda-intel

description: updated
Revision history for this message
Dennis (weerd01) wrote :

I'am now using the gutsy alsalib in feisty, and it all seems to work fine now. Beware you don't get in dependency problems (libc6). I had to modify libasound2_1.0.14-1ubuntu3_i386.deb to 'hack' it's libc6 dependency, but it appears to be working OK. There's probally an easier way, but then, i'am no .deb expert. Anyway: NO CRACKLING :D

Revision history for this message
Dennis (weerd01) wrote :

Ouch.. it's better, but not gone. The music in wesnoth sounds fine, goattracker works fine, but stuff like supertux, bzflag and neverball still have (but much less) crackles.

Revision history for this message
theanalogkid (mlyszczek) wrote :

I found putting

pcm.!default {
type hw
card 0
}

ctl.!default {
type hw
card 0
}

into .asoundrc fixes the issue with the crackling in Supertux and Neverputt (those are the two I've tried so far) for me. I have an Intel HDA chipset and I use libsdl-alsa.

Revision history for this message
Vytas (vytas) wrote :

yeah, but that disables software mixing, i.e. you cannot listed to music player and play neverputt at the same time

Revision history for this message
theanalogkid (mlyszczek) wrote :

I noticed that after I put it in. I changed .asoundrc to

pcm.!default {
type plugin
card 0
}

ctl.!default {
type hw
card 0
}

pcm.!default {
 type plug
 slave.pcm "dmixer"
}

pcm.dmixer {
 type dmix
 ipc_key 1024
 slave {
  pcm {
   type hw
   card 0
  }
  rate 44100
  period_time 0
  period_size 2048
  buffer_size 32768
 }
 slowptr 1
}

Seems to give me mixing and no crackling sdl games

Revision history for this message
Jan Kaláb (pitel) wrote :

Confirmed, it works! Neverball, Audacious & Frozen Bubble together without crackling. But PCM channel in alsamixer now doesn't work, I can use Front channel for volume changes, but I can hear sound even if it's set to 0. But mute works.

Revision history for this message
Eugenia Loli-Queru (eloli) wrote :

Please don't try to find hacks and tricks to make it work. This is a REAL driver bug and it must be fixed in its root: with C code. No scripts and mixers that break other things.

This bug exists for TWO years. It is time to get fixed.

Changed in sdl-mixer1.2:
status: Unknown → New
Revision history for this message
Daniel T Chen (crimsun) wrote :

Whether it's a driver issue or a userspace issue remains to be resolved. Does enabling slowptr for dmix explicitly resolve the symptom? (Note that alsa-lib 1.0.14 enabled slowptr by default, so this issue should not be reproducible in Gutsy.)

Changed in alsa-lib:
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Jacob Peddicord (jpeddicord) wrote :

Daniel:

If slowptr is enabled by default on Gutsy, then it isn't the fix. I am running Gutsy and the problem is 100% reproducible without any modifications to the sound system.

Revision history for this message
Daniel T Chen (crimsun) wrote :

Excellent, that's relevant and rules out dmix, leaving gain.

Revision history for this message
radsaq (radsaq) wrote :

I'm running feisty and I struggled and searched for weeks trying to find a solution to this problem before I stumbled across this bug. Merely adding slowptr 1 to my existing asoundrc fixed it.

Revision history for this message
Jonah (jhuckabay) wrote :

I was having the same problem in Feisty with the integrated audio on my Asus M2NPV-VM (NVidia Geforce 6150 / nForce 430) motherboard. lspci detects the audio device as "nVidia Corporation MCP51 High Definition Audio (rev a2)". theanalogkid's workaround works for me. (I just created ~/.asoundrc and copied and pasted the contents of his second post.)

Revision history for this message
Jeffrey Knockel (jeff250) wrote :

I have this problem for both feisty and gutsy with snd-hda-intel. Here's the output of alsa-info.sh:
http://pastebin.ca/630434
Adding slowptr 1 doesn't help, but it wasn't expected to since this is supposed to already be enabled on gutsy's version of alsa.

Revision history for this message
Jeffrey Knockel (jeff250) wrote :

I've narrowed my issue down to a commit and detailed it here in the following Alsa bug report:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3253
I don't think that everyone here has the exact same bug as I do, but you might be interested in following the report nonetheless.

Revision history for this message
Jeffrey Knockel (jeff250) wrote :

I was looking at the alsa code this evening and noticed that putting the following line into ~/.asoundrc should be a workaround for my issue:
defaults.pcm.dmix_max_periods -1
It seems to have solved the problem without any side effects, but only for some applications. Without this option, supertux is staticy, yet with it, it isn't. However, rott is just as staticy with this option as without. I don't really understand the alsa code enough to truly grok this option's implications. If you find that it resolves some issues, such as with supertux, it might be worth posting in the alsa bug thread that I started.

Revision history for this message
Ryan C. Gordon (icculus) wrote :

Hi, I'm one of the SDL_mixer developers.

Just to be clear about tracking this down, can someone do this before running the game:

export SDL_AUDIODRIVER=sdsdfsdf
./the_game_I_want_to_run

You should either get no audio or the game will fail or something. We're just confirming that the SDL_AUDIODRIVER parameter is being noticed.

Now try this:

export SDL_AUDIODRIVER=alsa
./the_game_I_want_to_run

...and see what happens. That will be SDL talking directly to ALSA for audio output (libasound, specifically).

Then try this:

export SDL_AUDIODRIVER=dsp
./the_game_I_want_to_run

...that's SDL talking directly to /dev/dsp (alsa's OSS emulation). See what happens.

I want to determine if it's a driver issue or our use of alsalib. Also, if anyone has programming experience, is it only causing a problem if Mix_MusicVolume() is changed in these games? Can we say that with certainty? If so, it may not be a driver issue at all and a general SDL/SDL_mixer bug.

I just need to eliminate some variables here, so I'd appreciate some feedback on this.

Thanks,
--ryan.

Revision history for this message
Jacob Peddicord (jpeddicord) wrote :

Hi ryan,
Thanks for taking the time to help us track this down.

Setting SDL_AUDIODRIVER to jibberish does cut off the sound, so the parameter does work.
Setting it to alsa works, but with fuzziness.
Setting it do dsp removes the fuzziness, but then there is the downside of using OSS instead of ALSA.

I'm downloading the source of Neverputt as I write this, and I'll post back if it seems like Mix_MusicVoulme is causing this.

So, with your results, we have two possible sources of the problem:
1) SDL_mixer crackles when Mix_MusicVoulme is not at 100% and is using ALSA.
2) ALSA crackles when the volume is not 100% (although non-SDL apps seem to work fine, so I kind of doubt this).

There might be a third problem, but I don't see it yet. Correct me if I'm wrong.

Thanks,
Jacob

Revision history for this message
Jacob Peddicord (jpeddicord) wrote :

Attached is the source of Neverball's (or Neverputt's) audio code. It does not use Mix_MusicVoulme, but instead Mix_VolumeMusic, which I would assume to be the same (again correct me if I'm wrong).

There are a few references to Mix_Volume* in any case (not the pointer, just referencing any type of volume operation) so hopefully this helps you out.

Thanks,
Jacob

Revision history for this message
Ryan C. Gordon (icculus) wrote :

(Sorry, that was a late night typo, I did mean Mix_

Revision history for this message
Ryan C. Gordon (icculus) wrote :

Argh, my comment got eaten.

Anyhow, the gist is that it's possible that SDL_mixer's volume routine is buggy and happens to be working when adjusting the audio for OSS's device format, but not the data format ALSA is expecting.

Can those having problems please compile the above attachment and run it a few times:

You'll need the compiler tools (apt-get install build-essential, I think) and the SDL development package (apt-get install libsdl1.2-dev, I think).

Compile it:
  gcc -o test-sdl-audio test-sdl-audio.c `sdl-config --cflags --libs`

Run it:
  SDL_AUDIODRIVER=assdf ./test-sdl-audio
  SDL_AUDIODRIVER=alsa ./test-sdl-audio
  SDL_AUDIODRIVER=oss ./test-sdl-audio

Then please post the output from all three runs to this bug report. The first run will produce an error, that's okay, it's just a sanity check.

Thanks!
--ryan.

Revision history for this message
Jeffrey Knockel (jeff250) wrote :

Here are my results:

$ SDL_AUDIODRIVER=assdf ./test-sdl-audio
SDL_OpenAudio() failed: No available audio device
$ SDL_AUDIODRIVER=alsa ./test-sdl-audio
desired: 16 bit signed audio (stereo) at 44100 Hz
obtained: 16 bit signed audio (stereo) at 44100 Hz
$ SDL_AUDIODRIVER=oss ./test-sdl-audio
SDL_OpenAudio() failed: No available audio device
$ SDL_AUDIODRIVER=dsp ./test-sdl-audio
desired: 16 bit signed audio (stereo) at 44100 Hz
obtained: 16 bit signed audio (stereo) at 44100 Hz

'SDL_AUDIODRIVER=dsafd supertux' had sound, so I'm going to disregard this game for the moment, at least for this bug report and as long as we are focusing in on sdl-mixer.

I downloaded neverball so that we can compare apples to apples here, and I ended up with similar results as Jacob.

'SDL_AUDIODRIVER=dsp neverball' results in crystal clear sound; however, 'SDL_AUDIODRIVER=alsa neverball' results with the static problem. The static problem consists in music playing staticy when not at 100% in-game volume; it plays crystal clear at 100% volume. Also, sound was slightly staticy at ANY volume. It is less staticy than the music is though. It was more obvious after I turned off the music and cranked up my speaker volume. Again, there is no static at all with oss/dsp.

Revision history for this message
Jacob Peddicord (jpeddicord) wrote :

Jeff:
The reason Supertux still had sound after messing with SDL variables is because Supertux doesn't use SDL (I'm not 100% on that, but I'm pretty sure). The latest version of Supertux in some repositories (reverted to the previous stable in others) just had its own sound problem I believe.

Ryan:
My results for the test app are the same as Jeff's, except the DSP driver also failed. I later realized that was because the OSS was in use, and running it again when it wasn't being used was successful.

Revision history for this message
Ryan C. Gordon (icculus) wrote :

Apparently this is happening with Neverball for Windows, too:

   http://www.nevercorner.net/forum/viewtopic.php?pid=10806#p10806

I think we have to rule out ALSA as the culprit, even if certain ALSA configurations can mitigate the issue.

I'm guessing this almost has to be an SDL_mixer bug, now.

--ryan.

Revision history for this message
Jeffrey Knockel (jeff250) wrote :

Jacob: re: supertux
Yes, I believe you are correct concerning supertux's lack of use of sdl-mixer. I was under the impression that it did because it used to, as the 0.1.x (stable) version uses sdl-mixer. However, it appears that supertux 0.3 (preview) no longer does.

Revision history for this message
Jacob Peddicord (jpeddicord) wrote :

Something I'd like to add:

I recently (yesterday) switched my laptop system to the x86_86 version... and all problems have disappeared. I'm not sure if this is a coincidence with an update or if the 64-bit version just does not have this bug. Can anyone confirm?

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Revision history for this message
jammnrose (jammnrose) wrote :

Hi, I am one of the devs. for Neverball and this occurs under all platforms; Windows, Linux, OS X. We have had this bug for a long while at it does seem to be an sdl-mixer problem as we have had looked over our audio code... It also didn't crackle in the last major release.

Revision history for this message
Jānis Rūcis (parasti-deactivatedaccount-deactivatedaccount) wrote :

Another Neverball contributor here.

After a couple of unsuccessful attempts to locate a good version of SDL_mixer, I gave up and switched my attention to SDL. (Note: I'm using Debian, but I am aware that this issue also occurs on various other operating systems and should be treated as such.)

There are old libsdl1.2 Debian packages available at http://snapshot.debian.net/package/libsdl1.2. By using dpkg to downgrade the libsdl1.2debian-alsa package, I quickly managed to locate the last known-good version, which is "1.2.7+1.2.8cvs20041007-5" (trailing "5"). The version right after this one, "1.2.7+1.2.8cvs20041007-5.1" (trailing "5.1"), has the problem.

My understanding is that the upstream sources used for both packages are identical. Locating the cause of the issue should be a matter of looking at the diff of debian subdirectories of those packages by a person familiar with SDL and Debian packaging. But unfortunately, I am not that person.

Revision history for this message
Eugenia Loli-Queru (eloli) wrote :

That was very helpful, thank you Janis. Hopefully the Ubuntu devs will have a look soon.

description: updated
Revision history for this message
Pascal Vandeputte (pascal-vdp) wrote :
Download full text (6.1 KiB)

Hi,

I've been suffering from this typical crackling sound problem with Unreal Tournament GOTY (also SDL, also known as UT99) and many game console emulators for about a year now, but hadn't really looked into it yet.

Today I was trying to get SDLMess to work on my Gutsy laptop (HP nx7400, C2D, integrated video (GMA950 aka Intel 945GM) and of course snd-hda-intel). Sound was garbled as usual and now I've come across this thread. I tried the workarounds but nothing helps (and export SDL_AUDIODRIVER=dsp doesn't play anything unfortunately, although /dev/dsp is available and osstest works fine)

So I was now checking out some sdlmess option which disables the video output of the emulator... and all of a sudden the sound is perfect (using ALSA default)! How cool is that? (not very cool as I've got no video, but still)

I've enabled verbose output and discovered a few peculiarities when comparing a game load with and without video (check the last two lines!):

This is WITH video:

$ mess -verbose
Parsing mess.ini
Parsing mess.ini
Build version: 0.121u1 (Dec 8 2007)
Build architecure: SDLMAME_ARCH=
Build defines: SDLMAME_UNIX=1 SDLMAME_X11=1 SDLMAME_LINUX=1 LSB_FIRST=1 NDEBUG=1
SDL/OpenGL defines: SDL_COMPILEDVERSION=1211 USE_OPENGL=1 USE_DISPATCH_GL=1
Compiler defines A: __GNUC__=4 __GNUC_MINOR__=1 __GNUC_PATCHLEVEL__=3 __VERSION__="4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)"
Compiler defines B: __unix__=1 __i386__=1
SDL Device Driver : x11
SDL Monitor Dimensions: 1680 x 1050
Using SDL single-window soft driver (SDL 1.2)
Input: Adding Kbd #1: System keyboard
Input: Adding Mouse #1: System mouse
Joystick: Start initialization
Joystick: End initialization
Audio initialized - driver: alsa, frequency: 48000, channels: 2, samples: 2229
sdl_create_buffers: creating stream buffer of 57344 bytes
Parsing mess.ini
Parsing mess.ini
Build version: 0.121u1 (Dec 8 2007)
Build architecure: SDLMAME_ARCH=
Build defines: SDLMAME_UNIX=1 SDLMAME_X11=1 SDLMAME_LINUX=1 LSB_FIRST=1 NDEBUG=1
SDL/OpenGL defines: SDL_COMPILEDVERSION=1211 USE_OPENGL=1 USE_DISPATCH_GL=1
Compiler defines A: __GNUC__=4 __GNUC_MINOR__=1 __GNUC_PATCHLEVEL__=3 __VERSION__="4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)"
Compiler defines B: __unix__=1 __i386__=1
Using SDL single-window soft driver (SDL 1.2)
Input: Adding Kbd #1: System keyboard
Input: Adding Mouse #1: System mouse
Joystick: Start initialization
Joystick: End initialization
Audio initialized - driver: alsa, frequency: 48000, channels: 2, samples: 2229
sdl_create_buffers: creating stream buffer of 57344 bytes
Average speed: 83.57% (9 seconds)
Sound buffer: overflows=0 underflows=216
$

And this is without:

$ mess -verbose -video none
Parsing mess.ini
Parsing mess.ini
Build version: 0.121u1 (Dec 8 2007)
Build architecure: SDLMAME_ARCH=
Build defines: SDLMAME_UNIX=1 SDLMAME_X11=1 SDLMAME_LINUX=1 LSB_FIRST=1 NDEBUG=1
SDL/OpenGL defines: SDL_COMPILEDVERSION=1211 USE_OPENGL=1 USE_DISPATCH_GL=1
Compiler defines A: __GNUC__=4 __GNUC_MINOR__=1 __GNUC_PATCHLEVEL__=3 __VERSION__="4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)"
Compiler defines B: __unix__=1 __i386_...

Read more...

Revision history for this message
Pascal Vandeputte (pascal-vdp) wrote :

Because my post was rather long, I'll summarize it here:

System: Core 2 Duo, GMA950/945GM, snd-hda-intel, 1680x1050

- SDLMess was producing garbled sound on my Core 2 Duo because the load was too large (interpolation to a very high resolution); switched resolution => fixed
- This method did NOT do anything for Unreal Tournament (also SDL and very similar symptoms).
- Adding "options snd_hda_intel position_fix=1" to /etc/modprobe.d/options + reboot fixed UT as well

What's the real issue here isn't clear though.

Greetings,

Pascal

Revision history for this message
Vytas (vytas) wrote :

Maybe this bug is not that important at all?

For Hardy Heron, Ubuntu may be heading to Pulse Audio as universal solution [1]. I tried pulseaudio on my Ubuntu 7.10 PC, it works nice (there are instructions how to do it [2]). Pulseaudio emulates esd very well, because it is a replacement for esd. So I asked SDL to output sound via ESD, by installing package libsdl1.2debian-esd. My speakers aren't very good but what I hear sounds OK or at least much much better compared to crackling sound via alsa. Probably thanks to pulseaudio, latency is also very good.

[1] https://blueprints.launchpad.net/ubuntu/+spec/cleanup-audio-jumble
[2] https://wiki.ubuntu.com/PulseAudio

Revision history for this message
Ryan C. Gordon (icculus) wrote :

The latest stable version of SDL supports PulseAudio directly, too, fwiw, so you don't have to go through the ESD wrapper.

--ryan.

Revision history for this message
Vytas (vytas) wrote :

Even better, I was using what is available on 7.10 repos

Revision history for this message
Ralf Nieuwenhuijsen (ralf-nieuwenhuijsen) wrote :

Bug is stil valid on Gutsy though!

However the export SDL_AUDIODRIVER workaround no longer works here.
Neverball just has no sound, with anything without alsa.

Installing libsdl1.2-debian-esd did not result in working sound either.
Installing libsdl1.2-debian-oss did the trick.

But I would have preferred the esd workaround for the time being.
Am I missing something here? Do I need to configure esd?

Revision history for this message
sarain (rainwater5) wrote :

I am experiencing the same crackling issue in neverball. I found the following post as a neverball bug but it might be a good clue:
http://lists.alioth.debian.org/pipermail/pkg-games-devel/2007-September/004866.html

and the users response:
http://lists.alioth.debian.org/pipermail/pkg-games-devel/2007-September/004877.html

I tried downloading this stereo version but the package installer was not able to find a dependency, which is weird because I already have the regular version installed. The version I use came from the repositories.

It sounds like it might be worth looking at whether stereo and mono audio use different mixer code.

Revision history for this message
bloo (bloo) wrote :

I can reproduce the crackling issue using neverball in Hardy final.

Revision history for this message
covox (covox) wrote :

Still no solution for this problem, however there -is- now a viable workaround.

In Hardy, the "standard sound server" is meant to be PulseAudio, and so far from my experience it isn't bad. I say "meant to be", if you've upgraded from Gutsy you probably have to follow these instructions - https://wiki.ubuntu.com/PulseAudio .

The key is the package libsdl1.2debian-pulseaudio, which replaces libsdl1.2debian-alsa. Set up PulseAudio according to the instructions, get this SDL package, and there's no more crackling. Even if you fiddle with the volume.

Of course, this doesn't address the issue for people who don't want a hulking great sound server and just want the bare-bones ALSA plugin to work as it should. Still it's worth a mention.

Revision history for this message
Vytas (vytas) wrote :

On my system, libsdl1.2debian-pulseaudio crackles too, probably because of a different bug. I have reported it a few months ago: https://bugs.launchpad.net/ubuntu/+source/libsdl1.2/+bug/188986 .

However, libsdl1.2debian-esd seems to work fine

Revision history for this message
Jeff Fortin Tam (kiddo) wrote :

on my system, installing libsdl1.2debian-pulseaudio crackles, but much less than libsdl1.2debian-all. So it's a bit better, but not crackle-free.

Revision history for this message
Jeff Fortin Tam (kiddo) wrote :

oh wait, that was for neverball/neverputt only.

Installing libsdl1.2debian-pulseaudio creates an insane amount of crackling in Tremulous, whereas libsdl1.2debian-all did not crackle at all. Weird.

Revision history for this message
tylerjwilk (tylerjwilk) wrote :

On Ubuntu 8.04 32bit I am getting the same issues with SDL games thru pulseaudio. I'm using the libsdl-debian-pulse package. Sound card is nVidia. CPU 64bit running 32bit ubuntu. I am getting this problem with the Urban Terror game

Revision history for this message
Vytas (vytas) wrote :

tylerjwilk, basically it's the bug of pulseaudio: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/190754
I worked around that by setting these values in /etc/pulse/daemon.conf:
default-fragments = 8
default-fragment-size-msec = 5

Another workaround that worked for me is using libsdl1.2debian-esd, but that may increase latency I guess.

For libsdl1.2debian-pulseaudio I filed another bug before I wasn't aware it may be problem of pulseaudio itself: https://bugs.launchpad.net/ubuntu/+source/libsdl1.2/+bug/188986

Revision history for this message
Vytas (vytas) wrote :

Btw, for your sound card these optimal pulseaudio configuration values may be different, plus I've taken them from Ubuntu forum and aren't 100% sure what they do

Revision history for this message
pannenleiter (edwin-pannenleiter) wrote :

Unfortunately things went worse.

Up to 8.04 "export SDL_AUDIODRIVER=dsp" stoped crackling. After upgrading to 8.10 dsp crackles worse than alsa.

SDL_AUDIODRIVER=alsa works fine with the .asoundrc from theanalogkid, but SDL_AUDIODRIVER=dsp crackles maddening in any case.

Revision history for this message
Julius Schwartzenberg (jschwart) wrote :

The problems with sound crackles in the ALSA driver seem to have to do with assembly code that wasn't always turned on in older versions. For more details, see this bug:
http://bugzilla.libsdl.org/show_bug.cgi?id=649

I've rebuilt the Ubuntu libsdl packages with --disable-assembly which seems to solve this issue. Those packages can be found here:
http://haar.student.utwente.nl/~julius/debs/hardy/libsdl/

Try those when you have problems with the ALSA driver.

Revision history for this message
Ivo Danihelka (ivo-danihelka) wrote :

What sample rate are you using in Wesnoth?
Wesnoth allows to set the sample rate in:
Preferences -> Sound -> Advanced Options -> Sample Rate

Sample rate 44100 is without any cracking for me (updated Hardy, ALSA, snd_hda_intel).
Sample rate 22050 has cracking.

Revision history for this message
Ryan C. Gordon (icculus) wrote :

We believe (but aren't sure) that there are two issues here, and both are in SDL itself, not the games, SDL_mixer, or ALSA.

Those that are so inclined, it would be useful if you would update to the latest subversion of SDL 1.2 and see if it fixes the issue.

   svn co http://svn.libsdl.org/branches/SDL-1.2
   cd SDL-1.2
  ./autogen.sh
  ./configure
  make
  sudo make install

(you'll need the appropriate -dev packages, but if you don't know what that means, you should probably let someone else test instead.)

Please make sure to test with this new SDL build and not the current system-installed library!

--ryan.

Revision history for this message
mbeach (mbeaches) wrote :

Ryan - not 100% sure this is the bug I should be looking at, but I seem to have a similar crackling noise when viewing flv files in Totem. First thing I tried was your SDL-1.2 branch. Previously, pausing and playing the file would remove the crackling - so it wasn't always present (hence my reason for suspecting this bug may not be my issue).

Regardless, using a screencast downloaded from http://screencasters.heathenx.org/wp-content/videos/ep070/ep070.html as my test file, it crackled like crazy, pausing and playing several times would occasionally remove the crackle. After applying the latest from svn, it appears that the crackle is still there but the pausing and playing seems to be more successful, less likely to hear the crackle than not. It also sounds like the crackle starts for a nano second but then stops in many cases when resuming playing the file.

Apologies if this is a red herring, just haven't seen any follow ups to your request so I thought I'd give it a go.

Revision history for this message
Julius Schwartzenberg (jschwart) wrote :

The problem concerning this bug should be solved in the latest upstream version.

Revision history for this message
Jeffrey Knockel (jeff250) wrote :

The alsa/sdl crackling issues were fixed in libsdl 1.2.14, which is in lucid, so I will close this bug. If you are still experiencing crackling issues with lucid, you are probably experiencing a new bug and should consider filing a new one.

Changed in sdl-mixer1.2 (Ubuntu):
status: Confirmed → Invalid
affects: sdl-mixer1.2 (Ubuntu) → libsdl1.2 (Ubuntu)
Changed in libsdl1.2 (Ubuntu):
status: Invalid → Fix Released
Revision history for this message
Tobin Davis (gruemaster) wrote :

This bug was fix released a long time ago.

Changed in sdl-mixer1.2 (Debian):
status: New → Unknown
importance: Unknown → Undecided
status: Unknown → New
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.