• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by isaac_engel · Jan 24, 2017 at 05:20 AM · unity 5iosaudiovrxcode

GVR Audio Renderer not found iOS

I am tinkering with the sample project "SpatialAudio" from Google VR SDK for Unity, to implement it in iOS. I built it in Unity using the latest GVR SDK, so I had to replace a few deprecated keywords (GvrAudioSource instead of CardboardAudioSource, etc.) If I build it in Xcode just as Unity gives it to me, it runs fine in the physical device. Then, I tried to edit the Unity-generated file 'main.mm' to change the default App Controller (UnityAppController) to a new one, let's call it NewAppController.

 // main.mm
 ...
 const char* AppControllerClassName = "UnityAppController";
 ...
 //UIApplicationMain(argc, argv, nil, [NSString stringWithUTF8String:AppControllerClassName]); // old
 UIApplicationMain(argc, argv, nil, [NSString stringWithUTF8String:"NewAppController"]); // new

NewAppController is a class which inherits from UnityAppController and does not override any of its methods or properties, like this:

 @interface NewAppController : UnityAppController
 @end
 
 @implementation NewAppController
 @end

I thought that it should work exactly the same as before, but now I get the following warning in runtime: "Audio effect GVR Audio Renderer could not be found. Check that the project contains the correct native audio plugin libraries and that the importer settings are set up correctly."

Everything else works just fine: I can see the video and even hear the sounds, but only they are not 'spatialized'.

I am using: GVR SDK 1.1, Unity 5.5.0f3, iOS 10.1.1

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image isaac_engel · Jan 22, 2017 at 05:19 PM 0
Share

I found the solution. I was missing two important things: First, messing with main.mm causes a lot of trouble. The correct approach for defining a custom App Controller is to create a subclass of UnityAppController and adding the macro I$$anonymous$$PL_APP_CONTROLLER_SUBCLASS(name_of_the_class) at the bottom of its .mm file. Second, Unity automatically generates a custom app controller, called CardboardAppController, which is located in the build directory, under 'Libraries/Plugins/iOS'. One of its functions is registering the unity audio effect plugin. I was bypassing this file without knowing, causing the audio renderer to not initialize properly. So my solution was to comment out the macro at the end of the file CardboardAppController.mm (line 71):

 //I$$anonymous$$PL_APP_CONTROLLER_SUBCLASS(CardboardAppController)

And defining the new custom controller as a subclass of CardboardAppController:

 #import "CardboardAppController.h"
 
 @interface NewAppController : CardboardAppController
 @end
 
 @implementation NewAppController
 @end
 I$$anonymous$$PL_APP_CONTROLLER_SUBCLASS(NewAppController)

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Xcode linker error lists methods that should exist 0 Answers

App Store size almost 15 times more then iPA 0 Answers

linker command failed with exit code 1 (use -v to see invocation) unity 5.5 to xcode 8 0 Answers

IOS Build settings IL2CPP disabled, Xcode error "Undefined symbol: _UnityPluginUnload" 1 Answer

Unity XCode build linker error 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges