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

ALSA lib Invalid value for card #1855

Closed
GrbavaCigla opened this issue Apr 8, 2021 · 15 comments
Closed

ALSA lib Invalid value for card #1855

GrbavaCigla opened this issue Apr 8, 2021 · 15 comments
Labels
A-Audio Sounds playback and modification C-Bug An unexpected or incorrect behavior C-Startup A crash that occurs when first attempting to run a Bevy app O-Linux Specific to the Linux desktop operating system

Comments

@GrbavaCigla
Copy link

Info

Cargo version: 1.52.0-nightly (90691f2bf 2021-03-16)
Bevy version: 0.5
OS: Gentoo Linux

What you did

use bevy::prelude::*;

fn main() {
    App::build().add_plugins(DefaultPlugins).run();
}

What actually happened

ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.4/work/alsa-lib-1.2.4/src/pcm/pcm_direct.c:1846:(_snd_pcm_direct_get_slave_ipc_offset) Invalid value for card
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NoDevice', /home/cigla/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_audio-0.5.0/src/audio_output.rs:22:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@bjorn3
Copy link
Contributor

bjorn3 commented Apr 8, 2021

What does alsamixer show? And in particular which cards do you see when you press F6?

@bjorn3 bjorn3 added A-Audio Sounds playback and modification C-Bug An unexpected or incorrect behavior O-Linux Specific to the Linux desktop operating system labels Apr 8, 2021
@GrbavaCigla
Copy link
Author

│ Card: HD-Audio Generic                     F1:  Help               │
│ Chip: Realtek ALC887-VD                    F2:  System information │
│ View: F3:[Playback] F4: Capture  F5: All   F6:  Select sound card  │
│ Item: Surround [dB gain: 0.00, 0.00]       Esc: Exit               │
│                                                                    │
│                                                                    │
│                                                                    │
│                                                                    │
│     ┌──┐     ┌──┐     ┌──┐     ┌──┐     ┌──┐     ┌──┐     ┌──┐     │
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     │
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     │
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     │
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     →
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     →
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     →
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     →
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     →
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     →
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     →
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     →
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     →
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     →
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     │
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     │
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     │
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     │
│     ├──┤     ├──┤     └──┘     ├──┤     ├──┤     └──┘     ├──┤     │
│     │OO│     │MM│              │OO│     │MM│              │OO│     │
│     └──┘     └──┘              └──┘     └──┘              └──┘     │
│     100      0<>0    98<>98  100<>100   0<>0     0<>0   100<>100   │
│    Master  Headphon   PCM     Front   Front Mi Front Mi<Surround>  │
│                                                                    │
│                                                                    │
│                                                                    │
└────────────────────────────────────────────────────────────────────┘

After F6:

┌───────────────────────── AlsaMixer v1.2.4 ─────────────────────────┐
│ Card: HD-Audio Generic                     F1:  Help               │
│ Chip: Realtek ALC887-VD                    F2:  System information │
│ View: F3:[Playback] F4: Capture  F5: All   F6:  Select sound card  │
│ Item: Surround [dB gain: 0.00, 0.00]       Esc: Exit               │
│                                                                    │
│                                                                    │
│                                                                    │
│                                                                    │
│     ┌──┐     ┌──┐     ┌──┐     ┌──┐     ┌──┐     ┌──┐     ┌──┐     │
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     │
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     │
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     │
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     →
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     →
│     │▒▒│     │  │   ┌───── Sound Card ──────┐    │  │     │▒▒│     →
│     │▒▒│     │  │   │-  (default)           │    │  │     │▒▒│     →
│     │▒▒│     │  │   │0  HDA NVidia          │    │  │     │▒▒│     →
│     │▒▒│     │  │   │1  HD-Audio Generic    │    │  │     │▒▒│     →
│     │▒▒│     │  │   │   enter device name...│    │  │     │▒▒│     →
│     │▒▒│     │  │   └───────────────────────┘    │  │     │▒▒│     →
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     →
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     →
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     │
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     │
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     │
│     │▒▒│     │  │     │▒▒│     │▒▒│     │  │     │  │     │▒▒│     │
│     ├──┤     ├──┤     └──┘     ├──┤     ├──┤     └──┘     ├──┤     │
│     │OO│     │MM│              │OO│     │MM│              │OO│     │
│     └──┘     └──┘              └──┘     └──┘              └──┘     │
│     100      0<>0    98<>98  100<>100   0<>0     0<>0   100<>100   │
│    Master  Headphon   PCM     Front   Front Mi Front Mi<Surround>  │
│                                                                    │
│                                                                    │
│                                                                    │
└────────────────────────────────────────────────────────────────────┘

@bjorn3
Copy link
Contributor

bjorn3 commented Apr 8, 2021

I tried to pin point the location where in cpal the error originated, but I can't easily find it. Could you try to set a breakpoint at _snd_pcm_direct_get_slave_ipc_offset and get a backtrace? Please also continue after the breakpoint to check that this is the last time the function is called.

@GrbavaCigla
Copy link
Author

I don't know how to do that, /var/tmp/portage/media-libs/alsa-lib-1.2.4/work/alsa-lib-1.2.4/src/pcm/pcm_direct.c doesn't exist anymore. I tried reemerging alsa-lib, but again, couldn't find it. Here is rust backtrace if it is helpful:

    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
     Running `target/debug/bevy-test`
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.4/work/alsa-lib-1.2.4/src/pcm/pcm_direct.c:1846:(_snd_pcm_direct_get_slave_ipc_offset) Invalid value for card
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NoDevice', /home/cigla/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_audio-0.5.0/src/audio_output.rs:22:67
stack backtrace:
   0:     0x55b244c4f940 - std::backtrace_rs::backtrace::libunwind::trace::h5e9d00f0cdf4f57e
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x55b244c4f940 - std::backtrace_rs::backtrace::trace_unsynchronized::hd5302bd66215dab9
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55b244c4f940 - std::sys_common::backtrace::_print_fmt::ha0237cd11a34e2bf
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x55b244c4f940 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h171d4c10df1a98ee
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x55b244c70a2c - core::fmt::write::h89e4288724daa3fa
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/fmt/mod.rs:1096:17
   5:     0x55b244c4be32 - std::io::Write::write_fmt::h6d40f996e84584d9
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/io/mod.rs:1568:15
   6:     0x55b244c51ae5 - std::sys_common::backtrace::_print::h0c0b93221682afc8
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x55b244c51ae5 - std::sys_common::backtrace::print::h57a9f95204c2fdd6
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x55b244c51ae5 - std::panicking::default_hook::{{closure}}::h4245258b50e37e69
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/panicking.rs:208:50
   9:     0x55b244c51643 - std::panicking::default_hook::h7b00dcc1d0944747
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/panicking.rs:225:9
  10:     0x55b244c52281 - std::panicking::rust_panic_with_hook::h71e6a073d87de1f5
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/panicking.rs:591:17
  11:     0x55b244c51dc7 - std::panicking::begin_panic_handler::{{closure}}::hd549436f6bb6dbb8
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/panicking.rs:497:13
  12:     0x55b244c4fddc - std::sys_common::backtrace::__rust_end_short_backtrace::h4e5f4b72b04174c3
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/sys_common/backtrace.rs:141:18
  13:     0x55b244c51d29 - rust_begin_unwind
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/panicking.rs:493:5
  14:     0x55b244c6e171 - core::panicking::panic_fmt::hcd56f7f635f62c74
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/panicking.rs:92:14
  15:     0x55b244c6df93 - core::option::expect_none_failed::hf37eebedadde29e6
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/option.rs:1300:5
  16:     0x55b2442779b0 - core::result::Result<T,E>::unwrap::h142bfb92847fa726
                               at /home/cigla/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1037:23
  17:     0x55b244279802 - <bevy_audio::audio_output::AudioOutput<P> as core::default::Default>::default::hd05a6871154fa689
                               at /home/cigla/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_audio-0.5.0/src/audio_output.rs:22:39
  18:     0x55b244274c17 - <T as bevy_ecs::world::FromWorld>::from_world::ha8654c6008e1b82f
                               at /home/cigla/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.5.0/src/world/mod.rs:928:9
  19:     0x55b24426f412 - bevy_app::app_builder::AppBuilder::init_non_send_resource::he6a893113b52f991
                               at /home/cigla/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_app-0.5.0/src/app_builder.rs:272:28
  20:     0x55b244267da7 - <bevy_audio::AudioPlugin as bevy_app::plugin::Plugin>::build::h6dc5864086d5f8e6
                               at /home/cigla/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_audio-0.5.0/src/lib.rs:23:9
  21:     0x55b24495d66c - bevy_app::plugin_group::PluginGroupBuilder::finish::hbc4acea4fb585d29
                               at /home/cigla/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_app-0.5.0/src/plugin_group.rs:104:21
  22:     0x55b242a547ce - bevy_app::app_builder::AppBuilder::add_plugins::hfb16b0bbbc732898
                               at /home/cigla/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_app-0.5.0/src/app_builder.rs:295:9
  23:     0x55b242a545cc - bevy_test::main::hc52ec2d6e3993d20
                               at /home/cigla/Dev/bevy-test/src/main.rs:4:5
  24:     0x55b242a546bb - core::ops::function::FnOnce::call_once::h80bf1b589706b1ad
                               at /home/cigla/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
  25:     0x55b242a54a4e - std::sys_common::backtrace::__rust_begin_short_backtrace::h2144635f510fb430
                               at /home/cigla/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125:18
  26:     0x55b242a54a21 - std::rt::lang_start::{{closure}}::h936f8f70b231dc57
                               at /home/cigla/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66:18
  27:     0x55b244c526a7 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h527fb2333ede305e
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/ops/function.rs:259:13
  28:     0x55b244c526a7 - std::panicking::try::do_call::h309d8aee8149866c
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/panicking.rs:379:40
  29:     0x55b244c526a7 - std::panicking::try::h75a60c31fd16bfc6
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/panicking.rs:343:19
  30:     0x55b244c526a7 - std::panic::catch_unwind::h1f9892423e99bc00
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/panic.rs:431:14
  31:     0x55b244c526a7 - std::rt::lang_start_internal::hd5b67df56ca01dae
                               at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/rt.rs:51:25
  32:     0x55b242a549f7 - std::rt::lang_start::h19567ec3087b03ac
                               at /home/cigla/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:65:5
  33:     0x55b242a5464a - main
  34:     0x7ffbb5a577fd - __libc_start_main
  35:     0x55b242a543ba - _start
  36:                0x0 - <unknown>

