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

macOS asks for permission to use the microphone #13989

Open
tsukinoko-kun opened this issue Jun 23, 2024 · 10 comments
Open

macOS asks for permission to use the microphone #13989

tsukinoko-kun opened this issue Jun 23, 2024 · 10 comments
Labels
A-Audio Sounds playback and modification C-Bug An unexpected or incorrect behavior O-MacOS Specific to the MacOS (Apple) desktop operating system S-Blocked This cannot move forward until something else changes

Comments

@tsukinoko-kun
Copy link

Bevy version

0.13.2

[Optional] Relevant system information

macOS Sonoma 14.5

MacBook Pro 13" M2

What you did

When I run the game on macOS from the terinal, RustRover and the compiled binary.

What went wrong

It works but macOS asks for microphone permission.

Additional information

Screenshot 2024-06-23 at 15 53 04
@tsukinoko-kun tsukinoko-kun added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jun 23, 2024
@mockersf
Copy link
Member

mockersf commented Jun 23, 2024

Does this happen with Bevy examples?

@mockersf mockersf added A-Audio Sounds playback and modification O-MacOS Specific to the MacOS (Apple) desktop operating system labels Jun 23, 2024
@mockersf mockersf removed the S-Needs-Triage This issue needs to be labelled label Jun 23, 2024
@tsukinoko-kun
Copy link
Author

Screenshot 2024-06-24 at 01 27 02

I tried volumetric_fog and it happened there too.

@mockersf
Copy link
Member

can't reproduce on my Mac

@mockersf mockersf added the S-Needs-Investigation This issue requires detective work to figure out what's going wrong label Jun 24, 2024
@janhohenheim
Copy link
Member

I can remember running into this while running Foxtrot on my macOS, which surprised me. I'll check if I can reproduce this with the given example.

@janhohenheim
Copy link
Member

janhohenheim commented Jun 25, 2024

I can confirm I can reproduce the bug. I thought I couldn't at first, but then realized that I already had disallowed my terminal to use the microphone, so no new popup came up. Steps to reproduce:

  • compile volumetric_fog on main
  • download a fresh iTerm2, because a new app doesn't have any previous security and access settings on my machine
  • run the previously compiled example on iterm (ignore the path not found errors, that's because I switched branches):
image

results in:

image

My machine:
image

From experience, I know that at least Foxtrot asks for the same permission when setting it up as a regular graphical app without running it in the terminal.

@janhohenheim
Copy link
Member

janhohenheim commented Jun 25, 2024

Update: I found a relevant thread on Discord from a year ago. Something about permissions being weird when info.plist is missing.

@bash
Copy link
Contributor

bash commented Jun 25, 2024

I used tccutil to reset the microphone permission for the terminal app. That way the permission prompt shows up again when I run a bevy app (cargo run --example volumetric_fog on main).

By resetting the permissions before running a bevy app I can get the prompt to consistently show up.

For macOS' Terminal the command is tccutil reset Microphone com.apple.Terminal. Alternatively for WezTerm: tccutil reset Microphone com.github.wez.wezterm

@bash
Copy link
Contributor

bash commented Jul 19, 2024

I managed to narrow this down to the function default_output_device in cpal which gets called via AudioPluginAudioOutput::defaultOutputStream::try_default.

cpal::default_host().default_output_device();

@janhohenheim janhohenheim added the S-Blocked This cannot move forward until something else changes label Jul 19, 2024
@janhohenheim
Copy link
Member

Marking as blocked since this seems like a cpal issue then. Unless we can pass some magic parameters.

@benfrankel
Copy link
Contributor

benfrankel commented Aug 8, 2024

Is there an upstream issue for this?

EDIT: Yes there is: RustAudio/cpal#901

@janhohenheim janhohenheim removed the S-Needs-Investigation This issue requires detective work to figure out what's going wrong label Aug 8, 2024
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-Bug An unexpected or incorrect behavior O-MacOS Specific to the MacOS (Apple) desktop operating system S-Blocked This cannot move forward until something else changes
Projects
Status: No status
Development

No branches or pull requests

5 participants