Forum Discussion
GlimpseGroupDev
3 years agoProtege
Requesting Audio Focus on Quest 2
Hello everyone, my company has a social app on Quest 2. There is an intermittent and unpredictable bug that happens where 100% of the sound from the app cuts out and the user hears nothing. We cannot find any consistent way to reproduce the problem but it happens somewhat regularly for users in normal conditions.
Taking a look at some debug values, no audio sources are muted and the audio listener is also not muted. The device volume is up and the audio listener volume is also full. I was trying to determine on what level the device was muted when I found that setting up an android listener to check if we had audio focus CAUSED the problem. This is the command called:
var unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
s_mainActivity = unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity");
s_androidAudioManager = s_mainActivity.Call<AndroidJavaObject>("getSystemService", "audio");
int result = s_androidAudioManager.Call<Int32>("requestAudioFocus", listenerToUse, 3, 1);
From everything I can tell reading the Android documentation, this command "requestAudioFocus" is intended to ask for audio focus for your app. In practice, it does the exact opposite on Quest. Any time this command is run, the audio cuts out completely. I am trying to find some way of undoing this loss of audio so that when users lose audio at random I can correct the problem. Currently the only way to regain audio is pressing the power button on the Quest twice. This solution fixes the problem when users encounter the error and also when I run the Android audio focus request.
Is there a correct way to regain audio focus on Quest when it is lost? Are there reasons why audio focus would be lost? Any help would be appreciated, thank you.
4 Replies
Replies have been turned off for this discussion
- maxweiselHonored Guest
Adding that we're hitting this exact same issue in our title.
Max
- mattsichExplorer
Same here! I actually see this happen when toggling the meta dashboard while playing our game. It's not every time but after several attempts, the audio will cut out or in.
- MetaStoreHelpCommunity Manager
Hey mattsich! Thank you for bringing this to our attention. We understand that you're having issues with your audio cutting in and out and know how that can affect your gaming experience. No worries; we'll be happy to help. Could you please answer the following:
- Is the audio issue happening on just one game or multiple games?
- Have you tried rebooting your headset?
- Have you tried factory resetting your headset?
We look forward to your response!
- MetaStoreHelpCommunity Manager
Hey there! We're just following up with you to see if you still need assistance. If so, please provide the information from our previous message and we'll assist. We hope you have a great day!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 8 months ago
- 3 months ago