ID:101969
 
Resolved
Playing sounds quickly together could cause the sound engine to hang in some cases.
BYOND Version:475
Operating System:Windows 7 Home Basic
Web Browser:Chrome 6.0.472.55
Applies to:Dream Seeker
Status: Resolved (477)

This issue has been resolved.
Descriptive Problem Summary:

The Client crashes when sound files play massively. The problem seems to occur when there is a soundfile overload, aka multiple sounds starting to play/overlap in a close timerange.
This is happening with a 16kb .ogg file, which we use for multiple items, but it only crashes when used by one specific item being used multiple times.

Numbered Steps to Reproduce Problem:
1. Make some turf which trigger a sound file when stepped on.
2. Keep walking on those turfs.
3. The game will stay, but your Client will crash.


Code Snippet to Reproduce Problem:

It seems to happen most here:
SoundEffect(view(src), 'Chainsaw.ogg')

with SoundEffect() being:
SoundEffect(wide, file)
if(ismob(wide))
var/mob/M = wide
if(M.sfxon)
M << sound(file, volume=50)
else
var/list/people = new /list()
for(var/mob/M in wide)
if(!M.dead && !M.spyingOn)
people |= M
for(var/mob/M2 in people)
people |= M2.spiers
for(var/mob/M2 in people)
if(M2.sfxon)
M2 << sound(file, volume=50)


Expected Results:
The sounds playing.

Actual Results:
The Client crashing.

Does the problem occur:
Every time? Or how often?
Only when a sound overlaps, it seems. When we call it separately, it doesn't crash. And it seems to be based on how unlucky you are, because it doesn't always overload.
In other games?
We do not know of other games.
In other user accounts?
Yes, we have tested it on various accounts + random players crash from it too.
On other computers?
Yes. On both 32 and 64 bit Windows 7 hosting + numerous systems for playing

When does the problem NOT occur?

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

This used to work on all previous versions, but broke for all versions when the latest was released.

Workarounds:
Disable sound.

Are your clients also downgrading their byond versions? if so to what version?
Darker Legends wrote:
Are your clients also downgrading their byond versions? if so to what version?

I wrote:
Well, my colleague soul tested it with both current and previous version of BYOND, both hosting and client gaming

Have you tried rebuilding the resource file for the game and wiping your byond cache?
I was unable to cause a crash myself in XP. It will help if you can obtain crash details I can look at. Because you're running Windows 7, I'm not sure of what you'd need to do to get those details since Dr. Watson is not available, but basically we need to know which module is crashing and at which offset.

One thing I'm not sure about is which version this appeared in. Your report implies the problem appeared in 475, but that downgrading to 474 doesn't work either. That's not entirely clear however. Can you add some specific info about which versions you've tested?

A copy of the sound file that crashes would also be helpful. If you're not comfortable posting files here you can send them to me (in a .zip file please) at [email protected].

[edit]
Actually, even better would be if you can distill this down to a small demo that replicates the problem. I assume in your game you have to be in a certain set of circumstances for the issue to come up, since you mentioned the overlapping. A demo would definitely help us more--especially since you seem to have no trouble getting the problem to occur.
There is however a debugger on windows 7 which does store the file Dr. Watson would've created however I am not sure where.
http://www.byond.com/members/SuperAntx/files/ steampunk_crash.zip

Press F3 to trigger the following command:
mob
verb
test()
src<<sound('jump.ogg',0,0,11,100)
src<<sound('jump.ogg',0,0,11,100)
src<<sound('jump.ogg',0,0,11,100)


It causes the game to permanently hang up on my system. Looping sounds will continue to play but the game itself will remain non responsive while eating up a large chunk of my CPU.
I don't know if the jump sound is what's triggering it because that command doesn't lock things up immediately for me, but I can confirm that it starts racing and it's apparently stuck in some kind of loop in FModEx.