sound distortion with 1.4.X, 1.5.X

Having trouble with the game? Report issues and get help here. Read this first!

Moderators: Forum Moderators, Developers

Forum rules
Before reporting issues in this section, you must read the following topic:
energyman76c
Posts: 199
Joined: May 26th, 2004, 9:38 pm

sound distortion with 1.4.X, 1.5.X

Post by energyman76c »

Hi,

I have a strange and annoying sound problem. It started a long time ago after a kernel update. Since then and with all 2.6.2X kernels I get the following problem:
after a while - or sometimes just after the start there is a loud cracking sound distorting the music. Music settings are on default. Volume has no influence.
After the cracking noises started there are two ways to get rid of them:
quit&restart wesnoth
turn of all sounds and turn them back on.
However the second workaround results in a crash once in a while.

Wesnoth is the only application with this problem. Xine, mplayer, alsaplayer, ut2004, vegastrike (as examples) don't have this problem. Which points away from kernel as the cause of the problem.
There is nothing in dmesg or logs. Sometimes it is possible to play several scenarios without this distortion, sometimes it starts right at the beginn, most of the time it starts after some minutes into the first scenario loaded.
No error messages, nothing.

sdl-mixer is 1.1.8, alsa-lib is 1.0.18. Kernel config is attached (maybe someone has an idea).
Attachments
preferences.bz2
(1.12 KiB) Downloaded 178 times
config.bz2
(10.12 KiB) Downloaded 185 times
energyman76c
Posts: 199
Joined: May 26th, 2004, 9:38 pm

Re: sound distortion with 1.4.X, 1.5.X

Post by energyman76c »

I increased buffer to 4096 and no noise since then.
energyman76c
Posts: 199
Joined: May 26th, 2004, 9:38 pm

Re: sound distortion with 1.4.X, 1.5.X

Post by energyman76c »

Hi,

the problem is back. And it got worse. A lot worse.

No matter what I choose for buffer, I get distortions after a short while. 512 is worst, 2048 takes the longest.

Deactivating and activating sound would maybe help, but touching any sound related option while a scenario is open, crashs the game. Changing buffsize is an instant crash, deactivating sound is ok, activating it will crash a bit later

wesnoth
Battle for Wesnoth v1.6.4
Started on Fri Jul 24 23:31:35 2009


Data directory: /usr/share/games/wesnoth
User configuration directory: /home/energyman/.wesnoth

Checking video mode: 1282x960x32...
setting mode to 1282x960x32
20090724 23:31:36 error general: no location found for 'data/campaigns/Broken_Valley/translations', not adding textdomain
20090724 23:31:36 error general: no location found for 'data/campaigns/Flight_Freedom_1_5/translations', not adding textdomain
20090724 23:31:36 error general: no location found for 'data/campaigns/Siege_of_Soradoc/translations', not adding textdomain
zsh: segmentation fault wesnoth

kernels are 2.6.28,29,30. Alsa is latest and bestest. But it happens for a long time now.
alsa-lib 1.0.20
sdl-mixer 1.2.8
libsdl 1.2.13-r1
sdl-sound 1.0.3
gcc 4.4.0
glibc 2.10.1

wesnoth 1.6.4,3,2,1,0, ...

no .asoundrc
User avatar
grzywacz
Inactive Developer
Posts: 303
Joined: January 29th, 2005, 9:03 pm
Location: Krakow, Poland
Contact:

Re: sound distortion with 1.4.X, 1.5.X

Post by grzywacz »

Do you happen to use the emu10k1 driver (for Sound Blaster Live / Audigy)?
energyman76c
Posts: 199
Joined: May 26th, 2004, 9:38 pm

Re: sound distortion with 1.4.X, 1.5.X

Post by energyman76c »

yes. I have a Audigy2.

btw, when I tried OSSv4 it was even worse.
User avatar
grzywacz
Inactive Developer
Posts: 303
Joined: January 29th, 2005, 9:03 pm
Location: Krakow, Poland
Contact:

Re: sound distortion with 1.4.X, 1.5.X

Post by grzywacz »

Worse with OSSv4? That's something new. We're aware of the problems with emu10k1, I guess I have to push this issue further.

If you have OSS emulation enabled in ALSA, try exporting this before starting Wesnoth for a workaround:

SDL_AUDIODRIVER=oss

Let us know if it helps.
energyman76c
Posts: 199
Joined: May 26th, 2004, 9:38 pm

Re: sound distortion with 1.4.X, 1.5.X

Post by energyman76c »

with OSSv4 music was ok, but all attack sounds were distorted, from the beginning - and there was no 'trick' to make it ok.


with SDL_AUDIODRIVER=oss it seems to be ok so far.
energyman76c
Posts: 199
Joined: May 26th, 2004, 9:38 pm

Re: sound distortion with 1.4.X, 1.5.X

Post by energyman76c »

nope, it does not work.

energyman@energy ~ % SDL_AUDIODRIVER=oss
energyman@energy ~ % wesnoth
Battle for Wesnoth v1.6.4
Started on Sat Aug 8 22:46:20 2009


Data directory: /usr/share/games/wesnoth
User configuration directory: /home/energyman/.wesnoth

Checking video mode: 1281x960x32...
setting mode to 1281x960x32
20090808 22:46:21 error general: no location found for 'data/campaigns/Flight_Freedom_1_5/translations', not adding textdomain
20090808 22:46:21 error general: no location found for 'data/campaigns/Siege_of_Soradoc/translations', not adding textdomain


and after a few minutes the distortions start.

wesnoth is the only app having this issues.
Soofix
Posts: 5
Joined: September 9th, 2009, 9:34 pm

Re: sound distortion with 1.4.X, 1.5.X

Post by Soofix »

Hello,

It seems my problem may be related to this. Since Wesnoth version 1.6.x, the unit attack/defend sounds (and only them) produce weird quirks/scratches in about 33% of the times.
My wesnoth version is 1.6.4, system is Linux 2.6.28.9 on AMD64 (64bit system).

Once again, Battle for Wesnoth is the only application which has this problem, and only application which has any problem with sound at all.

The bug is moderately annoying, because as i said, only about 33% of sounds produced by attacks/defenses has scratches in it. Playing with buffer settings does not seem to have any effect on this. The weird thing however is that only unit sounds during fighting produce the scratches. Bell sound, background music, interface sounds (clicks) are unaffected.

Some useful data about my system follows:

My soundcard:

Code: Select all

        $lspci -v
        04:06.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10)
	Subsystem: C-Media Electronics Inc CMI8738/C3DX PCI Audio Device
	Flags: bus master, medium devsel, latency 64, IRQ 21
	I/O ports at e800 [size=256]
	Capabilities: [c0] Power Management version 2
	Kernel driver in use: C-Media PCI
	Kernel modules: snd-cmipci
My system:

Code: Select all

emerge --info
Portage 2.2_rc40 (default/linux/amd64/2008.0, gcc-4.3.3, glibc-2.10.1-r0, 2.6.28.9-soofx x86_64)
=================================================================
System uname: Linux-2.6.28.9-soofx-x86_64-AMD_Phenom-tm-_9850_Quad-Core_Processor-with-gentoo-2.0.1
Timestamp of tree: Wed, 09 Sep 2009 19:15:01 +0000
app-shells/bash:     4.0_p24
dev-java/java-config: 2.1.8-r1
dev-lang/python:     2.5.4-r3, 2.6.2-r1
dev-util/cmake:      2.6.4
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    2.0
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.29
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
Alsa drivers:

Code: Select all

cat /proc/asound/version 
Advanced Linux Sound Architecture Driver Version 1.0.18rc3.
Soofix
Posts: 5
Joined: September 9th, 2009, 9:34 pm

Re: sound distortion with 1.4.X, 1.5.X

Post by Soofix »

One more thing. After playing for some time, i think i have miscalculated how often the error occurs.

It seems to happen in 70% of unit sounds, at random.

My another idea is that this may be a sound mixing problem, as it occurs only when there are more than one sounds being played at once (during attack/defense).
lmelior
Posts: 116
Joined: June 16th, 2009, 3:30 am

Re: sound distortion with 1.4.X, 1.5.X

Post by lmelior »

This is pretty well out of my league but as a quick and dirty fix you could try updating ALSA, and if that doesn't work then do some searching on problems with the relevant ALSA driver (CMIPCI) to see if you can find some examples of people with the same problems and how they fixed them.
energyman76c
Posts: 199
Joined: May 26th, 2004, 9:38 pm

Re: sound distortion with 1.4.X, 1.5.X

Post by energyman76c »

alsa .21 (not 21a) and wesnoth 1.6.5. Distortions still happen after a while.
Soofix
Posts: 5
Joined: September 9th, 2009, 9:34 pm

Re: sound distortion with 1.4.X, 1.5.X

Post by Soofix »

lmelior wrote:This is pretty well out of my league but as a quick and dirty fix you could try updating ALSA, and if that doesn't work then do some searching on problems with the relevant ALSA driver (CMIPCI) to see if you can find some examples of people with the same problems and how they fixed them.
As i said, wesnoth is absolutely the only app having any problems with sound at all.

What about some of you devs try to revert the sound engine to the one used in 1.4.x and see if game keeps working ?
Maybe some "theoretically innocent" changes in sound engine are responsible for this ?

You could then make some branch on SVN/Git/CVS, so I can download it, compile it and check if that fixed the issues.
Kristjan

Re: sound distortion with 1.4.X, 1.5.X

Post by Kristjan »

Do you have plain alsa setup? In that case may I suggest trying different sample rate in advanced sound settings? e.g. 48000 (undesirable music tempo changes though). You could also check out if setting your processor speed to maximum performance will do anything.
I think I had the same problem with alsa in the past, now on Ubuntu 9.10 and pulseaudio I only get distortions with lower than 1024 buffer size.
energyman76c wrote:energyman@energy ~ % SDL_AUDIODRIVER=oss
Is "%" for "export" and did you install libsdl1.2debian-oss?

Soofix wrote: As i said, wesnoth is absolutely the only app having any problems with sound at all.
And how many other games using sdl for audio did you try?
energyman76c
Posts: 199
Joined: May 26th, 2004, 9:38 pm

Re: sound distortion with 1.4.X, 1.5.X

Post by energyman76c »

I am not using debian

you don't need to 'Export' if you follow the setting with the app ;)

and ... alsa is a plain setup. There is no asoundrc.

of course, of all the apps, wesnoth is the only one with problems. Vegastrike, ut2004, vlc, xine, mplayer, flash, amarok, alsaplayer don't have the problem. Neither had earlier wesnoth versions.
Post Reply