Comments (3)
@tomaka I'd like to try and help with this issue, however I'm still pretty new to rust (especially rust concurrency). Currently reading through rodio
, cpal
, and coreaudio-rs
libs. Any idea where I should try to focus my efforts?
from rodio.
I'm not sure myself (haven't really looked yet).
Basically cpal forbids sharing something between threads (not sure exactly which object is concerned, and whether it is legitimate or not), while rodio tries to share it and fails.
from rodio.
I hit the same error I guess (examples not building on macOS), but got a more verbose stack trace.
Posting it here in hope it is useful. If not, sorry for the noise.
rustc 1.24.0-nightly (1956d5535 2017-12-03)
, macOS 10.13.1
cargo run --example music_ogg
...
error[E0277]: the trait bound `for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static: std::marker::Send` is not satisfied
--> src/engine.rs:35:18
|
35 | .spawn({
| ^^^^^ `for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static`
= note: required because of the requirements on the impl of `std::marker::Send` for `&'static mut for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static`
= note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<&'static mut for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static>`
= note: required because it appears within the type `alloc::raw_vec::RawVec<&'static mut for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static>`
= note: required because it appears within the type `std::vec::Vec<&'static mut for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static>`
= note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Mutex<std::vec::Vec<&'static mut for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static>>`
= note: required because it appears within the type `cpal::cpal_impl::ActiveCallbacks`
= note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<cpal::cpal_impl::ActiveCallbacks>`
= note: required because it appears within the type `cpal::cpal_impl::EventLoop`
= note: required because it appears within the type `cpal::EventLoop`
= note: required because it appears within the type `engine::Engine`
= note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<engine::Engine>`
= note: required because it appears within the type `[closure@src/engine.rs:37:21: 41:22 engine:std::sync::Arc<engine::Engine>]`
error[E0277]: the trait bound `for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static: std::marker::Send` is not satisfied
--> src/engine.rs:23:5
|
23 | / lazy_static! {
24 | | static ref ENGINE: Arc<Engine> = {
25 | | let engine = Arc::new(Engine {
26 | | events_loop: EventLoop::new(),
... |
47 | | };
48 | | }
| |_____^ `for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static`
= note: required because of the requirements on the impl of `std::marker::Send` for `&'static mut for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static`
= note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<&'static mut for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static>`
= note: required because it appears within the type `alloc::raw_vec::RawVec<&'static mut for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static>`
= note: required because it appears within the type `std::vec::Vec<&'static mut for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static>`
= note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Mutex<std::vec::Vec<&'static mut for<'r> std::ops::FnMut(cpal::cpal_impl::VoiceId, cpal::UnknownTypeBuffer<'r>) + 'static>>`
= note: required because it appears within the type `cpal::cpal_impl::ActiveCallbacks`
= note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<cpal::cpal_impl::ActiveCallbacks>`
= note: required because it appears within the type `cpal::cpal_impl::EventLoop`
= note: required because it appears within the type `cpal::EventLoop`
= note: required because it appears within the type `engine::Engine`
= note: required because of the requirements on the impl of `std::marker::Sync` for `std::sync::Arc<engine::Engine>`
= note: required by `<engine::play_raw::ENGINE as std::ops::Deref>::deref::require_sync`
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
from rodio.
Related Issues (20)
- Add a sink.set_speed function that keeps original perceived pitch HOT 2
- Play sound on system output device, even if the system output device changes HOT 1
- Sink stops playing sound when audio output device is disconnected and reconnected. HOT 1
- `nightly` CI tests are failing HOT 1
- Sound cannot be played if OutputStream is unused HOT 2
- Channel converter does not scale to more then 2 channels HOT 5
- Rename Sink::empty HOT 4
- Add comment describing how speed.rs achieves its speedup
- Not all tests are running in CI HOT 2
- CI uses `actions/checkout@v2`, which uses `deprecated` version of `Node.js` HOT 2
- CI has `54 warnings` under `Annotations` HOT 2
- Bug: Tests and Examples error HOT 2
- Release CI and PR CI behave different
- With symphonia m4a seek is inaccurate
- Don't drop source when finished HOT 10
- Cannot use symphonia ReadOnlySource due to no seek support HOT 5
- Specific mp4a codec panics rodio HOT 5
- Should `Decoder` be cached? HOT 4
- Crackly audio on some mp3 files (suspected bug in resampler) HOT 8
- Seek support for flac HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rodio.