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

Error with cpal and winapi 0.2.6 #269

Closed
Bobo1239 opened this issue Mar 16, 2016 · 4 comments
Closed

Error with cpal and winapi 0.2.6 #269

Bobo1239 opened this issue Mar 16, 2016 · 4 comments

Comments

@Bobo1239
Copy link

There seems to have been some kind of regression. Running the enumerate example works flawlessly with 0.2.5 but after updating to 0.2.6, an error happens:

Bobo1239@WORKSTATION-W10 MINGW64 /e/development/Rust/asd
$ cargo run
     Running `target\debug\asd.exe`
Endpoints:
1. Endpoint "{0.0.0.00000000}.{be9148a0-3456-47b9-a0a0-2bf1df9b3448}" Audio formats:
1.1. Format { channels: [FrontLeft, FrontRight], samples_rate: SamplesRate(44100), data_type: F32 }
2. Endpoint "{0.0.0.00000000}.{bfbba739-0c5c-4130-9bb1-54386d837a50}" Audio formats:
2.1. Format { channels: [FrontLeft, FrontRight], samples_rate: SamplesRate(44100), data_type: F32 }
3. Endpoint "{0.0.0.00000000}.{e9227c7f-b25f-43c8-ac7a-39c9391b424e}" Audio formats:
3.1. Format { channels: [FrontLeft, FrontRight], samples_rate: SamplesRate(48000), data_type: F32 }

Bobo1239@WORKSTATION-W10 MINGW64 /e/development/Rust/asd
$ cargo update
    Updating registry `https://github.com/rust-lang/crates.io-index`
    Updating winapi v0.2.5 -> v0.2.6

Bobo1239@WORKSTATION-W10 MINGW64 /e/development/Rust/asd
$ cargo run
   Compiling ole32-sys v0.1.0
   Compiling cpal v0.2.9
C:\msys64\home\Bobo1239\.cargo\registry\src\github.com-88ac128001ac3a9a\cpal-0.2.9\src\wasapi/mod.rs:39:9: 39:27 warning: lint raw_pointer_derive has been removed: using derive with raw pointers is ok
C:\msys64\home\Bobo1239\.cargo\registry\src\github.com-88ac128001ac3a9a\cpal-0.2.9\src\wasapi/mod.rs:39 #[allow(raw_pointer_derive)]
                                                                                                                ^~~~~~~~~~~~~~~~~~
C:\msys64\home\Bobo1239\.cargo\registry\src\github.com-88ac128001ac3a9a\cpal-0.2.9\src\wasapi/mod.rs:39:9: 39:27 warning: lint raw_pointer_derive has been removed: using derive with raw pointers is ok
C:\msys64\home\Bobo1239\.cargo\registry\src\github.com-88ac128001ac3a9a\cpal-0.2.9\src\wasapi/mod.rs:39 #[allow(raw_pointer_derive)]
                                                                                                                ^~~~~~~~~~~~~~~~~~
C:\msys64\home\Bobo1239\.cargo\registry\src\github.com-88ac128001ac3a9a\cpal-0.2.9\src\wasapi/mod.rs:38:16: 38:21 note: in this expansion of #[derive_Clone] (defined in C:\msys64\home\Bobo1239\.cargo\registry\src\github.com-88ac128001ac3a9a\cpal-0.2.9\src\wasapi/mod.rs)
C:\msys64\home\Bobo1239\.cargo\registry\src\github.com-88ac128001ac3a9a\cpal-0.2.9\src\wasapi/mod.rs:39:9: 39:27 warning: lint raw_pointer_derive has been removed: using derive with raw pointers is ok
C:\msys64\home\Bobo1239\.cargo\registry\src\github.com-88ac128001ac3a9a\cpal-0.2.9\src\wasapi/mod.rs:39 #[allow(raw_pointer_derive)]
                                                                                                                ^~~~~~~~~~~~~~~~~~
