<Sound Dev> [15] RFR: JDK-8246094: [macos] Sound Recording and playback is not working

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Tue Jul 21 20:33:50 UTC 2020


+1

On 21.07.2020 12:24, Erik Joelsson wrote:
> Here is a late fix for Macos Catalina. In JDK-8244951, I added a missing entitlement to enable sound recording with the hardened runtime signing. It was later discovered that this wasn't quite enough. To be able to record sound you also need to specify a certain key in your Info.plist, NSMicrophoneUsageDescription. The value of this field is displayed to the user the first time the JDK wants to record sound. We also discovered that the way the JDK is laid out in the Macos specific bundle format, the global Info.plist is not actually considered when looking for this particular key, but rather the plist info we embed in the java executable.
> 
> This patch adds the new key to all the affected plists (JDK global, JRE global and the one being embedded in executables). We also noted that the bundle ID and version numbers had an effect on how this key was resolved, and to get somewhat better behavior, I'm also unifying the embedded values for those keys (which were hard coded today) with what we already put in the global Info.plist for the JDK. A followup bug where we more fully explore what the CFBundleIdentifier, CFBundleVersion and CFBundleShortVersionString values should actually be is planned for a later release.
> 
> With this fix, it's now verified possible to record sound on a Macos Catalina machine.
> 
> Webrev: http://cr.openjdk.java.net/~erikj/8246094/webrev.01/index.html
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8246094
> 
> /Erik
> 


-- 
Best regards, Sergey.


More information about the sound-dev mailing list