Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add Background Audio, Update UI #26

Merged
merged 2 commits into from
Feb 7, 2022
Merged

Add Background Audio, Update UI #26

merged 2 commits into from
Feb 7, 2022

Conversation

threethan
Copy link
Collaborator

This version allows apps like Discord and Spotify to function almost flawlessly on the Quest 2 (don't have a quest 1 to test)
However, this requires device owner permissions. I'm gonna hold off on uploading my own apk for a few days, since changing forks would require a factory reset. (You can't install updates to admin apps unless signatures match)

  • A new option has been added to enable background audio
    When run, this will grab a list of all installed packages
    Every 2 seconds, all packages will be given the "PLAY_AUDIO" and "RECORD_AUDIO" permissions
    These permissions are enabled by default on all android apps,
    but the Quest OS disables them when an app is minimized or the headset is unlocked

    Music and voice chat apps now work on the Quest/2, even when in game
    This does not stop the OS from killing apps in the background, which will still happen when a game is quit
    The enabler service will remain though, so only the audio apps need to be reinitialized

  • The user interface has been updated to better match with the Quest v30 default apps
    Colors were taken from screenshots, fonts were changed, and icons were added

  • README has been updated to explain the new feature

  • README has an updated screenshot

- A new option has been added to enable background audio
    When run, this will grab a list of all installed packages
    Every 2 seconds, all packages will be given the "PLAY_AUDIO" and "RECORD_AUDIO" permissions
    These permissions are enabled by default on all android apps,
    but the Quest OS disables them when an app is minimized or the headset is unlocked

    Music and voice chat apps now work on the Quest/2, even when in game
    This does not stop the OS from killing apps in the background, which will still happen when a game is quit
    The enabler service will remain though, so only the audio apps need to be reinitialized

- The user interface has been updated to better match with the Quest v30 default apps
    Colors were taken from screenshots, fonts were changed, and icons were added

- README has been updated to explain the new feature
- README has an updated screenshot
@basti564 basti564 added the enhancement New feature or request label Feb 7, 2022
@basti564
Copy link
Owner

basti564 commented Feb 7, 2022

Thank you for your pull request!
This very cool feature, I have just tested it on my devices an it works great.
I will publish a signed version of Oculess with these features soon.

@basti564 basti564 closed this Feb 7, 2022
@basti564 basti564 reopened this Feb 7, 2022
@basti564 basti564 merged commit abfd00a into basti564:main Feb 7, 2022
@D3SOX
Copy link

D3SOX commented Feb 8, 2022

Thank you, this works great!

The only thing I noticed is that the OS pauses media playback when an update or unsupported app dialog comes up (For example, with modded Beat Saber).
So you wouldn't be able to use Spotify as background music playback with such apps because you can't resume the playback in a VR app. However, apps that don't make use of Android's media player feature like Discord work fine.

@threethan
Copy link
Collaborator Author

@D3SOX I've noticed this. That seems to be normal android behavior - media playback from one source gets paused when another starts. I incorrectly stated in the PR that apps seem to be suspended when you quit a game - turns out media is only paused. Normally it would be possible to resume playback from the notification shade (the quest seems to use it's own notification implementation instead of android's) or by using a hardware play/pause button (the quest seems to ignore hardware media buttons). However, I managed to resume spotify remotely using spotify connect.

It might be possible to work around this using an accessibility service. (I can confirm that custom accessibility interactions work fine on the quest) This might also make it possible to run at startup, as typical "launch-at-startup" apps don't work on the quest.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants