Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-44055

Game fails to switch the audio output from one device to another after the game has started (from title screen)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 1.7.4, Minecraft 14w08a, 1.15.2, 20w17a, 1.16.3, 1.16.4 Release Candidate 1, 1.16.4, 20w46a, 20w49a, 20w51a, 1.16.5, 21w06a, 21w14a, 21w17a, 21w20a, 1.17 Pre-release 2, 1.17, 1.17.1
    • Fix Version/s: 21w38a
    • Labels:
    • Environment:
      Windows 7 Home Premium x64
    • Confirmation Status:
      Confirmed
    • Mojang Priority:
      Normal

      Description

      Moderator Note

      This ticket includes switching between all types of audio devices, not just headphones.

      To work around the issue, you can manually reload sounds (and all other resources) with F3+T.

      The game fails to switch audio outputs, meaning that headphones cannot start or stop being used after game start.

      After the game start, plugging in the headphones should have audio going through the headphones. Unplugging them should have audio going through the speakers (Unless, the default speakers say otherwise).

      After plugging (or unplugging) headphones, no sound can be heard because the sound is still going to the jack. (or still not going to the jack. The Computer OS detects the headphones muting the speakers, which is normal operation)

      Reproduction steps

      No audio through headphones

      1. Start minecraft with no headphones in headphone jack*
      2. Plug headphones into headphone jack* (title screen or in-game)

      *Headphones can be typical audio jack or USB

      No audio through speakers

      1. Start minecraft with headphones in headphone jack*
      2. Unplug headphones from headphone jack* (title screen or in-game)

      *Headphones can be typical audio jack or USB

      I'm unaware if this problem can be caused from the launcher.

      Workaround

      See LWJGL forum post:

      In the meantime, you could try fixing this with a virtual audio device. I'm not sure what's available on Linux/PulseAudio, but it's certainly possible on Windows. You create a virtual audio device and configure it as the default. It's what Minecraft/OpenAL Soft will use to output audio. Then you configure the virtual device to forward any audio to the real audio device of your choice. You should then be able to change the downstream device, on the fly, without breaking Minecraft/OpenAL Soft.

      Suggested fix

      See LWJGL forum post:

      What could be done to resolve this? Suggestions:

      • Minecraft regularly queries alcGetInteger(device, ALC_CONNECTED), via the ALC_EXT_disconnect extension. If it returns ALC_FALSE, it automatically recreates the audio context.
      • Minecraft regularly queries alcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER). This returns a string that describes the default audio device. If it changes, it automatically recreates the audio context.
      • Minecraft queries ALC_ALL_DEVICES_SPECIFIER (also regularly updates it) and displays the list of available audio devices. Instead of changing the default audio device from the OS settings, users can change the audio device used by Minecraft itself. This is the simplest and most robust solution. I don't remember a PC game that doesn't have such an option in its audio settings.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              BinaryAura Johnathan Dunker
              Votes:
              49 Vote for this issue
              Watchers:
              38 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                CHK: