I noticed that zsnes had some weird sound problem, the sound was slightly distorted, like it was mixed together with some background static from a radio. After investigating some I found that recompiling libsdl with USE="oss" fixes it. So apperantly it can't handle alsa too good. I think this happens in other apps that use sdl for sound too.
The temporary fix is to remove the oss useflag and always compile libsdl as if the oss useflag was set, but the bug with alsa should be fixed.
and it seems like I'm not the only one with this problem:
(In reply to comment #0)
You don't need to recompile libsdl, it uses SDL_AUDIODRIVER variable and as
temporary solution you can set desired driver there (I recommend esd).
Please see http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fenvvars.
But alsa output indeed should be fixes, I have this problem too.
I remember that lately, a change in alsa had fixed some sound problem.
Would you mind updating your system (kernel and alsa-*) and then retesting it?
(In reply to comment #3)
> I remember that lately, a change in alsa had fixed some sound problem.
> Would you mind updating your system (kernel and alsa-*) and then retesting it?
Doesn't help over here (ALSA version 1.0.12, using alsa-driver).
Portage 2.1.1 (selinux/2005.1/x86/hardened, gcc-3.4.6, glibc-2.3.6-r4, 2.6.17-hardened-r1 i686)
System uname: 2.6.17-hardened-r1 i686 Intel(R) Pentium(R) 4 CPU 1.60GHz
Gentoo Base System version 1.12.4
Last Sync: Wed, 13 Sep 2006 14:50:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-util/ccache: [Not Present]
dev-util/confcache: [Not Present]
sys-devel/autoconf: 2.13, 2.60
sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
CFLAGS="-O2 -pipe -march=pentium4 -fomit-frame-pointer"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=pentium4 -fomit-frame-pointer"
FEATURES="autoconfig collision-protect distlocks loadpolicy parallel-fetch sandbox selinux sfperms strict stricter userfetch userpriv usersandbox"
GENTOO_MIRRORS="ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
USE="x86 X a52 aac alsa bzip2 caps cjk crypt cups dts dvd dvdread elibc_glibc ffmpeg flac ftp gif gtk hardened idn input_devices_keyboard input_devices_mouse ipv6 jpeg kdeenablefinal kernel_linux linguas_en mad mikmod mmx mp3 ncurses nptl offensive ogg opengl pam pdf pic png selinux sse sse2 ssl symlink theora threads tiff truetype unicode userland_GNU video_cards_nvidia vorbis win32codecs xinerama xv xvid zlib"
Unset: CTARGET, INSTALL_MASK, LC_ALL
still an issue with alsa-lib-1.0.12
I don't have an x86 system to check this, but are we sure the problem is in ALSA rather than libsdl?
By the way, 1.0.13 is out for a while now.
(In reply to comment #6)
> I don't have an x86 system to check this, but are we sure the problem is in
> ALSA rather than libsdl?
To me, this looks more like a problem in libsdl, as it *only* happens in programs (games) that play sound via SDL, which, in turn, uses ALSA.
> By the way, 1.0.13 is out for a while now.
Doesn't change anything for me.
games-strategy/wesnoth used to have this problem. In version 1.2.1, the following change was made (from the changelog):
* set default sample rate to 44100 hz as most user got cracking sound pb
The static is gone now. If I set the sample rate back to 22050Hz (it is configurable now), it reappears.
I see the same problem with zsnes: If I set the mixing rate to 22050 or 44100 it sounds very bad, but if I use 48000 (which is the only mixing rate that driver/card supports), everything is fine. I'll see if I get the time to investigate further tomorrow
sounds like a resampling bug in alsa, not libsdl
use the frequency your card uses rather than forcing downsampling