AudioUnit

RSS for tag

Create audio unit extensions and add sophisticated audio manipulation and processing capabilities to your app using AudioUnit.

Posts under AudioUnit tag

27 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

How to pass a `os_workgroup_t` to a child process?
Hi, This topic is about Workgroups. I create child processes and I'd like to communicate a os_workgroup_t to my child process so they can join the work group as well. As far as I understand, the os_workgroup_t value is local to the process. I've found that one can use os_workgroup_copy_port() and os_workgroup_create_with_port(), but I'm not familiar at all with ports and I wonder what would be the minimal effort to achieve that. Thank you very much! Alex
1
0
1.2k
Nov ’23
Saving plugin presets using fullState in Audio Units
Hi, I'm having trouble saving user presets in the plugin for Audio Units. This works well for saving the user presets in the Host, but I get an error when trying to save them in the plugin. I'm not using a parameter tree, but instead using the fullState's getter and setter for saving and retrieving a dictionary with the state. With some simplified parameters it looks something like this: var gain: Double = 0.0 var frequency: Double = 440.0     private var currentState: [String: Any] = [:] override var fullState: [String: Any]? {     get {       // Save the current state       currentState["gain"] = gain       currentState["frequency"] = frequency       // Return the preset state       return ["myPresetKey": currentState]     }     set {       // Extract the preset state       currentState = newValue?["myPresetKey"] as? [String: Any] ?? [:]       // Set the Audio Unit's properties       gain = currentState["gain"] as? Double ?? 0.0       frequency = currentState["frequency"] as? Double ?? 440.0     }  } This works perfectly well for storing user presets when saved in the host. When trying to save them in the plugin to be able to reuse them across hosts, I get the following error in the interface: "Missing key in preset state map". Note that I am testing mostly in AUM. I could not find any documentation for what the missing key is about and how can I get around this. Any ideas?
2
1
1k
Mar ’24
v3 AudioUnit, itself an audio unit host cannot see v3 audio units when hosted "out of process"
Back at the start of January this year we filed a bug report that still hasn't been acknowledged. Before we file a code level support ticket, we would love to know if there’s any one else out there who has experienced anything similar. We have read documentation (and again repeatedly) and searched the web over and still found no solution and this issue does look like it could be a bug in the system (or our coding) rather than proper behaviour. The app is a host for a v3 audio unit which itself is a workstation that can host other audio units. The host and audio unit are both working well in all other areas other than this issue. Note: This is not running on catalyst, it is a native Mac OS app. ( not iOS ) The problem is that when an AUv3 is hosted out of process (on the Mac) and then goes to fetch a list of all the other available installed audio units, the list that is returned from the system does not contain any of the other v3 audio units in the system. It only contains v2. We see this issue if we load our AU out of process in our own bespoke host, and also when it loads into Logic Pro which gives no choice but to load out of process. This means that, as it stands at the moment, when we release the app our users will have limited functionality in Logic Pro, and possibly by then, other hosts too. In our own host we can load our hosting AU in-process and then it can find and use all the available units both v2 and v3. So no issue there but sadly when loaded into the only other host that can do anything like this ( Logic Pro at the time of posting) it won't be able to use v3 units which is quite a serious limitation. SUMMARY v3 Audio Unit being hosted out of process. Audio unit fetches the list of available audio units on the system. v3 audio units are not provided in the list. Only v2 are presented. EXPECTED In some ways this seems to be the opposite of the the behaviour we would expect. We would expect to see and host ALL the other units that are installed on the system. “out of process” suggests the safer of the two options and so this looks like it could be related to some kind of sand boxing issue. But sadly we cannot work out a solution hence this report. Is Quin “The Eskimo” still around? Can you help us out here?
3
0
1.2k
Oct ’23
MacOS echo cancellation (AUVoiceProcessing) trouble with device gain/volume
Hi community I'm developing an application for MacOS and i need to capture the mic audio stream. Currently using CoreAudio in Swift i'm able to capture the audio stream using IO Procs and have applied the AUVoiceProcessing for prevent echo from speaker device. I was able to connect the audio unit and perform the echo cancellation. The problem that i'm getting is that when i'm using AUVoiceProcessing the gain of the two devices get reduced and that affects the volume of the two devices (microphone and speaker). I have tried to disable the AGC using the property kAUVoiceIOProperty_VoiceProcessingEnableAGCbut the results are the same. There is any option to disable the gain reduction or there is a better approach to get the echo cancellation working?
3
0
1.5k
Oct ’23
Error when loading (some) Audio Units on macOS 12
I'm developing a sandboxed application with Xcode which allows the user to open and work with Audio Unit plugins. Working with a beta-tester having a lot of AUs on its laptop running on macOS 12.5.1, we encountered some weird crashes while opening some plugins (Krotos, Flux Audio, Sound Toys, etc.). The message we got was in French, I try to translate it but the original English version could be a little bit different: Impossible to open “NSCreateObjectFileImageFromMemory-p47UEwps” because the developper can not be verified. After this first warning, a Fatal Error 100001 message opens and the plugin seems crashed (but not the host). I easily found some music application users encountering similar issues on the web. From what I read, this error is related to new security rules introduced in macOS 12. And, effectively, some of these plugins tested on an older system work normally. I also read that some (insecure) entitlements of the Hardened Runtime should be able to fix this issue, especially Allow Unsigned Executable Memory Entitlement, whose the doc says: In rare cases, an app might need to override or patch C code, use the long-deprecated NSCreateObjectFileImageFromMemory (which is fundamentally insecure), or use the DVDPlayback framework. Add the Allow Unsigned Executable Memory Entitlement to enable these use cases. Otherwise, the app might crash or behave in unexpected ways. Unfortunately, checking this option didn't fix the issue. So, what I tried next was to add Disable Executable Memory Protection (no more success), and finally Allow DYLD Environment Variables and Allow Execution of JIT-compiled Code: none of them solved my problem. I really don't see what else to do, while I'm sure that a solution exists because the same plugins work perfectly on other application (Logic, Live Ableton). Any help would be greatly appreciated. Thanks !
13
0
2.3k
Sep ’23
Problems with Roland Cloud Manager
I'm the developer of a small utility for Mac called "MusicDeviceHost". https://apps.apple.com/us/app/musicdevicehost/id1261046263?mt=12 As the name suggests, it is a host application for audio units (music device components). See also "Using Sound Canvas VA with QMidi": https://youtu.be/F9C4BiBR A problem occurs while trying to authorize the "Sound Canvas VA" component, Roland Cloud Manager (v3.0.3) returns the following error: “Authorization Error - RM Service not connected Error Connecting to Roland Cloud Manager Service” I guess the error is caused by some permission denied to the sandboxed application version. The NOT sandboxed version of MDH actually works flawlessly. I am using the following entitlements: com.apple.security.app-sandbox com.apple.security.network.client So connecting to the service should work, because "com.apple.security.network.client" is enabled. At Roland, they say: "Cloud Manager isn't supported in a sandboxed environment." But as far as I can see, MainStage and other sandboxed apps works fine... So what is the right answer? Is there someone out there with the same issue? Thanks for helping :)
5
0
1.7k
Oct ’23
Logic Pro AU regression with AUHostingServices: can't open modal before opening plugin view
Some users reported issues when using our audio units with recent version of Logic Pro. After investigation, it seems like there is an issue where the modal won't appear if the view is not open on Logic with AUHostingServices. After trying with a JUCE example plugin on latest version, it also fails to run a modal while the view is not open. The system call results in a NSModalResponseAbort return code. I'm nearly sure that's a recent regression of the AUHostingServices, but may be it's always been there. Could you help us finding a solution or at least a workaround ? Thanks in advance, Best regards
0
0
645
Sep ’23
auval gives me bad hedaches with 3rd party framework
Hi guys, I’m building an audio unit and I need to add a 3rd party framework. Validating the AU with Logics plugin manager fails saying it could not find the framework. It says it is neither in /System/Library/Frameworks nor under @rpath. Then it was complaining that @ path expansion violates security policy. Logic will still load the plugin fine, if I force it to use it, though, which seems weird. Then I exchanged the @rpath reference in the AudioUnit with install_name_tool. That worked but told me that it had to break code signing. When I re-ran auval, the “not found” errors went away, but it still could not be loaded, supposedly because of the broken signing. Btw, I could only get detailled information about auvals complaints if I ran Logic and thus the scanning process inside the debuugger. If I did the same thing outside the debugger, auval would only say something like 'could not load, result code 0xSomething' but not give me any details. In both cases Logic would still load the plugin if forced to. What should I do here? Cheers and thanks in advance :-)
1
0
605
Sep ’23
AVAudioUnitComponentManager only returning Apple Audio Units when used from within an Audio Unit
I'm trying to build an audio unit that can load another one. The first step, listing and getting the components only works in the example code if and when the audio unit is loaded by its accompanying main app. But when loaded inside Logic Pro for example, the listed components will be limited to Apple-manufactured ones. On another forum, although not for an AppEx, someone indicated that the solution was to enable Inter-App Audio, which is now deprecated. Tried all three methods of AVAudioUnitComponentManager to get the component list. Please advise. Many thanks, Zoltan
1
0
708
Sep ’23
JIT entitlements in Audio Unit
Is it still possible to use MAP_JIT in mmap and execute said code pages in AUs? When I try to operate on a page with proper flags that worked in a prior version of MacOS, I get a SIGBUS. I am working on getting a minimal example up and running, but this just doesn't seem right to me.
2
0
563
Sep ’23
iOS 17 kAudioUnitSubType_VoiceProcessingIO option makes volume decreased while playing audio
While playing sound, I need to create an AudioUnit to record the microphone at the same time. In order to use echo cancellation, i choose kAudioUnitSubType_VoiceProcessingIO subType to init AudioUnit. It works well in iOS 16 and below. But in iOS 17, the playing volume decreases while playing audio and record. Thank you for your help and hope to see your suggestions.
1
1
718
Oct ’23
Cannot determine shown/hidden status of a v3 Audio Unit on macOS
I have some visualisation-heavy AUv3's, and the goal is not to perform graphics-intensive tasks if the plugin window is not opened inside the host app (such as Logic Pro). On iOS, this is easily accomplished by the viewWillAppear, etc overrides. But on macOS, it seems these overrides are not called every time the user opens / closes the plugin windows in the host application. I did try some alternate methods, like trying to traverse the view / controller hierarchy, or make use of the window property, to no avail. What substitute mechanism could I use to determine visibility status of an AUv3 on macOS? Thanks in advance, Zoltan
2
0
1.1k
Mar ’24
Audio Workgroups and Mach Ports - Access Violation
I'm battling with Audio Workgroups on macOS. I've got it working for Standalone apps, getting the workgroup from the HAL/Device, and for AUv2/AUv3 plugins. I can verify that my plugin/app's processing threads are executing together with the main workgroup thread, using P-cores. So far so good! Now, I'm trying to get this working over IPC with my ***** app. From the documentation, I figured that I can get the mach port from the main audio workgroup (in my Audio Unit) using the os_workgroup_copy_port call. Then I pass this port over IPC to my ***** process, where I want to create a new workgroup from this mach port (which should be slaved to the master workgroup), using the os_workgroup_create_with_port call. However, when doing this, I get an access violation error in my external process. In my test case, I'm hosting an AUv2 in the AUXPC_arrow process (with Logic), and sending the mach port id over to my ***** App, which is also signed with the appropriate entitlements for accessing mach ports (I think): com.apple.security.temporary-exception.mach-lookup.global-name Now, the question is, should this automagically allow me to use a mach port owned by the AUXPC process? Does that process ALSO have to use some specific entitlement? I of course cannot change the entitlements of Apple's bundles. Many thanks for any assistance.
0
0
570
Oct ’23
AudioUnit V2 app with RenderCallback glitchy audio on iOS 17 with iPhone 14/15
Hi, I have an app that has been developed with AudioUnit RemoteIO with renderCallbacks. The app has been performing fine, except on iOS 17 with devices like iPhone 14 or iPhone 15. On iPhone 14, the same app (a metronomic device) was performing fine with iOS 16, and when the customer updated to iOS 17, suddenly the audio was glitchy, had ghost sounds and sound artifacts. This does not happen on iPhone 11 Pro with iOS 17 (works fine!). However, I have been able to reproduce it on iPhone 15 Pro with iOS 17. It works ok at lower BPM and when the BPM goes over a certain threshold, the audio starts getting glitchy. The audio buffers are precomputed, so the render callback is relatively straightforward. Has anyone else seen this kind of issue on iPhone 14/iPhone 15 running iOS 17? I'm following up with Apple on this, but thought I would see if others are facing similar issues with their apps. Thanks, Sridhar
2
0
725
Nov ’23
Standalone rendering of Audio Unit in AUv3 host fails with NoConnection error
I am trying to migrate an Audio Unit host based on the AUv2 C API to the newer AUv3 API. While the migration itself was relatively straightforward (in terms of getting it to compile), the actual rendering fails at run-time with error -10876 aka. kAudioUnitErr_NoConnection. The app does not use AUGraph or AVAudioEngine, perhaps that is an issue? Since the AUv3 and the AUv2 API are bridged in both directions and the rendering works fine with the v2 API, I would expect there to be some way to make it work via the v3 API though. Perhaps someone has an idea why (or under which circumstances) the render block throws this error? For context, the app is Mixxx, an open-source DJing application, and here is the full diff between my AUv2 -> v3 migration: https://github.com/fwcd/mixxx/pull/5/files
1
0
659
Nov ’23
AudioComponentInstanceNew crash on ios17 when use address sanitizer
I tried the same code on ios17 and ios16 when enable address sanitizer, ios17 will crash, why? Can anyone help me? AudioComponent comp = {0}; AudioComponentDescription compDesc = {0}; compDesc.componentType = kAudioUnitType_Output; compDesc.componentSubType = kAudioUnitSubType_RemoteIO; compDesc.componentManufacturer = kAudioUnitManufacturer_Apple; compDesc.componentFlags = 0; compDesc.componentFlagsMask = 0; comp = AudioComponentFindNext(NULL, &compDesc); if (comp == NULL) { assert(false); } AudioUnit tempAudioUnit; osResult = AudioComponentInstanceNew(comp, &tempAudioUnit); if (osResult != noErr) { assert(false); }
2
0
694
Dec ’23
Logic Pro does not update AUAudioUnit's contextName for MIDI FXs
This can be reproduced easily with XCode's generated AUv3-Extension Projects. For MIDI Processor type AUv3-Extensions, the contextName property is only set once during initializing when added as a MIDI FX within Logic Pro, but not after changing the track's name manually. For Music Effect type AUv3-Extensions, contextName is set initially when added as an Audio FX within Logic Pro as well as updated as expected after changing the tracks's name manually. Am I missing something or is this a Logic Pro bug? Thanks, Tobias
0
1
470
Jan ’24
Issue with SwiftUI Alert Freezing in AUv3 Extension Project on Mac Catalyst
Hello, I am working on an AUv3 extension project using SwiftUI in Xcode and have encountered a peculiar issue when implementing a simple alert on Mac Catalyst. The code is straightforward; it's merely an alert triggered by a button within a SwiftUI view. Here's the relevant portion of the code: import SwiftUI struct SwiftAUv3ExtensionMainView: View { var parameterTree: ObservableAUParameterGroup @State var showingAlert = false var body: some View { VStack { ParameterSlider(param: parameterTree.global.gain) Button(action: {showingAlert = true}, label: { Text("Button") }) } .alert("Alert", isPresented: $showingAlert, actions: {}, message: { Text("Message") }) } } The problem arises when this alert is displayed and subsequently closed. Upon closing the alert, the cursor turns into a spinning rainbow and the app freezes for several seconds. Additionally, Xcode's console displays the warning: -[NSWindow makeKeyWindow] called on _NSAlertPanel which returned NO from -[NSWindow canBecomeKeyWindow]. I am looking for insights or solutions to address this issue. Has anyone else experienced similar problems with SwiftUI alerts in AUv3 extension projects, especially when using Mac Catalyst? Any advice or suggestions would be greatly appreciated. Thank you.
0
0
547
Jan ’24
help with crash report for AUv3 plugin
Is this an uncaught C++ exception that could have originated from my code? or something else? (this report is from a tester) (also, why can't crash reporter tell you info about what exception wasn't caught?) (Per instructions here, to view the crash report, you'll need to rename the attached .txt to .ips to view the crash report) thanks! AudulusAU-2024-02-14-020421.txt
1
0
528
Feb ’24