This blog attempts to be a collection of how-to examples in the Microsoft software stack - things that may take forever to find out, especially for the beginner. I see it as my way to return something to the Microsoft community in exchange for what I learned from it.

28 December 2016

All right, so I was finally past a couple of deadlines with paid HoloLens apps and was ready to take the plunge to update my app AMS HoloATC to Unity 5.5 and the newest HoloToolkit. After wrestling my way past some some interesting breaking changes (more about that later), I was finally at the point where everything worked again as it did before – and started adding new features. Today was the day I thought it was ready enough to justify a new submission to the store. I had tested everything thoroughly, so what could possibly go wrong.

Why, if it ain’t my dear old friend the WACK. The 'binary analyzer' has found a file AudioPluginMsHRTF.dll that does not pass the AppContainerCheck and the WACK gives me a whole bunch of suggestions that don't mean anything to me. Apparently I have to add a couple of options when I link the app, but I have not seen a linker since I wrote my last C program, which was – I think – before 2000. Now I know the WACK has some issues, so I tried submitting it anyway – but no dice. The Windows Store spitted it right back to me, with the same error. So now what?

Fortunately I have had dealt with Spatial Sound before and recognized the “Ms HRTF Spatializer” as something I just selected in Unity. After numerous (time consuming) failures trying to juggle the WACK, I took a desperate measure. I went back to a machine that had a previous installation of Unity on it – 5.4 – and checked AudioPluginMsHRTF.dll there. I found it in C:\Program Files\Unity HoloLens 5.4.0f3-HTP\Editor\Data\VR\Unity\WindowsStoreApps. It reports being its size as 2931200 bytesFor Unity 5.5, in C:\Program Files\Unity550f3\Editor\Data\UnityExtensions\Unity\VR\WindowsStoreApps\uap_x86, there’s a file of 13312 bytes big. Only 13kb. Yet, when you deploy and app with this only 13kb dll to a HoloLens Spatial Sound works. You can clearly hear the difference – simple stereo versus spatial sound.

So I went about and looked around where this dll is taken from when Visual Studio project is built, and found it comes from the plugins directory in the project directory of the generated solution. In my case that’s C:\Projects\AMS_HoloATC\AMS HoloATC\App\AMS HoloATC\Plugins\X86. I replaced the 13kb AudioPluginMsHRTF.dll by the one I had taken from the 5.4 installation. That fixed the WACK. Unfortunately, it also made the app crash whenever I used Spatial Sound. Nice try, no cigar. But it conformed my suspicions that the 5.5 version of this dll is indeed the thing that makes the WACK protest.

So what I did, in the end, was just get rid of ‘real’ Spatial Sound. I went to Edit/Project settings in Unity and set “Spatializer Plugin” to “None”, disabling the Ms HRTF Spatializer. Re-created the Visual Studio solution from complete scratch, and the reference to AudioPluginMsHRTF.dll and AudioPluginMsHRTF.pdb were gone. And so was the WACK error.

But of course, now my app has no real spatial sound anymore – it’s reduced to ‘normal’ Unity Stereo Panning. But a running app is better than one that does not. I have filed a bug at Unity with a repro and contacted some people within Microsoft. I will keep you posted about any progress. In the mean time, this should keep you going forward.

Feedback, comments and tokens of appreciation

If you spot things that are incorrect, or if you don't understand what I mean, please drop a comment on the offending article and I will help you ASAP. You can e-mail me at joostvanschaik at outlook dot com or contact me via twitter.

If you find the information on this blog useful (and apparently some 600+ people per day do on average) please let me know as well, that encourages me to keep doing this. Or do tell others - that made me an MVP; who knows what more it might bring ;-P

Disclaimer and legal stuff

Although I take great care in providing quality samples, all postings, articles and/or files on this site are provided "AS IS" with no warranties, and confer no rights. The views expressed on this blog are strictly my own and do not necessarily reflect the views of my employer, or anyone else on the planet for that matter.

I usually make original content, sometimes building upon other people's work. Sometimes I explain things that can be found elsewhere because I felt what I read was not clear enough for my limited mind so I explain it the way it finally clicked with me. In all cases I take great pains to be sure to link to people or articles who deserve the credit. If you think I have shortchanged you on the credits please let me know.

Please note, I do not work for Microsoft and while I proudly wear the title of "Microsoft Most Valueable Professional", my opinions, files offered, etc. do not represent, are approved of, endorsed by or paid for by Microsoft. The only power behind it is me and my sometimes runaway passion for parts of Microsoft's technology.