Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AudioServer crashes when playing sounds through an AnimationPlayer #100173

Closed
SchimmelSpreu83 opened this issue Dec 8, 2024 · 6 comments · Fixed by #101097
Closed

AudioServer crashes when playing sounds through an AnimationPlayer #100173

SchimmelSpreu83 opened this issue Dec 8, 2024 · 6 comments · Fixed by #101097

Comments

@SchimmelSpreu83
Copy link

SchimmelSpreu83 commented Dec 8, 2024

Tested versions

  • Tested from Godot v4.4.dev4+
  • Apparently not reproducible in Godot v4.4.dev3

System information

Godot v4.4.dev6 - Windows 10.0.22621 - Multi-window, 3 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3050 (NVIDIA; 32.0.15.6081) - AMD Ryzen 5 4500 6-Core Processor (12 threads)

Issue description

The AudioServer(? - unsure because no error occurs) crashes when attempting to mass play audio-streams though an AnimationPlayer.

Afterwards no sound is ever played until restarting the game.

EDIT: Here is a video showing the issue:
https://github.com/user-attachments/assets/f1291d12-9c0c-4bc2-9c0b-87b1881b3ba0

Steps to reproduce

  • Add an AudioStreamPlayer(2D/3D).
  • Add an AnimationPlayer with a new animation.
  • Set the length to a very small value (eg. 0.075).
  • Add an AudioPlaybackTrack with any audio stream.
  • Mass play the animation over and over until the AudioDriver(?) crashes.

MRP tested without code but with signals.

Minimal reproduction project (MRP)

audio-issue-test.zip

Mash the 'Play' button and at some point the AudioDriver(?) should crash.

@timothyqiu
Copy link
Member

I can't reproduce this crash using the MRP. I'm on Linux though.

@matheusmdx
Copy link
Contributor

I was able to reproduce the issue and bisected to #97625, @SourceOfHTML

Image


A detail is if you try to close the game after the bug started, the entire game will freeze and become unresponsive, only being able to be closed by the task manager.

I did a small modification in the original mrp to make easier to debugger that, i used the _physics_process callback to call the animations in a way that make the bug happen in 1~2 seconds. I also added a code to kill the game process when press the Enter key to not need to open the task manager to do it (but needs to be pressed before attempt to close normally, otherwise everything will freeze).

audio-issue-test2.zip


Godot v4.4.dev3 - Windows 10.0.19045 - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated AMD Radeon RX 580 2048SP (Advanced Micro Devices, Inc.; 31.0.21921.1000) - AMD Ryzen 5 3600 6-Core Processor (12 threads)

@adamscott
Copy link
Member

Cannot reproduce on macOS (master). Is it a Windows-specific issue?

@matheusmdx
Copy link
Contributor

matheusmdx commented Jan 3, 2025

Me and the issue author is using Windows, the author of issue #100819 that seems to be the same problem also use windows and timothyqiu was unable to reproduce on Linux, so indeed seems to be windows specific.

@adamscott
Copy link
Member

@matheusmdx Could you test my new PR #101097? I think it could fix this issue.

@matheusmdx
Copy link
Contributor

Cherry-picked pr #101097 and i can confirm that fixes this issue and #100819

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Very Bad
Development

Successfully merging a pull request may close this issue.

6 participants