Exception: value for key 'NS.objects' was of unexpected class 'AUAudioUnitProperty'

I've added a preset selector UI to my AU extension but when I select a preset from the extension UI (i.e. extension tries to set a preset itself) the host spits out the following in the logs and usually ends up freezing:


AUv3Host[3718] <Warning>: <NSXPCConnection: 0x12e51e0d0> connection from pid 3719: Warning: Exception caught during decoding of received message, dropping incoming message.
  Exception: Exception while decoding argument 0 (#2 of invocation):
  <NSInvocation: 0x12e67d700>
  return value: {v} void
  target: {@} 0x0
  selector: {:} propertiesChanged:
  argument 2: {@} 0x0

  Exception: value for key 'NS.objects' was of unexpected class 'AUAudioUnitProperty'. Allowed classes are '{(
     NSDate,
     NSString,
     NSData,
     NSNumber,
     NSNull,
     NSDictionary,
     NSArray
  )}'.


I don't understand what this means exactly. It doens't make sense to me.


If I select a preset from the host's UI everything works fine.


The preset selector code simply tries to set the fullState property of the AU.


Anyone has any ideas what's going on here?

Accepted Reply

FYI - Filed a bug about this today - thanks for following up FAC.


I was able to reproduce as described and it looks like bad plumbing from what I can tell. I also put a test together on macOS which produces the same results. I don't believe this is an issue with the sample but the framework itself.

Replies

I've got the same issue as Nikolozi, here you have the procedure to reproduce the problem, download the last sample from Apple and add this method in AudioUnitV3ExampleABasicAudioUnitExtensionandHostImplementation/Filter/iOS/FilterDemoFramework/FilterDemoViewController.swift


    @IBAction func onSetPreset(_ sender: Any) {
        guard let au = self.audioUnit else { return }
        au.currentPreset = au.factoryPresets![0]
    }


Add for sure a buton in AudioUnitV3ExampleABasicAudioUnitExtensionandHostImplementation/Filter/iOS/FilterDemoAppExtension/Base.lproj/MainInterface.storyboard


  1. Run iOSFilterDemoApp scheme
  2. Run iOSAUv3Host scheme
  3. Select FilterDemo
  4. Play
  5. View
  6. Hit preset button (Exception raised in console)
  7. Select third preset in host
  8. Try to select another preset in host... host tableview, all host freeze... Same behavior in GB

FYI - Filed a bug about this today - thanks for following up FAC.


I was able to reproduce as described and it looks like bad plumbing from what I can tell. I also put a test together on macOS which produces the same results. I don't believe this is an issue with the sample but the framework itself.

FYI, it turns out there is a Foundation bug which is blocking our fix for this issue. But we know what's up and there will be a fix down the road.

Some of my users (I'm the developer of AUM - Audio Mixer) are still running iOS 10 or 11, where this bug happens. When the host freezes, the user needs to terminate it and loose all work, etc. Is there any work around a host can do to avoid this? Or should all plugin developers that support iOS 10 or 11 skip their internal preset selector if running on iOS <= 11?