View Issue Details

IDProjectCategoryView StatusLast Update
0002368Spring engineGeneralpublic2012-05-13 11:51
Reporterabma Assigned Toabma  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version0.82.7+git 
Target Version83.0 
Summary0002368: (master) sound stuttering/choppy in current spring master
Descriptionin current spring master i get big spikes in draw-world. with the same settings i don't get this in the stable branch with the same compile settings.

in master, CPU usage in draw-world is ~ 70% in stable at ~ 7%.

this seems to also cause stuttering sounds.

afaik a short time ago this problem didn't exist.
TagsNo tags attached.
Attached Files
infolog.txt (Attachment missing)
Checked infolog.txt for Errors

Relationships

duplicate of 0002928 resolvedabma sound effect make spring unplayable 
related to 0002184 closed Audio stutters in 82.6.1 when affinity is set in singlethreated spring 

Activities

jK

2011-02-25 22:22

developer   ~0006434

https://github.com/spring/spring/commit/7b22a0edf78d41dd3558defa5aa3b1796b8cc53f#comments ?

zerver

2011-02-26 18:03

reporter   ~0006439

Could you try with /dynamicsun

abma

2011-02-26 18:29

administrator   ~0006440

Last edited: 2011-02-26 18:45

sorry, this was bit to unspecific.

with /dynamicsun 0 drawworld is again at 7percent but the stuttering is still there. in mt i get no sound-stutters.

if debugmode (alt-b) is on or off makes no difference, i alwayws get sound-stutters in singlethread-spring.

tested with 0.82.3-1446-g4adf86d

i tried also with EFX=1 & EFX=0

maybe the inflog.txt helps?

(real) cpu is at 100percent, but i have to play with VSync=0 (ATI-Bug)
cpu in springs debug mode shown is at average ~5percent or so...

even in pause mode sound stutters...



i'll bisect

abma

2011-02-26 18:57

administrator   ~0006441

Last edited: 2011-02-26 19:01

66de8f60e863befa61e5addaea539877dd78d064 is the last working version (the others don't compile)
so, it looks like the efx-commits creates the problem :-/

$ git bisect log
git bisect start
# bad: [4adf86d0e239a3d6196a8f4bc69fc35b93e5df11] fix inverted logic for track-deletion
git bisect bad 4adf86d0e239a3d6196a8f4bc69fc35b93e5df11
# good: [a8709bf8e7032f0a67cfeb68f1014f5fb968380e] Merge branch 'master' of git@github.com:spring/spring
git bisect good a8709bf8e7032f0a67cfeb68f1014f5fb968380e
# good: [8c869ab098ed0fb54304d4902230200a4946d8c7] fix (rare) teleportation of aircraft built on raised platforms
git bisect good 8c869ab098ed0fb54304d4902230200a4946d8c7
# bad: [39d0eb4a68824cb35052d797e9d679c2105abf85] 3rd try
git bisect bad 39d0eb4a68824cb35052d797e9d679c2105abf85
# good: [66de8f60e863befa61e5addaea539877dd78d064] modularized Watchdog & added Linux implementation * it can now handle any number of threads * it gives threads names - currently "main" (:= render-thread in spring-mt) & "sim" (only in spring-mt) * syntax of the Lua function changed too: Spring.ClearWatchDogTimer() --clears current thread's timer Spring.ClearWatchDogTimer("sim") --clears the timer of the "sim" thread
git bisect good 66de8f60e863befa61e5addaea539877dd78d064

abma

2011-03-10 21:20

administrator   ~0006482

hm, maybe sounds are only played twice with a tiny time difference?

zerver

2011-03-11 18:30

reporter   ~0006483

could be, that has happened in the past too

abma

2011-04-24 04:10

administrator   ~0006563

@jk:

output of pulseaudio -v -v:

http://pastebin.com/FiLThj1q

the stuttering seems to come from buffer-underruns:
D: protocol-native.c: Underrun on 'Playback Stream', 0 bytes in queue.
D: protocol-native.c: Requesting rewind due to end of underrun.

abma

2011-04-24 04:15

administrator   ~0006564

when changing
/etc/openal/alsoft.conf:
drivers = pulse (ubuntu default)
to
drivers = alsa,pulse

stuttering seems to be gone

jK

2011-04-24 04:15

developer   ~0006565

Last edited: 2011-04-24 04:16

don't use pulseaudio, use alsa directly?

EDIT: this explains why I didn't encountered this issue.

hoijui

2011-04-24 18:32

reporter   ~0006566

hmm.. ok... should we consider this a sufficient fix?
it would be nice if not 95% of our linux playerbase would have to do that on next release. can we prevent the buffer-under-runs from within spring? i would guess yes, as it does not happen in release version... so the question is, should we try to do it:
* how much time would that require and is the time worth it?
* would the "fix" likely be ok, or rather an ugly hack?

abma

2011-04-25 13:16

administrator   ~0006567

Last edited: 2011-04-25 13:34

when adding this line to /etc/openal/alsoft.conf (with drivers = pulse)

excludefx = eaxreverb

stuttering is also gone + log spam of [Sound] CSound::UpdateListener: Invalid Name

in my .springrc is a "UseEFX=0"

hoijui

2011-05-09 23:22

reporter   ~0006633

as discussed in meeting of 9. May 2011:

problem:
when EFX is enabled, pulseaudio is too slow in passing on packets to ALSA, and thus creates sound-lag

solution:
when pulseaudio is detected (linux only :D ), print a FAT warning like for low tech GFX cards, and disable EFX; do so only for runtime, not in the config, so it gets auto-enabled for the user when he un-uses pulseaudio.

hoijui

2011-05-11 10:16

reporter   ~0006642

i can not see anything about pulseaudio in my infolog, only ALSA, and i think it never was there... so the detection mechanism will be more complicated to implement.
..then again.. i have UseEFX=0, and i still get the stuttering. :/
in other words.. this solution is none :/

abma

2011-05-11 11:04

administrator   ~0006643

is LogSubsystems=Sound enabled?

you should see something like this:
[f=0000000] [Sound] Device: ALSA Software
[f=0000000] [Sound] Available Devices:
[f=0000000] [Sound] ALSA Software
[f=0000000] [Sound] PulseAudio Software

abma

2011-05-11 11:19

administrator   ~0006644

Last edited: 2011-05-11 11:20

imo UseEFX=0 doesn't work... or why does "excludefx = eaxreverb" change behaviour with UseEFX=0?

hoijui

2011-05-12 00:03

reporter   ~0006650

Last edited: 2011-06-10 16:21

yes i see that, and this subsystem is enabled by default (Aus made it so when he reworked sound, and that never got changed).
yeah.. sorry, read you wrong there.
we'll have to investigate more here...

abma

2011-11-13 14:56

administrator   ~0007594

some more people have the stuttering problems:
http://springrts.com/phpbb/viewtopic.php?uid=8601&f=11&t=27079

spliff

2011-11-14 08:47

reporter   ~0007595

Had a discussion with an OpenAL dev on openal@freenode. Got some information that may be useful but no conclusions except disabling either eaxreverb or pulseaudio. Chat log is here: http://echelog.matzon.dk/logs/browse/openal/1321225200

abma

2012-05-13 11:51

administrator   ~0008687

seems to be fixed in spring 88 / newer linux distributions...

Issue History

Date Modified Username Field Change
2011-02-25 21:13 abma New Issue
2011-02-25 22:22 jK Note Added: 0006434
2011-02-26 18:03 zerver Note Added: 0006439
2011-02-26 18:29 abma Note Added: 0006440
2011-02-26 18:30 abma Summary (master) big spikes in drawworld (debug-mode/alt-b) => (master) sound stuttering in current spring master
2011-02-26 18:30 abma File Added: infolog.txt
2011-02-26 18:32 abma Note Edited: 0006440
2011-02-26 18:32 abma Note Edited: 0006440
2011-02-26 18:38 abma Note Edited: 0006440
2011-02-26 18:41 abma Note Edited: 0006440
2011-02-26 18:45 abma Note Edited: 0006440
2011-02-26 18:57 abma Note Added: 0006441
2011-02-26 19:00 abma Note Edited: 0006441
2011-02-26 19:00 abma Note Edited: 0006441
2011-02-26 19:01 abma Note Edited: 0006441
2011-02-26 19:02 abma Summary (master) sound stuttering in current spring master => (master) sound stuttering in current spring master (singlethread only)
2011-02-26 20:06 abma Relationship added related to 0002184
2011-03-10 21:20 abma Note Added: 0006482
2011-03-11 18:30 zerver Note Added: 0006483
2011-04-24 04:10 abma Note Added: 0006563
2011-04-24 04:15 abma Note Added: 0006564
2011-04-24 04:15 jK Note Added: 0006565
2011-04-24 04:16 jK Note Edited: 0006565
2011-04-24 18:32 hoijui Note Added: 0006566
2011-04-25 13:16 abma Note Added: 0006567
2011-04-25 13:17 abma Note Edited: 0006567
2011-04-25 13:19 abma Note Edited: 0006567
2011-04-25 13:19 abma Note Edited: 0006567
2011-04-25 13:34 abma Note Edited: 0006567
2011-05-09 23:22 hoijui Note Added: 0006633
2011-05-11 10:16 hoijui Note Added: 0006642
2011-05-11 11:04 abma Note Added: 0006643
2011-05-11 11:19 abma Note Added: 0006644
2011-05-11 11:20 abma Note Edited: 0006644
2011-05-12 00:03 hoijui Note Added: 0006650
2011-05-12 04:04 abma Summary (master) sound stuttering in current spring master (singlethread only) => (master) sound stuttering in current spring master
2011-05-12 04:04 abma Summary (master) sound stuttering in current spring master => (master) sound stuttering/choppy in current spring master
2011-06-10 16:21 hoijui Note Edited: 0006650
2011-06-10 16:21 hoijui Target Version => 0.83.0
2011-06-10 16:21 hoijui Description Updated
2011-11-13 14:56 abma Note Added: 0007594
2011-11-14 08:47 spliff Note Added: 0007595
2011-11-23 10:45 hoijui Product Version => 0.82.7+git
2011-11-23 10:45 hoijui Build => 0.82.3-1440-g97d08b9
2011-11-23 10:45 hoijui Additional Information Updated
2012-05-13 11:49 abma Relationship added duplicate of 0002928
2012-05-13 11:51 abma Note Added: 0008687
2012-05-13 11:51 abma Status new => resolved
2012-05-13 11:51 abma Resolution open => fixed
2012-05-13 11:51 abma Assigned To => abma