-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Audio example crashes when an external audio device is selected on macOS #307
Comments
Following the rabbit hole it seems it might be an issue with the rodio library apperantly it panics at an expect block since it cannot get the name of the device. Looking at the repo they made some rework with the crate and also removing the engine system completely. I will try to use the git version of rodio and see if it fixes the issue. |
@dvtkrlbs are you comfortable with me assigning this issue to you? |
Yeah that is okay |
@dvtkrlbs thanks! |
Tried it with the rodio git version as well it looks like rodio can't get a default device when an output device is selected within the macOS menu. Should i open an issue on rodio or should i go deeper to see if it is an issue with cpal ? |
@dvtkrlbs do you have an opinion on the best course of action here? |
I have no idea. I can't say anything before seeing any reproduce of the same bug. Since it may be a problem with my own system. But it looks like cpal (the library that rodio uses to interact with audio devices) seems to to cannot get a default device. So it is beyond our reach to fix. Edit: Wrote on the bevy discord to see if anyone tries it and also try to reproduce the issue with rodio alone. If i am succesful i will open an issue on rodio github page to ask for further help. |
I tried it with rodio alone with master branch and it worked. I think there is an issue with the sink but i am still investigating. Sink works too with master branch it still does not switch audio device automatically but no panic. So we can either wait for the next rodio release or we can use the master branch. |
It seems it works with the rodio master branch. But the problem is rodio got rid of the device concept fully and now they give you an OutputStream and an OutputStremHandle and OutputStream is not Send + Sync. In my proof of concept i just do std::mem::forget on the OutputStream but we need to store and normally destroy OutputStream somewhere (if dropped the handle does not work) |
The new version of rodio has been published to crates.io |
I havent been able to test it. |
I was able to
|
Like the title says app cant start when a different audio output device is selected (in my case when connected to an bluetooth headset) and also audio does not switch audio device when switch when the example is running. I would like to take a look at it and possibly fix it if someone can help me find my way. 😄
macOS version: macOS Catalina 10.15.3
Rust version: v1.47.0-nightly
Bevy commit hash: 022a31f
Here is the full backtrace:
Backtrace
The text was updated successfully, but these errors were encountered: