Skip to content

Disconnecting wireless earphones causes WASAPI error messages to show up in the editor #104837

@chocola-mint

Description

@chocola-mint

Tested versions

  • Reproducible in 4.3
  • Reproducible in 4.5.dev (latest master)

System information

Godot v4.5.dev (e585e6a) - Windows 11 (build 26100) - Multi-window, 1 monitor - OpenGL 3 (Compatibility) - NVIDIA GeForce RTX 3050 Laptop GPU (NVIDIA; 31.0.15.5339) - 11th Gen Intel(R) Core(TM) i5-11400H @ 2.70GHz (12 threads)

Issue description

The following messages are shown whenever I disconnect my wireless earphones while using the Godot editor:

ERROR: drivers\wasapi\audio_driver_wasapi.cpp:780 - WASAPI: GetBufferSize error
WARNING: drivers\wasapi\audio_driver_wasapi.cpp:851 - WASAPI: Current output_device invalidated, closing output_device

The warning is expected, but the error is not.

The function call ad->audio_output.audio_client->GetBufferSize(&buffer_size) can actually return AUDCLNT_E_DEVICE_INVALIDATED, but this is not handled properly, causing an unneeded error message to appear. The subsequent ad->audio_output.render_client->GetBuffer(write_frames, &buffer) call does handle this case properly, however.

Steps to reproduce

  1. Open any Godot project.
  2. Connect your PC with wireless earphones. Make sure that they are the current output device.
  3. Disconnect them.
  4. See the error messages generated in the editor output.

Minimal reproduction project (MRP)

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    For team assessment

    Status

    For team assessment

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions