Ubuntu Sound Troubles... (even after some wiki suggestions)

Ubuntu Sound Troubles... (even after some wiki suggestions)

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
askuhn
Posts: 30
Joined: 01 Aug 2011, 19:06

Ubuntu Sound Troubles... (even after some wiki suggestions)

Post by askuhn »

Running Ubuntu 11.10 64 bit, up to date and mostly default.

It doesn't matter if I'm playing version 83.0 from the Ubuntu PPA or building the latest development straight from git, I still experience stuttering and crackling sound in spring. The crackling is most noticeable during battle scenes when more sounds are playing at once. I've followed these instructions from the wiki:

Code: Select all

# install
sudo apt-get install alsoft-conf
# run
alsoft-conf
In the "backend" tab, keep only "ALSA" on the left column, then save. Done!

Side Note: ALSA is redirected to the PulseAudio layer when installed.
but it no longer resolves the issue for me. To note, it also does not matter if I use MT or not (MT actually doesn't suffer from this quite as much), have any other applications using sound, or whether or not pulse or alsa is selected in the left column of the OpenAL config.

While playing around with things, I discovered that if I change the only available back-end in the left column to something useless for spring, such as OSS, my map scrolling becomes much smoother and less jerky. This seems like a pretty big problem to me if just turning sound off can help so much.

And in GNOME's sound settings, the volume slider for spring flickers very quickly as if the entry is constantly turning on and off or something. I've attached some screenshots to clarify.

Image

So basically is there anything that can be done to have both properly functioning sound and smoother map scrolling? Thanks! :-)
Attachments
infolog.txt
infolog when Pulse selected
(17.24 KiB) Downloaded 117 times
infolog.txt
infolog when ALSA is selected
(17.23 KiB) Downloaded 112 times
spring_audio_screenshots.png
Open-AL Config & GNOME Sound
(242.85 KiB) Downloaded 2 times
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Ubuntu Sound Troubles... (even after some wiki suggestions)

Post by abma »

you get this crackling with 5 ais?

uhm... tried with fewer ais? some ais heavily use cpu... did you try single-threaded spring? in some cases it performs better...

press alt+b ingame, to see what uses cpu.
User avatar
askuhn
Posts: 30
Joined: 01 Aug 2011, 19:06

Re: Ubuntu Sound Troubles... (even after some wiki suggestions)

Post by askuhn »

abma wrote:you get this crackling with 5 ais?

uhm... tried with fewer ais? i guess your cpu is to slow...
Ummm...4 core AMD Phenom II X4 955 Processor at 3.2 GHz? I hope this isn't too slow... :?

And I would test with fewer ais, but I'm not even sure what those are or how to change that (sorry, noob here). :oops:

Also, should probably mention no problems with any other sound-using apps.

I'll check alt-b for the highest readings in my next game. The issue shows itself as soon as I load though, so I don't really think it's performance related (but I'm no developer).

edit...
Aaaand I should also clarify that the map scrolling isn't terrible when sound is on, but it is noticeably smoother when it's off.
Last edited by askuhn on 13 Nov 2011, 04:01, edited 1 time in total.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Ubuntu Sound Troubles... (even after some wiki suggestions)

Post by abma »

Ummm...4 core AMD Phenom II X4 955 Processor at 3.2 GHz? I hope this isn't too slow... :?
for a normal game, no, for many ai's maybe... depends on map-size + unit count + ai.
I'll check alt-b for the highest readings in my next game. The issue shows itself as soon as I load though, so I don't really think it's performance related (but I'm no developer).
if no ai's are enabled, yes, true! some ai's have bugs causing it to use tons of cpu time.

can you try to disable all effects in alsoft-conf? this maybe can help, too.
User avatar
askuhn
Posts: 30
Joined: 01 Aug 2011, 19:06

Re: Ubuntu Sound Troubles... (even after some wiki suggestions)

Post by askuhn »

abma wrote:can you try to disable all effects in alsoft-conf? this maybe can help, too.
I never tried this. This appears to totally solve the problem with the exact same setup that I was using for my OP! Map scrolling smooth too! Perhaps a bug in spring that causes these effects to make so much trouble? Tested using a /give all with ctrl+a and making everyone attack the same spot...thanks for the amazingly quick help! :mrgreen:

edit...
I never put it together that ais was the same as ai's. My bad. I was playing with a lot to intentionally stress things. I can go for hours on pretty big maps with little slowdown when running MT (as long as it doesn't deadlock at some point).
Last edited by askuhn on 13 Nov 2011, 04:14, edited 1 time in total.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Ubuntu Sound Troubles... (even after some wiki suggestions)

Post by abma »

thanks for your nice report. i wish every user would do it like you.

i added it to the wiki, so it maybe helps others, too.

http://springrts.com/wiki/FAQ:trouble#I ... an_i_do.3F
User avatar
askuhn
Posts: 30
Joined: 01 Aug 2011, 19:06

Re: Ubuntu Sound Troubles... (even after some wiki suggestions)

Post by askuhn »

You're welcome! Thanks again for the help! I love what you guys are doing here. Prime example just now...within 5 mins of a forum post, something is added to the wiki that might help anyone. Cool! :-)
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: Ubuntu Sound Troubles... (even after some wiki suggestions)

Post by SpliFF »

I'm also getting audio stuttering with Pulseaudio 1.1 on gentoo. Spring shows CPU at about 4% so I don't think the issue is that. Tried setting UseEFX = 0 but no change. Infolog attached. Will try some of these suggestions.
Attachments
infolog.txt
(16.56 KiB) Downloaded 133 times
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Ubuntu Sound Troubles... (even after some wiki suggestions)

Post by abma »

@spliff:

did you try with UseEFX=1 + disabled effects in alsoft-conf?

next step would maybe re-enable pulse...
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: Ubuntu Sound Troubles... (even after some wiki suggestions)

Post by SpliFF »

For some reason Gentoo doesn't seem to ship that tool so I created an ~/.alsoftrc by hand.

Code: Select all

[general]
format = AL_FORMAT_STEREO16
frequency = 44100
drivers = pulse,alsa
excludefx = eaxreverb,reverb,echo

[alsa]
device = pulse
mmap = true
Can't tell if I fixed it though because in the process I reset the alsa config and seem to have broken alsa entirely (I get no sound in spring and audacious reports "snd_pcm_open failed: Invalid argument." when using alsa output. SDL and pulseaudio backends work with other tools (paplay, audacious SDL) though.
luckywaldo7
Posts: 1398
Joined: 17 Sep 2008, 04:36

Re: Ubuntu Sound Troubles... (even after some wiki suggestions)

Post by luckywaldo7 »

FWIW, I'm experiencing the same behavior. Seems to be reported on mantis previously: http://springrts.com/mantis/view.php?id=2368
User avatar
askuhn
Posts: 30
Joined: 01 Aug 2011, 19:06

Re: Ubuntu Sound Troubles... (even after some wiki suggestions)

Post by askuhn »

Going to jump back in here real quick to ask if it is possible to fix this directly in spring or "upstream" in some way... :?:

This issue seems to affect a lot of people using linux on at least a couple of distros no matter how the engine is installed.

I played another game after switching everything to the appropriate columns in that config tool and the performance gain was too significant to ignore. If there is anything that you guys can do to prevent this I think it would be great. Counting on the end user to go to the wiki, download tools, and modify configurations probably isn't for the best (many will probably just give up or leave rather than fix it). Just thinking out loud here...thanks :-)
SpliFF wrote:For some reason Gentoo doesn't seem to ship that tool so I created an ~/.alsoftrc by hand.
Here is what the config tool wrote to my ~/.alsoftrc on Ubuntu if it is helpful to you, SpliFF (attached).
Attachments
.alsoftrc.txt
~/.alsoftrc (had to add the ".txt" to make it upload)
(398 Bytes) Downloaded 47 times
Post Reply

Return to “Help & Bugs”