RobustToolbox icon indicating copy to clipboard operation
RobustToolbox copied to clipboard

Change of audio output device breaks audio until game restart

Open VasilisThePikachu opened this issue 3 years ago • 12 comments

Description

Probably an engine issue but i will include it here to be safe, have tried producing only on windows and will try other platforms. Had times where i needed to reconnect my headphones, which causes windows to change the output and lose audio from the game until it is restarted Reproduction

  1. Have the game open
  2. Disconnect your audio device. Wired or Wireless works
  3. Reconnect and observe loss of audio until game restart

Reproducing on

Can

  • Windows 10/11
  • Linux mint (unknown audio server, pulseaudio?)
  • Ubuntu with pulseaudio

Can't

  • MacOS Ventura 13.1 (M1 MacBook Air)
  • Linux Distro with Pipewire (0.3.64, linux 6.1.0)

VasilisThePikachu avatar Mar 13 '23 12:03 VasilisThePikachu

I have been having this issue as well. And you don't actually have to restart the game. You can go back to the server browser and reconnect and you will have audio again. At least in my experience. I am running the game on Linux mint

BRINGit34 avatar Mar 13 '23 16:03 BRINGit34

I have been having this issue as well. And you don't actually have to restart the game. You can go back to the server browser and reconnect and you will have audio again. At least in my experience. I am running the game on Linux mint

Yeah that's restarting the game

The server browser and client are different programs technically

Also cant reproduce on MacOS Ventura 13.1 (M1 MacBook Air)

VasilisThePikachu avatar Mar 13 '23 16:03 VasilisThePikachu

cant reproduce on pipewire 0.3.64, linux 6.1.0

deltanedas avatar Mar 13 '23 18:03 deltanedas

Semi-related but I have a branch that adds preliminary audio device changing support, main work outstanding is reloading clyde audio buffers upon changing device as OpenAL doesn't let you re-use contexts across devices.

metalgearsloth avatar Dec 19 '23 11:12 metalgearsloth

Semi-related but I have a branch that adds preliminary audio device changing support, main work outstanding is reloading clyde audio buffers upon changing device as OpenAL doesn't let you re-use contexts across devices.

I had given this a hand myself, what I found out is that some audio returns, everything else reported invalidvalue errors and positional audio did not work right. To be honest I had no idea what I was doing then though and this was before the audio rework

VasilisThePikachu avatar Dec 19 '23 12:12 VasilisThePikachu

Apparently openal-soft is supposed to have a change audio device thing you can call. But I can't hey it to show up on our thing

VasilisThePikachu avatar Dec 19 '23 12:12 VasilisThePikachu

Apparently openal-soft is supposed to have a change audio device thing you can call. But I can't hey it to show up on our thing

If you pass the null device you can get devices via the extensions, the issue is none of the handles in clyde or via sources are valid anymore and need remaking for the new device.

metalgearsloth avatar Dec 19 '23 12:12 metalgearsloth

With that being said I haven't tested the dedicated method they added recently but ideally that would work.

metalgearsloth avatar Dec 19 '23 12:12 metalgearsloth

Okay looks like ALC_SOFT_reopen_device isn't implemented on 1.20.1 which is what we use so I wasn't high and OpenAL would need an update if we were to go this route.

metalgearsloth avatar Dec 19 '23 13:12 metalgearsloth

Yeah it's what I thought. How hard is it upgrading openal? Worth it?

Letting openal handle it sounds the best

VasilisThePikachu avatar Dec 19 '23 13:12 VasilisThePikachu

Reproduced on Ubuntu 22.04, with pulseaudio 15.99.1, but only on the zip release. This doesn't happen with the flatpak.

Magicalus avatar Aug 26 '24 20:08 Magicalus

Hopefully this will save someone some digging in the future: the branch metalgearsloth was probably talking about for changing the audio device was this: https://github.com/metalgearsloth/RobustToolbox/compare/2023-12-19-audio / https://github.com/space-wizards/RobustToolbox/commit/c50054328b90ff2567f6ba422de642a46d13fdc6

I will also mention that I'm unable to change the game's output device through tools like the Plasma audio widgets or PAVU without restarting the game - possibly related? Running Pipewire.

opl- avatar Sep 09 '25 00:09 opl-