not-fl3 / macroquad

Cross-platform game engine in Rust.
Apache License 2.0
3.37k stars 324 forks source link

Sound issues #584

Open vie216 opened 1 year ago

vie216 commented 1 year ago

First of all, thank you for this great library! But... I am on Debian 11 Testing, and every time I launching my game, I see it:

thread '<unnamed>' panicked at 'Can't set rate.', /home/vie/.cargo/registry/src/github.com-1ecc6299db9ec823/quad-snd-0.2.7/src/alsa_snd.rs:57:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

and sound not working. I have libasound2-dev + libasound2 installed, and I am using i3wm, when I was at Gnome, all was good, and, I think, I just need to install some library...

mongrol commented 1 year ago

Confirmed on arch linux, Gnome/Wayland/Pipewire. Here's a backtrace.

Running target/debug/examples/snake GL_VERSION: 4.6 (Compatibility Profile) Mesa 23.0.1 thread '' panicked at 'Can't set rate.', /home/mongrol/.cargo/registry/src/github.com-1ecc6299db9ec823/quad-snd-0.2.7/src/alsa_snd.rs:57:9 stack backtrace: 0: 0x55bdc8be447d - std::backtrace_rs::backtrace::libunwind::trace::h8217d0a8f3fd2f41 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5 1: 0x55bdc8be447d - std::backtrace_rs::backtrace::trace_unsynchronized::h308103876b3af410 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x55bdc8be447d - std::sys_common::backtrace::_print_fmt::hc208018c6153605e at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:66:5 3: 0x55bdc8be447d - ::fmt::hf89a7ed694dfb585 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:45:22 4: 0x55bdc8bffd5c - core::fmt::write::h21038c1382fe4264 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/fmt/mod.rs:1197:17 5: 0x55bdc8be23f1 - std::io::Write::write_fmt::h7dbb1c9a3c254aef at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/io/mod.rs:1672:15 6: 0x55bdc8be5bf5 - std::sys_common::backtrace::_print::h4e8889719c9ddeb8 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:48:5 7: 0x55bdc8be5bf5 - std::sys_common::backtrace::print::h1506fe2cb3022667 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:35:9 8: 0x55bdc8be5bf5 - std::panicking::default_hook::{{closure}}::hd9d7ce2a8a782440 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:295:22 9: 0x55bdc8be5916 - std::panicking::default_hook::h5b16ec25444b1b5d at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:314:9 10: 0x55bdc8be6186 - std::panicking::rust_panic_with_hook::hb0138cb6e6fea3e4 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:698:17 11: 0x55bdc8bb9f5b - std::panicking::begin_panic::{{closure}}::h36b0efd9ab80180e at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:617:9 12: 0x55bdc8bb9e56 - std::sys_common::backtrace::__rust_end_short_backtrace::h3ca2adb02011799d at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:138:18 13: 0x55bdc8addfd6 - std::panicking::begin_panic::h4dede36004096baf at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:616:12 14: 0x55bdc8bb9a40 - quad_snd::snd::setup_pcm_device::h2910594dee68cc87 at /home/mongrol/.cargo/registry/src/github.com-1ecc6299db9ec823/quad-snd-0.2.7/src/alsa_snd.rs:57:9 15: 0x55bdc8bb9a40 - quad_snd::snd::audio_thread::h832489354907cf9c at /home/mongrol/.cargo/registry/src/github.com-1ecc6299db9ec823/quad-snd-0.2.7/src/alsa_snd.rs:104:22 16: 0x55bdc8bb9ed7 - quad_snd::snd::AudioContext::new::{{closure}}::hfdad6468dbcdcd0c at /home/mongrol/.cargo/registry/src/github.com-1ecc6299db9ec823/quad-snd-0.2.7/src/alsa_snd.rs:160:13 17: 0x55bdc8bb9ed7 - std::sys_common::backtrace::__rust_begin_short_backtrace::h710ec50ab7d7a21b at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:122:18 18: 0x55bdc8bbacea - std::thread::Builder::spawnunchecked::{{closure}}::{{closure}}::h163c8612c01143cb at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/thread/mod.rs:505:17 19: 0x55bdc8bbacea - <core::panic::unwind_safe::AssertUnwindSafe as core::ops::function::FnOnce<()>>::call_once::h5a70add44862e93e at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panic/unwind_safe.rs:271:9 20: 0x55bdc8bbacea - std::panicking::try::do_call::hb2e43b57ebb36870 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:492:40 21: 0x55bdc8bbacea - std::panicking::try::h76b7313ee2cb9c12 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:456:19 22: 0x55bdc8bbacea - std::panic::catch_unwind::hf5e6a5bdcaeb333e at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panic.rs:137:14 23: 0x55bdc8bbacea - std::thread::Builder::spawnunchecked::{{closure}}::he8b5e595b3bf4a36 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/thread/mod.rs:504:30 24: 0x55bdc8bbacea - core::ops::function::FnOnce::call_once{{vtable.shim}}::h337e388c27668d66 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/ops/function.rs:248:5 25: 0x55bdc8be8aa3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce>::call_once::h1680342795a2dc08 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/alloc/src/boxed.rs:1951:9 26: 0x55bdc8be8aa3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce>::call_once::h45204a69827b0e83 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/alloc/src/boxed.rs:1951:9 27: 0x55bdc8be8aa3 - std::sys::unix::thread::Thread::new::thread_start::h5d4e11bbda4161c8 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys/unix/thread.rs:108:17 28: 0x7f24c742ebb5 - 29: 0x7f24c74b0d90 - 30: 0x0 -

Mmd4J commented 2 days ago

I'm facing the same thing i guess after a year. And guess what Im on linux as well. Arch based linux KDE Plasma

thread '' panicked at /home/mmd4j/.cargo/registry/src/index.crates.io-6f17d22bba15001f/quad-snd-0.2.8/src/alsa_snd.rs:57:9: Can't set rate.