View Issue Details

IDProjectCategoryView StatusLast Update
0003969The Dark ModSound Systempublic09.09.2017 04:39
ReporterSteveL Assigned Tostgatilov  
PrioritynormalSeveritynormalReproducibilityalways
Status resolvedResolutionfixed 
Product VersionTDM 2.03 
Target VersionTDM 2.06Fixed in VersionTDM 2.06 
Summary0003969: Using "machine_hum04_loop" as a sound shader on a light causes crash to desktop
DescriptionDiscovered this in a map of Biker's that was crashing. Lots of lights have a sound shader that adjusts the light level in that map, but only this one seems to cause a crash.

Most of those shaders are WAVs, but this one is an OGG.

The crash occurs after idSoundWorldLocal::FindAmplitude calls SIMD code to get a sample. The stack is being corrupted around the "sourceBuffer" array pointer, which is written to by the SIMD code.
Steps To ReproduceTest map attached. The crash will happen within a few seconds but not immediately.
Additional InformationI tried greebo's fix for dangling ogg pointers 0003804 but it doesn't help here.

Map entity:
{
"classname" "light"
"name" "light_1"
"_color" "0.21 0.17 0.04"
"light_center" "0 0 0"
"light_radius" "480 432 320"
"nodiffuse" "0"
"noshadows" "0"
"nospecular" "0"
"origin" "132 182 90"
"parallel" "0"
"texture" "lights/biground1_squarelamp_snd"
"s_looping" "1"
"s_shader" "machine_hum04_loop"
}
TagsNo tags attached.
Attached Files
humlight.map (6,588 bytes)   
Version 2
// entity 0
{
"classname" "worldspawn"
"editor_drLastCameraPos" "134.888 86.3868 97.8257"
"editor_drLastCameraAngle" "-14.7 95.7 0"
"editor_drMapPos1" "622.965 891.597 194.506"
"editor_drMapAngle1" "0 4.7 0"
"editor_drMapPos2" "856 856 194.506"
"editor_drMapAngle2" "0 -88.6028 0"
"editor_drMapPos3" "832 264 194.506"
"editor_drMapAngle3" "0 82.1467 0"
"editor_drMapPos4" "462.987 512.708 197.518"
"editor_drMapAngle4" "-2.8 151.047 0"
"editor_drMapPos5" "395.633 301.73 201.855"
"editor_drMapAngle5" "-2.6 187.447 0"
"editor_drMapPos6" "406.528 296.563 56.6098"
"editor_drMapAngle6" "-4 187.247 0"
"editor_drMapPos7" "952.822 285.005 1366.04"
"editor_drMapAngle7" "-74.8 149.373 0"
"editor_drMapPos8" "976 424 320"
"editor_drMapAngle8" "-3 15.3467 0"
"editor_drMapPos9" "409.146 547.464 392.83"
"editor_drMapAngle9" "-16.8 284.947 0"
// primitive 0
{
brushDef3
{
( 0 0 1 -208 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -320 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -64 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 1
{
brushDef3
{
( 0 0 1 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -336 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 0 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 320 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 2
{
brushDef3
{
( 0 1 0 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -320 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 -16 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -64 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 1 0 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 3
{
brushDef3
{
( 0 0 1 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -320 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 0 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -208 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -64 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 4
{
brushDef3
{
( 0 0 1 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 0 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -80 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 64 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 5
{
brushDef3
{
( 0 0 1 -192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 -208 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -64 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 192 ) ( ( 0.01302083302289248 0 0 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -320 ) ( ( 0.01302083302289248 0 -3.541666507720947 ) ( 0 0.01302083302289248 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 0 ) ( ( 0.01302083302289248 0 -3.541666507720947 ) ( 0 0.01302083302289248 0.5208333134651184 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
}
// entity 1
{
"classname" "atdm:ambient_world"
"name" "ambient_world"
"_color" "0.22 0.22 0.22"
"light_center" "0 0 0"
"light_radius" "832 624 320"
"nodiffuse" "0"
"noshadows" "0"
"nospecular" "0"
"origin" "-32 0 160"
"parallel" "0"
"texture" "lights/ambientlightnfo"
}
// entity 2
{
"classname" "info_player_start"
"name" "info_player_start_1"
"angle" "90"
"origin" "117 -162 0"
}
// entity 3
{
"classname" "light"
"name" "light_1"
"_color" "0.21 0.17 0.04"
"light_center" "0 0 0"
"light_radius" "480 432 320"
"nodiffuse" "0"
"noshadows" "0"
"nospecular" "0"
"origin" "132 182 90"
"parallel" "0"
"texture" "lights/biground1_squarelamp_snd"
"s_looping" "1"
"s_shader" "machine_hum04_loop"
}
// entity 4
{
"classname" "func_static"
"name" "func_static_1"
"origin" "132 184 88"
"model" "models/darkmod/lights/non-extinguishable/wallight1.lwo"
"noshadows" "1"
}
humlight.map (6,588 bytes)   

Relationships

has duplicate 0003941 closedSteveL Blinking electric lighs can crash TDM in at least one map 
related to 0003535 closedSTiFU Some sounds that are stereo should be mono 

Activities

bibendovsky

bibendovsky

11.12.2014 08:48

reporter   ~0007236

Since "sound\ambient\environmental\machine_hum04_loop.ogg" is stereo method UpSampleOGGTo44kHz produces twice more data into provided buffer.
SteveL

SteveL

11.12.2014 09:55

reporter   ~0007237

Aha! Thanks, I'll check it out. Are you a forum user by the way?
bibendovsky

bibendovsky

11.12.2014 11:00

reporter   ~0007238

Yes, with the same name as here.
bibendovsky

bibendovsky

11.12.2014 12:11

reporter   ~0007239

Attached a document with "suspicious" audio files.
First sheet contains list of all stereo files.
Second sheet contains list of audio files with non-optimal (not equal to 44100 Hz) sampling rate.
SteveL

SteveL

11.12.2014 12:45

reporter   ~0007241

Wow do we really have that many stereo sounds? I thought we shouldn't have stereo sounds in game because the sound system itself take care of placing the source of the sound. Ah, I found an existing tracker. It's not quite that bad, it's just point sounds apparently that are a problem in stereo.

Thanks for the detective work!
SteveL

SteveL

30.12.2015 15:24

reporter   ~0007936

This is complicated to fix and has an easy workaround. Bumping to 2.05.

user81

04.01.2016 17:06

  ~0007973

Last edited: 04.01.2016 17:07

nb. in the city map Im working on that you refereed too, simply changing the shader fixed the crash. So as a quick fix could be not just edit the .MTR for any lights that use that sound..?

SteveL

SteveL

04.01.2016 18:15

reporter   ~0007975

Not using any stereo sounds as light shaders is the quick fix, if I remember right.
Darkness_Falls

Darkness_Falls

23.02.2017 02:55

reporter   ~0008755

If it helps or if it's any consolation: early on, we were experimenting with giving machine sounds a cool T2-style 'swirl' type effect by reversing one of the audio channels. This was, apparently, the same technique they used for some machines in T2, and it required stereo rather than mono.

That's the main reason why some of my ambient sounds were in stereo. Here's a thread that talked about the technique: http://forums.thedarkmod.com/topic/1048-machine-sounds/
stgatilov

stgatilov

08.09.2017 17:44

administrator   ~0009182

Commented out the two resampling methods of idSIMD_SSE. The methods from idSIMD_Generic work properly.
Committed in SVN rev 7123.

I profiled running around training mission afterwards:
  idSIMD_Generic::UpSampleOGGTo44kHz 7
  idSIMD_SSE::DeriveTangents 832
  ov_read_float 2988
So upsampling takes 400 times less time than OGG decoding itself.
stgatilov

stgatilov

09.09.2017 04:39

administrator   ~0009193

I am putting this issue to resolved state.
Note that it contains attachment which is useful for related issue 0003535.

Issue History

Date Modified Username Field Change
10.12.2014 21:46 SteveL New Issue
10.12.2014 21:47 SteveL File Added: humlight.map
10.12.2014 21:48 SteveL Additional Information Updated
11.12.2014 08:48 bibendovsky Note Added: 0007236
11.12.2014 09:55 SteveL Note Added: 0007237
11.12.2014 11:00 bibendovsky Note Added: 0007238
11.12.2014 12:08 bibendovsky File Added: tdm_suspicious_audio_files.ods
11.12.2014 12:11 bibendovsky Note Added: 0007239
11.12.2014 12:44 SteveL Relationship added related to 0003535
11.12.2014 12:45 SteveL Note Added: 0007241
15.12.2014 18:52 SteveL Assigned To => SteveL
15.12.2014 18:52 SteveL Status new => assigned
15.12.2014 18:52 SteveL Target Version => TDM 2.04
06.04.2015 16:37 SteveL Relationship added has duplicate 0003941
30.12.2015 15:24 SteveL Note Added: 0007936
30.12.2015 15:28 SteveL Target Version TDM 2.04 => TDM 2.05
04.01.2016 17:06 user81 Note Added: 0007973
04.01.2016 17:07 user81 Note Edited: 0007973
04.01.2016 18:15 SteveL Note Added: 0007975
25.11.2016 14:00 grayman Target Version TDM 2.05 => TDM 2.06
15.02.2017 04:34 grayman Assigned To SteveL =>
15.02.2017 04:34 grayman Status assigned => new
23.02.2017 02:55 Darkness_Falls Note Added: 0008755
08.09.2017 17:29 stgatilov Assigned To => stgatilov
08.09.2017 17:29 stgatilov Status new => assigned
08.09.2017 17:44 stgatilov Note Added: 0009182
09.09.2017 04:39 stgatilov Note Added: 0009193
09.09.2017 04:39 stgatilov Status assigned => resolved
09.09.2017 04:39 stgatilov Fixed in Version => TDM 2.06
09.09.2017 04:39 stgatilov Resolution open => fixed