My team is hitting some roadblocks running JUCE on Oculus, and we believe it is generally an issue with our Android integration and not necessarily Oculus specific.
From one of our devs:
We’re running into numerous roadblocks to get audio playing on Oculus. Most of the ones I’m struggling to get past involve the low-level JUCE/Android integration. For example, right now we’re forcing our audio system to run on the main thread (rather than split one off, like it does on other platforms) because of issues enabling the
Looper
object. We’re also hitting issues when requesting mic permissions related to someActivity
andFragment
stuff not being properly set-up. As best as I can tell, it seems this is all related to how JUCE is trying to communicate with the JNI/Android OS. We don’t necessarily need this permission right now, but not requesting the permission causes us to fail elsewhere. Furthermore, it’s not certain to me that fixing these issues I’ve mentioned will get us to the point where we’re actually hearing our test sound; I expect there could be more issues of a similar nature. I don’t have the low-level knowledge with JUCE or Android to be able to hack past these blocks very efficiently or without gutting other functionality that we need.
The error with the Looper
object when trying to run audio on a separate thread is:
JNI DETECTED ERROR IN APPLICATION: JNI CallBooleanMethodV called with pending exception java.lang.RuntimeException: Can't create handler inside thread Thread[Thread-7,5,main] that has not called Looper.prepare()
Which we believe may be related to this thread but we don’t have sufficient context to use the solution described therein. It may be that a clarifier there is all we need.
Any help is greatly appreciated!