EDCD / EDDI

Companion application for Elite Dangerous
Other
453 stars 82 forks source link

Crash when audio files played in quick succession #2549

Closed Darkcyde13 closed 1 year ago

Darkcyde13 commented 1 year ago

What's Wrong (please be as specific as possible)

Expected

EDDI operates normally when audio files played in quick succession.

Observed

EDDI crashes to desktop when running a script that plays audio files by clicking the 'Test' button.

Steps to reproduce

  1. Create a script (or edit an existing one) that incudes playing an audio file.
  2. Click the 'Test' button to run the script.
  3. Click 'Test' again quickly, so that it either ends the speech early, or runs the script again. This will depend on how long the script is in general.
  4. Keep clicking the 'Test' button to repeat the script. Usually within 5 seconds.
  5. After a few tries, EDDI will freeze then crash.

Configuration

My Investigation

Investigation Notes

I've been experimenting with the 'Bond awarded' script, getting it to play audio files using the Play() function. I have a few different files to be played, depending on how many kills you have within a certain time. The code works well, however, when running it in quick succession, EDDI will suddenly freeze and then crash to desktop a second or two later.

I have tried this with v4.0.2 & v4.0.3-b2, plus with and without VA. I can make it crash consistently every time, using the method above. Having the script play in-game doesn't seem to make it crash, but I'm guessing that's because it's not happening fast enough to cause it.

And, yes, I am attempting to recreate an Unreal Tournament style "multi-kill" speech, hence why I'm trying to make it go fast. 😉

EDDI Logs

Verbose log. Loaded EDDI standalone, and started clicking the 'Test' button until it crashed. eddi.zip

Player journals

N/A

Darkcyde13 commented 1 year ago

I just ran my tests with beta 3, and it crashed again. I only managed to click about 3-4 times before it froze and crashed to desktop. eddi.log

Tkael commented 1 year ago

Really? It's been rock solid in my click-tests after yesterday's changes. :-(

Darkcyde13 commented 1 year ago

Maybe it's just the code, and files I'm playing then?

Here's a copy of my current test build of the 'Bond awarded' script, plus the audio files I'm playing. Kills.zip DC Bond awarded 4.0.3-b3.txt Configure the file path in the script on line 19, to where ever you extract them to.

I made a change to the script last night, but didn't test it until after beta 3, and now it's a bit hit and miss in game with it playing the sounds. Although that could just be me not getting kills fast enough to trigger it. Still, it does play a couple before crashing when I use the test button.

Darkcyde13 commented 1 year ago

Some more information that may be useful. I forced the on-foot sections of code to run by changing the vehicle = "On Foot" to != while I was not in game. Then, like you, I couldn't get it to crash, no matter how many times I clicked test.

I then loaded into game, changed the != back to = and disembarked from my ship onto a station. I then started clicking test again, and it crashed after only a couple. So, for some reason, it seems like it may only happen when I'm in game? But I can't see why that would be.

Tkael commented 1 year ago

It has to do with when objects are disposed / removed from memory. I think I've got an even more bullet-proof approach now. Sorry it's taken so many attempts but it is tricky to get right. :-D

Darkcyde13 commented 1 year ago

No worries. I appreciate your efforts with this. I'd rather you take your time to get it right. 🙂