View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004803 | The Dark Mod | Sound System | public | 28.05.2018 14:49 | 29.05.2018 16:36 |
Reporter | stgatilov | Assigned To | stgatilov | ||
Priority | low | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | TDM 2.06 | ||||
Target Version | TDM 2.07 | Fixed in Version | TDM 2.07 | ||
Summary | 0004803: TDM crashes if looping sound plays for 6+ hours | ||||
Description | This was noticed by Goldwell and explained here: http://forums.thedarkmod.com/topic/18982-tdm-206/page-30#entry422092 | ||||
Steps To Reproduce | 1. Start TDM game 2. Leave it for 7 hours (or 15 hours to be sure). Currently TDM crashes after 6-7 hours. | ||||
Additional Information | This is caused by overflow in "chan->openalStreamingOffset": it grows with speed +44100 per second (using +4096 steps), and when it reaches 2^30 TDM crashes in idSoundChannel::GatherChannelSamples due to sampleOffset44k = -2^31. | ||||
Tags | No tags attached. | ||||
chan->openalStreamingOffset += MIXBUFFER_SAMPLES; if(chan->openalStreamingOffset<0) chan->openalStreamingOffset = 0; ? Can it ever be negative outside of overflow? If no, change idSoundChannel::GatherChannelSamples to unsigned int? Make use of int64? |
|
I think it could. Otherwise you have to ensure that start time of sound is never greater than current time. It is a dangerous assertion (some part of sound system works in another thread). I have already fixed the problem locally by restarting the sound channel when its offset gets too large. This is not very nice (sound restarts), but it is simple and it surely does not affect anyone unless they listen to the same sound 6 hours without pause. So this sound restart happens only after 6 hours, and only once per 6 hours... Now I am waiting for 15-hours experiment to complete =) |
|
Here is the suggested fix: // 0004803 stgatilov: avoid offset overflow (which causes crash) if (chan->openalStreamingOffset * sample->objectInfo.nChannels > INT_MAX - (1<<20)) { //simply restart this sound (happens after 6.75 hours of repetition) chan->trigger44kHzTime = current44kHz; chan->openalStreamingOffset = 0; common->Warning("Restarted sound to avoid offset overflow: %s", chan->leadinSample->name.c_str()); } |
|
Fixed in svn rev 7423. | |
Date Modified | Username | Field | Change |
---|---|---|---|
28.05.2018 14:49 | stgatilov | New Issue | |
28.05.2018 14:49 | stgatilov | Status | new => assigned |
28.05.2018 14:49 | stgatilov | Assigned To | => stgatilov |
29.05.2018 10:27 | duzenko | Note Added: 0010477 | |
29.05.2018 10:33 | duzenko | Note Edited: 0010477 | |
29.05.2018 13:54 | stgatilov | Note Added: 0010481 | |
29.05.2018 13:54 | stgatilov | Note Edited: 0010481 | |
29.05.2018 13:55 | stgatilov | Note Added: 0010482 | |
29.05.2018 16:35 | stgatilov | Note Added: 0010483 | |
29.05.2018 16:36 | stgatilov | Status | assigned => resolved |
29.05.2018 16:36 | stgatilov | Fixed in Version | => TDM 2.07 |
29.05.2018 16:36 | stgatilov | Resolution | open => fixed |