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

Migrate to rodio 0.12 #638

Closed
wants to merge 1 commit into from
Closed

Migrate to rodio 0.12 #638

wants to merge 1 commit into from

Conversation

dvtkrlbs
Copy link

@dvtkrlbs dvtkrlbs commented Oct 7, 2020

This is actually same as #310 but i deleted the fork sometime ago so i can't add new commits. Fixes #307. We need to find a way to handle the OutputStream (it is not Send + Sync) now i just mem::forget it but we need a better way.

@karroffel karroffel added A-Audio Sounds playback and modification P-Crash A sudden unexpected crash O-MacOS Specific to the MacOS (Apple) desktop operating system C-Dependencies A change to the crates that Bevy depends on labels Oct 7, 2020
@DJMcNab
Copy link
Member

DJMcNab commented Oct 7, 2020

The way I've seen to handle !Send stuff is to spawn a thread, and then store a Condvar in the other thread waiting to drop it. It might be worth asking Rodio's maintainer what the recommended approach for this is, because it seems like OutputStream already has its own thread created?

@chemicstry
Copy link

chemicstry commented Oct 7, 2020

The best way to handle !Send stream would be to wait for #456 to land. But I agree that we should firstly ask Rodio's maintainer stance on this

@Dash-L
Copy link
Contributor

Dash-L commented Oct 11, 2020

It seems rodio 0.12 also fixes the issue where playing an mp3 file would sometimes panic in debug mode. As for the OutputStream not being Send + Sync, when I was implementing this myself (because I was dumb and didn't look to see if anyone else had done it yet) I just unsafe impl'ed Send and Sync on AudioOutput, so std::mem::forget is at least better than that...

@cart
Copy link
Member

cart commented Oct 12, 2020

I think we have reason enough to wait for thread local here: #310 (comment)

I'll try to bang that out today

@cart
Copy link
Member

cart commented Oct 12, 2020

Just put out a pr for thread local resources #671

@cart
Copy link
Member

cart commented Oct 12, 2020

Just merged thread local resources. Lets try to use that here instead of mem::forget (see the bevy_gilrs code for examples)

@cart
Copy link
Member

cart commented Oct 20, 2020

Closed by #692

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-Dependencies A change to the crates that Bevy depends on O-MacOS Specific to the MacOS (Apple) desktop operating system P-Crash A sudden unexpected crash
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Audio example crashes when an external audio device is selected on macOS
6 participants