Bug Tracker – Bug 135

Various sounds are played multiple times at once

Last modified: 2011-06-25 02:37:32 UTC
Bug 135 - Various sounds are played multiple times at once
Summary: Various sounds are played multiple times at once
Status: RESOLVED FIXED
Alias: None
Product: Odamex
Classification: Unclassified
Component: Client (show other bugs)
Version: (old) 0.0.1
Hardware: x86 (Windows, Linux, etc) Windows (Any)
: P2 normal
Assignee: Odamex Bug Reporter
URL:
: 233 289 (view as bug list)
Depends on:
Blocks: 424 620
  Show dependency tree
 
Reported: 2006-02-26 13:50 UTC by Nautilus
Modified: 2011-06-25 02:37 UTC (History)
9 users (show)

See Also:

Attachments

Seems to fix duplicate rocket explode & player death sounds (981 bytes, patch)
2010-08-21 20:05 UTC, Charlie Gunyon
Details | Diff
Patch to fix duplicate rocket explosion & player death sounds (1.06 KB, patch)
2010-08-22 03:35 UTC, Charlie Gunyon
Details | Diff
Fixes duplicate missile sound issues (3.32 KB, patch)
2011-06-03 04:09 UTC, Dr. Sean
Details | Diff
Show Obsolete (1) Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this bug.
Description Nautilus 2006-02-26 13:50:55 UTC
When a player is killed, the player death sound is played multiple times simultaneously. Another sound that is played many times at the same moment is when a door is opened, when the sound for the door opening is played in such a manner as is the sound for the door closing.
Comment 1 Denis Lukianov 2006-02-26 15:11:47 UTC
Probably a client/server duplication thing. If you try it on a high-lag server, the two sounds are some time apart.
Comment 2 Dean Joseph 2006-02-26 16:40:09 UTC
(In reply to comment #1)
> Probably a client/server duplication thing. If you try it on a high-lag server,
> the two sounds are some time apart.
> 

I can confirm this. The length between the start of the two sounds is a lot more noticable with higher ping. I've also heard a sound being played three times on a few occasions.
Comment 3 Tom J. 2006-03-02 10:20:19 UTC
It's not only the sound that is played twice, also the animation of doors and lifts is being displayed twice. For instance a door opens and at one point during the process when it is almost open it snaps back and opens again, synchronous to the second sound).
Comment 4 Nautilus 2006-03-03 18:28:16 UTC
(In reply to comment #3)
> It's not only the sound that is played twice, also the animation of doors and
> lifts is being displayed twice. For instance a door opens and at one point
> during the process when it is almost open it snaps back and opens again,
> synchronous to the second sound).
> 

Yes, I happened to notice that in the past as well. Doors tend to be jittery often. 
Comment 5 Denis Lukianov 2006-03-05 06:11:15 UTC
This is quite a problem. A lot of the door trigger code is in "common", so it runs twice, once on client and once on server. Will take time to resolve.
Comment 6 Mike Lightner 2006-03-19 14:47:34 UTC
r1137 fixed a bunch of the sector double sounds (doors, lifts, etc).  Tested, seems ok.
Comment 7 Mike Lightner 2006-03-24 12:54:41 UTC
r1185 removed sndseq, and with it various sector sound events.  r1186 added door sounds back, r1188 added lift sounds back.  This needs testing to ensure they're proper.
Comment 8 Nautilus 2006-04-01 17:09:28 UTC
(In reply to comment #7)
> r1185 removed sndseq, and with it various sector sound events.  r1186 added
> door sounds back, r1188 added lift sounds back.  This needs testing to ensure
> they're proper.
> 

Doors seem to now be fine, however when lifts are lowered the sound is slightly cut off and when the lifts go back up the sound for rising lifts is rather choppy and played many times at once.
Comment 9 Nautilus 2006-04-11 18:31:59 UTC
Everything seems to now be fine. All lift sounds are played normally, as the door sounds are. 
Comment 10 Mike Lightner 2006-04-11 18:36:40 UTC
All issues mentioned in report fixed, bug closed.
Comment 11 Nautilus 2006-04-11 18:50:11 UTC
Hm, it seems that occasionally rocket and BFG explosions can be played multiple times at once.
Comment 12 Mike Lightner 2006-04-11 18:50:37 UTC
New "various sounds" being played multiple times
Comment 13 Mike Lightner 2006-10-01 15:34:17 UTC
Reassigned to joe the sound guy.
Comment 14 Mike Lightner 2006-10-01 21:15:52 UTC
Grr I wish this actually set it to assigned when it gets reassigned!
Comment 15 Joe Kennedy 2006-10-02 04:41:25 UTC
Should be fixed. I had a problem with the rocket explosion playing twice but adding a check for if(volume <= 0) stopped that for some reason. The only multiple sounds playing thing i've experienced is that sometimes moving floors play the plat stop sound multiple times. I put this down to server and client inconsistencies though :/
Comment 16 Dean Joseph 2006-10-04 01:39:21 UTC
I've heard rocket sounds being played multiple times occasionally, but the rocket seems to explode just before it impacts. The explosion can be definitely seen moving when it shouldn't.
Comment 17 Mike Lightner 2006-10-12 22:40:25 UTC
*** Bug 233 has been marked as a duplicate of this bug. ***
Comment 18 Dean Joseph 2007-09-04 22:40:19 UTC
Still an issue as of r312
Comment 19 Alexander Mayfield 2007-10-20 19:39:25 UTC
Still in as 397 (multiple oomf sound)
Comment 20 Denis Lukianov 2008-05-15 11:50:07 UTC
reassigning to myself
Comment 21 Mike Lightner 2010-01-03 18:42:57 UTC
*** Bug 289 has been marked as a duplicate of this bug. ***
Comment 22 Ralph Vickers 2010-01-15 05:39:41 UTC
As of r1431, there is a bug related to various sounds being played continuously during coop net games. 

If you play through a few maps in coop, especially in a wad with a decent amount of monsters such as scythe, you'll sometimes hear a monster's activate sound played over and over from somewhere in the map. The monster's activate sound will play continuously until the monster is actually woken up server side.

Have found no definite way to reproduce other than playing some coop for a while and hoping you come across it.
Comment 23 indigo 2010-07-12 01:12:24 UTC
I can very clearly hear multiple explosion sounds (from rockets and imp fireballs). The problem seems to be that the client calls P_ExplodeMissile, and then the server calls CL_ExplodeMissile which in turn calls P_ExplodeMissle again.

I tried to make it so that there were seperate explosion functions, one for online and one for offline. It worked, but if I suicided with my own rocket no sound was played. The other solution I used was to modify the file /trunk/server/src/p_mobj.cpp by commenting out the for loop in P_ExplodeMissile. I didn't see any side effect to this.

I can also clearly hear multiple death screams for other players in deathmatch. The problem is similar to the one above. I used a printf in the scream function, and found that when I fragged another player, i would see the scream call, an obituary, followed by another scream call.
Comment 24 Charlie Gunyon 2010-08-21 19:30:13 UTC
Adding

// MSG_WriteMarker(&cl->reliablebuf, svc_explodemissile);
// MSG_WriteShort(&cl->reliablebuf, mo->netid);

to p_mobj.cpp in the server (P_ExplodeMissile) appears to resolve the issue for rockets/monster missiles - perhaps the client is calling this on its own when it detects a missile collision?

Some testing on high-latency connections also shows that clients don't play their own death sound twice, but they do for opponents.
Comment 25 Charlie Gunyon 2010-08-21 20:05:46 UTC
Created attachment 214 [details]
Seems to fix duplicate rocket explode & player death sounds

I don't necessarily advocate this as a solution, but this small patch seems to fix the duplicate rocket explosion and player death sounds.
Comment 26 Charlie Gunyon 2010-08-22 03:35:00 UTC
Created attachment 215 [details]
Patch to fix duplicate rocket explosion & player death sounds

The other patch did not resolve player death sounds, this one does.  Again, not necessarily sure of the approach.
Comment 27 Mike Lightner 2010-08-22 21:42:54 UTC
r1767 applies this patch.  I also question whether making the change for explodemissile on the server side of things is the best choice or not.  We will have to revisit this.
Comment 28 Mike Lightner 2010-08-23 18:25:34 UTC
All problems mentioned in here are now resolved.
Comment 29 Charlie Gunyon 2010-08-27 20:43:21 UTC
Preventing the server from sending the svc_explodemissile message has lots of bad side effects, all stemming from the fact that missiles now don't always explode (perhaps due to packet loss?).  IMO this fix should be rolled back and a better solution explored, such as adding a bool parameter to the client's P_ExplodeMissile whether or not the function was invoked as a result of a collision or a network message, and to not play the explosion sound if invoked by a network message.
Comment 30 Mike Lightner 2010-08-28 17:23:49 UTC
The explodemissile change is not kosher.  r1810 reverts this.
Comment 31 Dr. Sean 2011-06-03 04:09:40 UTC
Created attachment 262 [details]
Fixes duplicate missile sound issues

Background:
There are a couple of causes of the duplicate sounds from missiles.  The first is that the client calls P_ExplodeMissile() several times either directly or through P_CheckMissile(), which would call P_ExplodeMissile() if the player was standing too close to a wall/thing.  Another bug hampering earlier efforts was the fact that when a missile is fired too close to a wall/thing, the server generates the missile and puts it in the back of the queue to notify players.  It then immediately sends players notification to explode the missile.  Unfortunately because of queuing, players didn't know about the missile yet when they received the message to explode the missile, resulting in no explosion sound if someone were to fix the first bug alone.

Patch:
When P_CheckMissile notices that a missile will be fired directly into a wall/thing, it directly notifies players about the missile spawning instead of queuing it.

Check that only the server is calling P_ExplodeMissile() in p_mobj.cpp.
Comment 32 Dr. Sean 2011-06-03 15:42:24 UTC
r2206 applies my above patch.

Printfs in S_Sound() [client/src/s_sound.cpp] indicate that only one sound is being played for missile explosions as well as for player death sounds.  Are there any other duplicate sounds still?
Comment 33 HeX_Vulture 2011-06-04 16:03:24 UTC
Dr Sean's patch works, however doors still play multiple sounds:

[10:48] <HeX9109`> fast doors
[10:50] <HeX9109`> In choco and vanilla when a fast door closes, it plays the sound twice due to a bug. In odamex offline it only plays once, online its multiple times
[10:51] <dr_sean> so online sometimes plays more than twice and offline always plays once?
[10:51] <HeX9109`> yes, appears that way
[10:51] <dr_sean> does the number of times it plays online vary?
[10:52] <HeX9109`> I’ll add these lines to the bug tracker
[10:52] <dr_sean> sometimes 2x, sometimes 3x?
[10:52] <HeX9109`> typically, it sounds like reproduced packets because its really random
[10:52] <HeX9109`> like clo-clo-cl-clo-close
[10:53] <dr_sean> I think that's a bug in the Thinker code being called an odd number of times.  It's why the death animation (bug 623) is sped up so much too.
Comment 34 Mike Lightner 2011-06-25 02:37:32 UTC
These have now all been fixed.  If anything comes up again, please post individual bugs with details on how to reproduce.  We would like to reduce the number of these single bugs that cover a wide variety of topics.