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

Mixxx snapshots do not ask for microphone access on macOS (regression) #11365

Closed
fwcd opened this issue Mar 13, 2023 · 11 comments · Fixed by #11367
Closed

Mixxx snapshots do not ask for microphone access on macOS (regression) #11365

fwcd opened this issue Mar 13, 2023 · 11 comments · Fixed by #11367

Comments

@fwcd
Copy link
Member

fwcd commented Mar 13, 2023

Bug Description

The most recent main snapshot of Mixxx does not ask for microphone access on macOS, making it impossible to use it in Mixxx (or associated features such as vinyl control). The stable 2.3 does correctly ask for this permission, so I assume this is a regression:

image

The issue occurs both on the official Intel builds and unofficial arm64 builds, the credits for discovering this issue go to @npes-95:

Interestingly, once a user has accepted the microphone access (e.g. by opening Mixxx 2.3), the microphone will work correctly in recent snapshots of Mixxx too.

Note: In case anyone who already has accepted the permission wants to try this out, the command tccutil reset Microphone org.mixxx.Mixxx will reset the permission

Version

2.4-alpha-1420-gceaedb8443 (the most recent main)

OS

macOS 13.2.1

@fwcd fwcd added the bug label Mar 13, 2023
@fwcd fwcd changed the title Mixxx does not ask for microphone access on macOS (regression) Mixxx snapshots do not ask for microphone access on macOS (regression) Mar 13, 2023
@fwcd
Copy link
Member Author

fwcd commented Mar 13, 2023

This seems to be some form of sandboxing issue, building the most recent main as a non-packaged executable and running it from the command-line also asks for the permissions correctly.

One solution would be to ask for permission explicitly using Objective-C++ through the AVFoundation framework (see here), but perhaps there's a less involved way to achieve this.

@daschuer
Copy link
Member

@fwcd
Copy link
Member Author

fwcd commented Mar 13, 2023

I believe the issue with the Audacity guide is that Mixxx doesn't even show up in the settings if the permission was never requested.

I don't think it is an issue with the actual IO either, since the microphone works fine on recent snapshots if the user manages to add this microphone permission for org.mixxx.Mixxx to the OS's privacy database in some other way e.g. by launching the older 2.3 first.

@fwcd
Copy link
Member Author

fwcd commented Mar 14, 2023

Good catch, adding a NSMicrophoneUsageDescription did fix it. I vaguely recall that Apple added this policy of requiring such a description for iOS apps a while back too. I'll open a PR for this.

@daschuer
Copy link
Member

OK, the first part id fixed. How does Mixxx behave if the user reject the microphone access? Is There something we may implement?
Can we file another issue for it and close this?

@fwcd
Copy link
Member Author

fwcd commented Mar 14, 2023

Everything works fine, as if the microphone would only record silence. This is the current behavior if the user isn't prompted at all.

@daschuer
Copy link
Member

Can we detect the situation and warn the user as a feature utilizing AVFoundation?

@fwcd
Copy link
Member Author

fwcd commented Mar 14, 2023

Yes, we could probably detect if they rejected the permission with AVFoundation and if they try to use the microphone anyway, point them to the system settings (perhaps even deep-link to it) where they can change the permission. I'd move that to a separate issue though since it doesn't relate to any regression, the 2.3, main and earlier versions all behaved this way already.

@fwcd
Copy link
Member Author

fwcd commented Mar 14, 2023

Note that to integrate Objective-C++ we need a slightly modified clang-format config. #11353 and #4809 both bundle this patch, if we intend to use Objective-C++ in more placed, I could look into splitting that out into a separate PR though to avoid duplication and potential merge conflicts.

@daschuer
Copy link
Member

I have just filed #11370 for the remaining work so we can close this.

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

Successfully merging a pull request may close this issue.

2 participants