Skip to content

Android: Freeze if attempting to play audio before calling mobile.SetGame() #3260

Open
@SolarLune

Description

@SolarLune

Ebitengine Version

v2.8.8

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • PlayStation 5
  • Xbox
  • Web Browsers

Go Version (go version)

v1.24.3

What steps will reproduce the problem?

We discussed this on the Ebitengine Discord here, but I thought I should make an issue for it.

Essentially, Android freezes if you attempt to play audio outside of a game loop (i.e. before Ebitengine initializes with mobile.SetGame(). Note that this is only if you actually try to play audio, not create an audio Context or create an audio Player.

This is reproducible, but because an Android project is too large to put into a single code block here, I made a repo for it here.

I can reproduce on my virtual device (a Pixel 7a) and on a real device (a Retroid Pocket Flip 2).

What is the expected result?

Audio plays, or a panic if it's not possible.

What happens instead?

Android hangs.

Anything else you feel useful to add?

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions