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

doesn't work on linux (brew) #14

Open
abitrolly opened this issue Jun 26, 2024 · 5 comments
Open

doesn't work on linux (brew) #14

abitrolly opened this issue Jun 26, 2024 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@abitrolly
Copy link

✗ asak rec   
> Please enter the output wav file name: 2024-06-26T09:42:32Z.wav
ALSA lib dlmisc.c:339:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_pcm_pipewire.so (/home/linuxbrew/.linuxbrew/Cellar/alsa-lib/1.2.12/lib/alsa-lib/libasound_module_pcm_pipewire.so: cannot open shared object file: No such file or directory)
thread 'main' panicked at src/record.rs:190:48:
called `Result::unwrap()` on an `Err` value: BackendSpecific { err: BackendSpecificError { description: "ALSA function 'snd_pcm_open' failed with error 'ENXIO: No such device or address'" } }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
✗ asak -V
asak 0.3.3
@chaosprint
Copy link
Owner

seems to be an isolated case. need more system information. can you run https://github.com/RustAudio/cpal/blob/master/examples/beep.rs ?

@abitrolly
Copy link
Author

@chaosprint no. how to run it?

@chaosprint
Copy link
Owner

@chaosprint no. how to run it?

  1. install rust https://www.rust-lang.org/tools/install
  2. git clone https://github.com/RustAudio/cpal.git
  3. cd cpal then cargo run --example beep

@chaosprint chaosprint added the help wanted Extra attention is needed label Jun 28, 2024
@abitrolly
Copy link
Author

@chaosprint using brew own rust, it beeps okay.

$ cargo run --example beep
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.22s
     Running `target/debug/examples/beep`
Output device: default
Default output config: SupportedStreamConfig { channels: 2, sample_rate: SampleRate(44100), buffer_size: Range { min: 1, max: 4194304 }, sample_format: F32 }

@abitrolly
Copy link
Author

I suspect there are some problems with dependencies. At least I don't see the /home/linuxbrew/.linuxbrew/Cellar/alsa-lib/1.2.12/lib/alsa-lib/libasound_module_pcm_pipewire.so the it is trying to find.

$ ls -la /home/linuxbrew/.linuxbrew/Cellar/alsa-lib/1.2.12/lib/
total 1536
drwxr-xr-x. 3 anatoli anatoli    4096 Jun 10 12:21 .
drwxr-xr-x. 7 anatoli anatoli    4096 Jun 25 10:32 ..
lrwxrwxrwx. 1 anatoli anatoli      18 Jun 10 12:21 libasound.so -> libasound.so.2.0.0
lrwxrwxrwx. 1 anatoli anatoli      18 Jun 10 12:21 libasound.so.2 -> libasound.so.2.0.0
-r-xr-xr-x. 1 anatoli anatoli 1415344 Jun 25 10:32 libasound.so.2.0.0
lrwxrwxrwx. 1 anatoli anatoli      21 Jun 10 12:21 libatopology.so -> libatopology.so.2.0.0
lrwxrwxrwx. 1 anatoli anatoli      21 Jun 10 12:21 libatopology.so.2 -> libatopology.so.2.0.0
-r-xr-xr-x. 1 anatoli anatoli  141032 Jun 25 10:32 libatopology.so.2.0.0
drwxr-xr-x. 2 anatoli anatoli    4096 Jun 25 10:32 pkgconfig

Maybe it is possible to use pipewire API directly?

$ RUST_BACKTRACE=full asak rec
> Please enter the output wav file name: 2024-08-25T08:01:23Z.wav
ALSA lib dlmisc.c:339:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_pcm_pipewire.so (/home/linuxbrew/.linuxbrew/Cellar/alsa-lib/1.2.12/lib/alsa-lib/libasound_module_pcm_pipewire.so: cannot open shared object file: No such file or directory)
thread 'main' panicked at src/record.rs:190:48:
called `Result::unwrap()` on an `Err` value: BackendSpecific { err: BackendSpecificError { description: "ALSA function 'snd_pcm_open' failed with error 'ENXIO: No such device or address'" } }
stack backtrace:
   0:     0x5653f22c9433 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbda7c3330b76b437
   1:     0x5653f22fe73b - core::fmt::write::hee065f498a437b63
   2:     0x5653f22e9569 - std::io::Write::write_fmt::h28ccbda31f8dd69d
   3:     0x5653f22c91de - std::sys_common::backtrace::print::h57b1ad9daa6b84c6
   4:     0x5653f22d961a - std::panicking::default_hook::{{closure}}::hbd97eb4a5a844a4d
   5:     0x5653f22d9309 - std::panicking::default_hook::hb724a0939781c6c8
   6:     0x5653f22d9aa9 - std::panicking::rust_panic_with_hook::h8f8358b343f0b2ef
   7:     0x5653f22c9814 - std::panicking::begin_panic_handler::{{closure}}::hc889d001bab94772
   8:     0x5653f22c9649 - std::sys_common::backtrace::__rust_end_short_backtrace::he28ae66ea2972a76
   9:     0x5653f22d97a7 - rust_begin_unwind
  10:     0x5653f2198df3 - core::panicking::panic_fmt::h0aadae23e6f3d820
  11:     0x5653f2198c86 - core::result::unwrap_failed::ha695eee954f0fbc7
  12:     0x5653f21b7a6c - asak::record::record_audio::h0285f1712ca91da0
  13:     0x5653f21d1160 - asak::main::h763222923d7689ba
  14:     0x5653f21c4fb3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h7b6e27845298eb88
  15:     0x5653f21d53f9 - std::rt::lang_start::{{closure}}::hcd2ee7c5e5561e24
  16:     0x5653f22d9697 - std::panicking::try::hcfe0dc5182a9d8e7
  17:     0x5653f22b76ce - std::rt::lang_start_internal::hd497a329b0aac2b5
  18:     0x5653f21d4c55 - main
  19:     0x7f401841b088 - __libc_start_call_main
  20:     0x7f401841b14b - __libc_start_main_alias_1
  21:     0x5653f2199285 - _start
  22:                0x0 - <unknown> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants