Problems recording audio on Tahoe 26.0 (Intel only)

I have some tried-and-tested code that records and plays back audio via AUHAL which breaks on Tahoe on Intel. The same code works fine on Sequioa and also works on Tahoe on Apple Silicon.

To start with something simple, the following code to request access to the Microphone doesn't work as it should:

bool RequestMicrophoneAccess ()
{
    __block AVAuthorizationStatus status =
        [AVCaptureDevice authorizationStatusForMediaType: AVMediaTypeAudio];

    if (status == AVAuthorizationStatusAuthorized)
        return true;

    __block bool done = false;
    [AVCaptureDevice requestAccessForMediaType: AVMediaTypeAudio completionHandler: ^ (BOOL granted)
    {
        status = (granted) ? AVAuthorizationStatusAuthorized : AVAuthorizationStatusDenied;
        done = true;
    }];
    
    while (!done)
        CFRunLoopRunInMode (kCFRunLoopDefaultMode, 2.0, true);

    return status == AVAuthorizationStatusAuthorized;
}

On Tahoe on Intel, the code runs to completion but granted is always returned as NO. Tellingly, the popup to ask the user to grant microphone access is never displayed, even though the app is not present in the Privacy pane and never appears there. On Apple Silicon, everything works fine.

There are some other problems, but I'm hoping they have a common underlying cause and that the Apple guys can figure out what's wrong from the information in this post. I'd be happy to test any potential fix. Thanks.

Answered by Paul Sanders in 861710022

Sorry, red herring - it was a problem with my development machine. On another (also Intel) Mac it works as intended. Apologies for the noise.

Also, please let me know if you need more info. The app is sandboxed and has all the relevant entitlements, and if I bypass the above code and just try to open the capture device, the 'xxx wants to access your microphone' message is not displayed.

There is a way to get it to work though. If I run the app from Terminal (by directly running the binary in Contents/MacOS, rather than using open), then everything works as it should, with the exception that the popup reads 'Terminal wants to access your Microphone', rather than the name of my app.

Terminal has some funky entitlements, and this is what leads me to believe this is a 'Privacy' issue.

Accepted Answer

Sorry, red herring - it was a problem with my development machine. On another (also Intel) Mac it works as intended. Apologies for the noise.

Problems recording audio on Tahoe 26.0 (Intel only)
 
 
Q