@bjorn3
Copy link
Contributor

bjorn3 commented Apr 8, 2021

You can run break _snd_pcm_direct_get_slave_ipc_offset in gdb to set the breakpoint.

@GrbavaCigla
Copy link
Author

On what file should I run gdb? Also I am more comfortable with radare :D

@bjorn3
Copy link
Contributor

bjorn3 commented Apr 9, 2021

You need to run gdb on the game executable.

@GrbavaCigla
Copy link
Author

I tried but it tells me there is no _snd_pcm_direct_get_slave_ipc_offset. I will try again tomorrow.

@GrbavaCigla
Copy link
Author

(gdb) break _snd_pcm_direct_get_slave_ipc_offset
Function "_snd_pcm_direct_get_slave_ipc_offset" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (_snd_pcm_direct_get_slave_ipc_offset) pending.
(gdb) run
Starting program: /home/cigla/Dev/bevy-test/target/debug/bevy-test
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff7894640 (LWP 31773)]
[New Thread 0x7ffff7693640 (LWP 31774)]
[New Thread 0x7ffff7492640 (LWP 31775)]
[New Thread 0x7ffff7291640 (LWP 31776)]
[New Thread 0x7ffff7090640 (LWP 31777)]
[New Thread 0x7ffff6e8f640 (LWP 31778)]
[New Thread 0x7ffff6c8e640 (LWP 31779)]
[New Thread 0x7ffff6a8d640 (LWP 31780)]
[New Thread 0x7ffff688c640 (LWP 31781)]
[New Thread 0x7ffff668b640 (LWP 31782)]
[New Thread 0x7ffff648a640 (LWP 31783)]
[New Thread 0x7ffff6289640 (LWP 31784)]
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.4/work/alsa-lib-1.2.4/src/pcm/pcm_direct.c:1846:(_snd_pcm_direct_get_slave_ipc_offset) Invalid value for card
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NoDevice', /home/cigla/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_audio-0.5.0/src/audio_output.rs:22:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[Thread 0x7ffff7090640 (LWP 31777) exited]
[Thread 0x7ffff6e8f640 (LWP 31778) exited]
[Thread 0x7ffff7291640 (LWP 31776) exited]
[Thread 0x7ffff668b640 (LWP 31782) exited]
[Thread 0x7ffff648a640 (LWP 31783) exited]
[Thread 0x7ffff6289640 (LWP 31784) exited]
[Thread 0x7ffff688c640 (LWP 31781) exited]
[Thread 0x7ffff6a8d640 (LWP 31780) exited]
[Thread 0x7ffff6c8e640 (LWP 31779) exited]
[Thread 0x7ffff7492640 (LWP 31775) exited]
[Thread 0x7ffff7693640 (LWP 31774) exited]
[Thread 0x7ffff7894640 (LWP 31773) exited]
[Inferior 1 (process 31745) exited with code 0145]
(gdb)

@thechubbypanda
Copy link

thechubbypanda commented Aug 21, 2021

Bump, same error.

Cargo version: cargo 1.56.0-nightly (e96bdb0c3 2021-08-17)
Bevy version: latest branch
OS: ArchLinux

ALSA lib pcm_dmix.c:1035:(snd_pcm_dmix_open) unable to open slave
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NoDevice', /home/keval/.cargo/git/checkouts/bevy-9ae29307e9bb7454/db55bf5/crates/bevy_audio/src/audio_output.rs:22:67
stack backtrace:
   0: rust_begin_unwind
             at /rustc/3d0774d0dc98084d25d95cc1909a8051ebbd9cb1/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/3d0774d0dc98084d25d95cc1909a8051ebbd9cb1/library/core/src/panicking.rs:93:14
   2: core::result::unwrap_failed
             at /rustc/3d0774d0dc98084d25d95cc1909a8051ebbd9cb1/library/core/src/result.rs:1617:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/3d0774d0dc98084d25d95cc1909a8051ebbd9cb1/library/core/src/result.rs:1299:23
   4: <bevy_audio::audio_output::AudioOutput<P> as core::default::Default>::default
             at /home/keval/.cargo/git/checkouts/bevy-9ae29307e9bb7454/db55bf5/crates/bevy_audio/src/audio_output.rs:22:39
   5: <T as bevy_ecs::world::FromWorld>::from_world
             at /home/keval/.cargo/git/checkouts/bevy-9ae29307e9bb7454/db55bf5/crates/bevy_ecs/src/world/mod.rs:928:9
   6: bevy_app::app_builder::AppBuilder::init_non_send_resource
             at /home/keval/.cargo/git/checkouts/bevy-9ae29307e9bb7454/db55bf5/crates/bevy_app/src/app_builder.rs:272:28
   7: <bevy_audio::AudioPlugin as bevy_app::plugin::Plugin>::build
             at /home/keval/.cargo/git/checkouts/bevy-9ae29307e9bb7454/db55bf5/crates/bevy_audio/src/lib.rs:23:9
   8: bevy_app::plugin_group::PluginGroupBuilder::finish
             at /home/keval/.cargo/git/checkouts/bevy-9ae29307e9bb7454/db55bf5/crates/bevy_app/src/plugin_group.rs:104:21
   9: bevy_app::app_builder::AppBuilder::add_plugins
             at /home/keval/.cargo/git/checkouts/bevy-9ae29307e9bb7454/db55bf5/crates/bevy_app/src/app_builder.rs:295:9
  10: expanse::main
             at ./src/main.rs:4:5
  11: core::ops::function::FnOnce::call_once
             at /rustc/3d0774d0dc98084d25d95cc1909a8051ebbd9cb1/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

image

(gdb) break _snd_pcm_direct_get_slave_ipc_offset
Function "_snd_pcm_direct_get_slave_ipc_offset" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (_snd_pcm_direct_get_slave_ipc_offset) pending.
(gdb) run
Starting program: /home/keval/Documents/irs/expanse/target/debug/expanse
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff7862640 (LWP 16588)]
[New Thread 0x7fffeffff640 (LWP 16589)]
[New Thread 0x7ffff7661640 (LWP 16590)]
[New Thread 0x7ffff7460640 (LWP 16591)]
[New Thread 0x7ffff725f640 (LWP 16592)]
[New Thread 0x7ffff705e640 (LWP 16593)]
[New Thread 0x7ffff6e5d640 (LWP 16594)]
[New Thread 0x7ffff6c5c640 (LWP 16595)]
[New Thread 0x7ffff6a5b640 (LWP 16596)]
[New Thread 0x7ffff685a640 (LWP 16597)]
[New Thread 0x7ffff6659640 (LWP 16598)]
[New Thread 0x7ffff6458640 (LWP 16599)]
[New Thread 0x7ffff6257640 (LWP 16600)]
[New Thread 0x7ffff6056640 (LWP 16601)]
[New Thread 0x7ffff5e55640 (LWP 16602)]
[New Thread 0x7ffff5c54640 (LWP 16603)]
ALSA lib pcm_dmix.c:1035:(snd_pcm_dmix_open) unable to open slave
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NoDevice', /home/keval/.cargo/git/checkouts/bevy-9ae29307e9bb7454/db55bf5/crates/bevy_audio/src/audio_output.rs:22:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[Thread 0x7ffff6c5c640 (LWP 16595) exited]
[Thread 0x7ffff6e5d640 (LWP 16594) exited]
[Thread 0x7ffff705e640 (LWP 16593) exited]
[Thread 0x7ffff725f640 (LWP 16592) exited]
[Thread 0x7ffff6a5b640 (LWP 16596) exited]
[Thread 0x7ffff5e55640 (LWP 16602) exited]
[Thread 0x7ffff6659640 (LWP 16598) exited]
[Thread 0x7ffff6458640 (LWP 16599) exited]
[Thread 0x7ffff685a640 (LWP 16597) exited]
[Thread 0x7ffff6056640 (LWP 16601) exited]
[Thread 0x7ffff6257640 (LWP 16600) exited]
[Thread 0x7ffff5c54640 (LWP 16603) exited]
[Thread 0x7ffff7460640 (LWP 16591) exited]
[Thread 0x7ffff7661640 (LWP 16590) exited]
[Thread 0x7fffeffff640 (LWP 16589) exited]
[Thread 0x7ffff7862640 (LWP 16588) exited]
[Inferior 1 (process 16585) exited with code 0145]

@thechubbypanda
Copy link

thechubbypanda commented Aug 21, 2021

Just solved my issue

  1. Add user to the audio group using
sudo usermod -aG audio <user>
  1. Create ~/.asoudrc
pcm.!default {
        type hw
        card 2
}

ctl.!default {
        type hw
        card 2
}

but replace the card number with your desired default output in both cases. May work with just pcm.

@thechubbypanda
Copy link

Ok, so it turns out that using the aforementioned config, the game requires sole access to card 2.

If I'm playing music and then cargo run, I get the error again.

@thechubbypanda
Copy link

When using Bevy main branch with the ~/.asoundrc file above, I can run the game while playing music simultaneously with no errors.

@thechubbypanda
Copy link

Please see #2699 for a potential solution :)

@alice-i-cecile alice-i-cecile added the C-Startup A crash that occurs when first attempting to run a Bevy app label Mar 21, 2022
@SolarLiner
Copy link
Contributor

Looks like this is a duplicate of #2699 (or rather, it is a duplicate of this, but it got closed before this one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Audio Sounds playback and modification C-Bug An unexpected or incorrect behavior C-Startup A crash that occurs when first attempting to run a Bevy app O-Linux Specific to the Linux desktop operating system
Projects
Status: Done
Development

No branches or pull requests

5 participants