C:\msys64\home\Bobo1239\.cargo\registry\src\github.com-88ac128001ac3a9a\cpal-0.2.9\src\wasapi/mod.rs:38:10: 38:14 note: in this expansion of #[derive_Copy] (defined in C:\msys64\home\Bobo1239\.cargo\registry\src\github.com-88ac128001ac3a9a\cpal-0.2.9\src\wasapi/mod.rs)
   Compiling asd v0.1.0 (file:///E:/development/Rust/asd)
src\main.rs:3:5: 3:13 warning: unused import, #[warn(unused_imports)] on by default
src\main.rs:3 use cpal::*;
                  ^~~~~~~~
     Running `target\debug\asd.exe`
Endpoints:
1. Endpoint "{0.0.0.00000000}.{be9148a0-3456-47b9-a0a0-2bf1df9b3448}" Audio formats:
thread '<main>' panicked at 'Unknown SubFormat GUID returned by GetMixFormat: GUID { Data1: 1048576, Data2: 128, Data3: 43520, Data4: [0, 56, 155, 113, 10, 49, 105, 57] }', C:\msys64\home\Bobo1239\.cargo\registry\src\github.com-88ac128001ac3a9a\cpal-0.2.9\src\wasapi/mod.rs:191
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: "PoisonError { inner: .. }"', ../src/libcore\result.rs:688
stack backtrace:
   0:           0x7561aa - sys::backtrace::write::he59f738983b73261zlu
   1:           0x75e687 - panicking::default_handler::h5387b6771edf5f5a0Xy
   2:           0x71f988 - sys_common::unwind::begin_unwind_inner::hce5c1d8577eb6671U8s
   3:           0x72025b - sys_common::unwind::begin_unwind_fmt::h563db00c15edff8207s
   4:           0x7528a2 - rust_begin_unwind
   5:           0x771098 - panicking::panic_fmt::h3dc40a8b303af4f9zYL
   6:           0x402b38 - result::Result<T, E>::unwrap::h5258964690686995623
                        at ../src/libcore/macros.rs:29
   7:           0x40273f - cpal_impl::Endpoint.Drop::drop::hb1bd58f9c598cd4fj4a
                        at C:\msys64\home\Bobo1239\.cargo\registry\src\github.com-88ac128001ac3a9a\cpal-0.2.9\src\wasapi/mod.rs:240
   8:           0x40269e - cpal..cpal_impl..Endpoint::drop.14272::hbb1a2b62c3a7db62
   9:           0x402658 - cpal..Endpoint::drop.14269::h373182430cffd7f6
  10:           0x401914 - main::h5153aed50d95138bgaa
                        at src/main.rs:9
  11:           0x75dd88 - sys_common::unwind::try::try_fn::h15965401945723051019
  12:           0x7491df - sys_common::unwind::try::inner_try::hb2e82d814f76fd0ds5s
  13:           0x75dc89 - rt::lang_start::h39f4c98014ab81eaeQy
  14:           0x4055aa - main
  15:           0x4013b4 - _tmainCRTStartup
  16:           0x4014e7 - mainCRTStartup
  17:     0x7fff67f68101 - je_arena_alloc_junk_small.part.25
thread panicked while panicking. aborting.
       error Process didn't exit successfully: `target\debug\asd.exe` (exit code: 3221225501)
Illegal instruction
@retep998
Copy link
Owner

Blah, I suspect this is one of the types getting the wrong packing/alignment.

Oh how I wish we'd get rust-lang/rfcs#1399 already

retep998 added a commit that referenced this issue Apr 29, 2016
Signed-off-by: Peter Atashian <retep998@gmail.com>
@retep998
Copy link
Owner

@Bobo1239 Can you confirm whether the fix in the dev branch fixes this? You can use a cargo override to test it.

@Bobo1239
Copy link
Author

Works! Thank you!

@mvdnes
Copy link

mvdnes commented Apr 29, 2016

Works for my project as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants