amethyst / amethyst

Data-oriented and data-driven game engine written in Rust
https://amethyst.rs/
Other
7.99k stars 742 forks source link

[BUG] audio play panics with external USB audio interface #2476

Closed p-ruszkowski closed 2 years ago

p-ruszkowski commented 4 years ago

Description

Creating a pong game with the pong tutorial causes panic with memory leaks on play_once call.

This issue happens only when the Tascam US-16x08 device is selected. Moreover, the issue does not occur if the aggregate device (macOS) with the USB interface is created and used. I was not able to reproduce this issue with any other external USB audio device.

Reproduction Steps

  1. Clone https://github.com/amethyst/amethyst/tree/master/examples/pong_tutorial_06
  2. Select a Tascam USB audio interface as an output device in system settings
  3. build and try to run a pong game.

What You Expected to Happen

bounce sound is played

What Actually Happened

Game panics.

pub fn play_bounce_sound(sounds: &Sounds, storage: &AssetStorage<Source>, output: Option<&Output>) {

    if let Some(ref output) = output.as_ref() {
        if let Some(sound) = storage.get(&sounds.bounce_sfx) {
            output.play_once(sound, 1.0); // <- Panics here!
        }
    }
}

Console output: log.txt

Your Environment

  1. Operating system: macOS 10.15.6 (MacBook Pro 16" 2019)
  2. Amethyst version: 0.15.3

Additional informations

I was trying to catch the result with the match and .try_play_once() method, but the panic occurs somewhere deeper so neither Ok() or Err() was returned.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. Maybe it's time to revisit this?