Skip to content

Cracking audio with Godot 4 no-threads Web builds #87329

Closed
@akien-mga

Description

@akien-mga

Tested versions

Reproducible in 4.3.dev (1952f64) with a threads=no Web template.
The issue was "introduced" in #85939 since it wasn't possible to make single-threaded Web builds in Godot 4 before that.

System information

Mageia 9 - Vulkan (Forward+) - dedicated AMD Radeon RX Vega M GL Graphics (RADV VEGAM) () - Intel(R) Core(TM) i7-8705G CPU @ 3.10GHz (8 Threads)

Issue description

The newly reintroduced single-threaded Web export has audio issues, as expected.

On my Linux system, it's pretty dire on any demo that has background music, sfx, and any game logic or rendering effort that's non trivial (i.e. the CPU is kept busy).

Here's an example with the GDQuest TPS demo, uploaded to itch.io, with threads disabled (built from #85939):

https://akien.itch.io/godot4-nothreads-audio-test

(Ignore the weird rendering (Compatibility while the demo is designed for Forward+) and the fact that rotating the camera with the mouse seems to be broken in the Web build.)

Here's how the game sounds like on a native Linux build (editor):

simplescreenrecorder-2024-01-18_12.13.30.mp4

Here's the threads=no Web build (debug) on currently Firefox Nightly (123.0a1 (2024-01-17)) on the same Linux system:

simplescreenrecorder-2024-01-18_12.07.44.mp4

And the same on Chromium (120.0.6099.216) on the same Linux system:

simplescreenrecorder-2024-01-18_12.16.01.mp4

The issue is likely linked to OS, browser, and CPU, so for testers who can or cannot reproduce it, please include full info about what platform you tested on.

$ inxi -CSG
System:
  Host: cauldron Kernel: 6.5.13-desktop-6.mga9 arch: x86_64 bits: 64
    Desktop: KDE Plasma v: 5.27.5 Distro: Mageia 9
CPU:
  Info: quad core model: Intel Core i7-8705G bits: 64 type: MT MCP cache:
    L2: 1024 KiB
  Speed (MHz): avg: 900 min/max: 800/4100 cores: 1: 900 2: 900 3: 900 4: 900
    5: 900 6: 901 7: 900 8: 900
Graphics:
  Device-1: Intel HD Graphics 630 driver: i915 v: kernel
  Device-2: AMD Polaris 22 XL [Radeon RX Vega M GL] driver: amdgpu v: kernel
  Device-3: Cheng Uei Precision Industry (Foxlink) HP Wide Vision FHD Camera
    type: USB driver: uvcvideo
  Display: x11 server: X.org v: 1.21.1.8 with: Xwayland v: 22.1.9 driver: X:
    loaded: intel,v4l dri: i965 gpu: i915 resolution: 2048x1152~60Hz
  API: OpenGL v: 4.6 Mesa 23.3.2 renderer: Mesa Intel HD Graphics 630 (KBL
    GT2)

Steps to reproduce

  • Export a project with audio and some non-trivial game logic to the Web, with threads disabled (in 4.3-dev3 or later, or custom builds from master with threads=no)
  • Run it on an affected system. At least reproducible on my Linux laptop.

Minimal reproduction project (MRP)

https://akien.itch.io/godot4-nothreads-audio-test

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions