aizcutei / ruhear

Capture system output audio in rust.
Apache License 2.0
6 stars 2 forks source link

Error from cargo run --example capture #6

Open kaiwen-wang opened 1 day ago

kaiwen-wang commented 1 day ago

I allowed the permissions as well.

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/examples/capture`
thread '<unnamed>' panicked at /Users/kaiwen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc_id-0.1.1/src/id.rs:52:9:
Attempted to construct an Id from a null pointer
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at library/core/src/panicking.rs:221:5:
panic in a function that cannot unwind
stack backtrace:
   0:        0x1002f1324 - std::backtrace_rs::backtrace::libunwind::trace::hbebc8679d47bdc2c
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:        0x1002f1324 - std::backtrace_rs::backtrace::trace_unsynchronized::h3a2e9637943241aa
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x1002f1324 - std::sys::backtrace::_print_fmt::he430849680584674
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/backtrace.rs:65:5
   3:        0x1002f1324 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h243268f17d714c7f
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/backtrace.rs:40:26
   4:        0x1003055d8 - core::fmt::rt::Argument::fmt::h0d339881c25f3c31
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/fmt/rt.rs:173:76
   5:        0x1003055d8 - core::fmt::write::hb3cfb8a30e72d7ff
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/fmt/mod.rs:1182:21
   6:        0x1002ef460 - std::io::Write::write_fmt::hfb2314975de9ecf1
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/io/mod.rs:1827:15
   7:        0x1002f2400 - std::sys::backtrace::BacktraceLock::print::he14461129ccbfef5
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/backtrace.rs:43:9
   8:        0x1002f2400 - std::panicking::default_hook::{{closure}}::h14c7718ccf39d316
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:269:22
   9:        0x1002f2024 - std::panicking::default_hook::hc62e60da3be2f352
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:296:9
  10:        0x1002f2ec4 - std::panicking::rust_panic_with_hook::h09e8a656f11e82b2
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:800:13
  11:        0x1002f27ec - std::panicking::begin_panic_handler::{{closure}}::h1230eb3cc91b241c
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:667:13
  12:        0x1002f17b0 - std::sys::backtrace::__rust_end_short_backtrace::hc3491307aceda2c2
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/backtrace.rs:168:18
  13:        0x1002f24dc - rust_begin_unwind
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665:5
  14:        0x10030c788 - core::panicking::panic_nounwind_fmt::runtime::h5290ab2b4897aadc
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:112:18
  15:        0x10030c788 - core::panicking::panic_nounwind_fmt::h91ee161184879b56
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:122:5
  16:        0x10030c800 - core::panicking::panic_nounwind::heab7ebe7a6cd845c
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:221:5
  17:        0x10030c978 - core::panicking::panic_cannot_unwind::hedc43d82620205bf
                               at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:309:5
  18:        0x1002ac224 - <screencapturekit_sys::stream_output_handler::UnsafeSCStreamOutputHandler as objc_foundation::object::INSObject>::class::{{closure}}::stream_output::hc39cef1a3c38b420
                               at /Users/kaiwen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/screencapturekit-sys-0.2.5/src/stream_output_handler.rs:38:13
  19:        0x22287f034 - <unknown>
  20:        0x1a76bc0c4 - <unknown>
  21:        0x1a7606c70 - <unknown>
  22:        0x187bd4658 - <unknown>
  23:        0x187bd7b08 - <unknown>
  24:        0x187bebad8 - <unknown>
  25:        0x187bea6a0 - <unknown>
  26:        0x187bd7984 - <unknown>
  27:        0x187bd7138 - <unknown>
  28:        0x187be7528 - <unknown>
  29:        0x187be6d5c - <unknown>
  30:        0x187d83410 - _pthread_mutexattr_init
thread caused non-unwinding panic. aborting.
fish: Job 1, 'cargo run --example capture' terminated by signal SIGABRT (Abort)
kaiwen-wang commented 1 day ago

I'm on the latest (MacOS 15) if that matters

kaiwen-wang commented 1 day ago

Also, when I try just doing the example in the README, I get these issues

error[E0432]: unresolved imports `ruhear::Ruhear`, `ruhear::RUCallback`
 --> src/main.rs:1:14
  |
1 | use ruhear::{Ruhear, RUBuffers, RUCallback};
  |              ^^^^^^             ^^^^^^^^^^ no `RUCallback` in the root
  |              |
  |              no `Ruhear` in the root
  |
help: a similar name exists in the module
  |
1 | use ruhear::{RUHear, RUBuffers, RUCallback};
  |              ~~~~~~
help: a similar name exists in the module
  |
1 | use ruhear::{Ruhear, RUBuffers, rucallback};
  |                                 ~~~~~~~~~~
aizcutei commented 6 hours ago

Seems Apple changes some capture API in MacOS 15 Sequoia. Some update need to be done.