PolyMC icon indicating copy to clipboard operation
PolyMC copied to clipboard

OpenAL fails to find `libpulse.so` on NixOS

Open Sciencentistguy opened this issue 3 years ago • 6 comments

Operating System

Linux (NixOS)

Version of PolyMC

Version 1.4.2 Git GITDIR-NOTFOUND

Version of Qt

Qt 5 (nixpkgs)

Description of bug

Minecraft has no audio. This can usually be worked around by using the system OpenAL, but since 1.19 this option has no effect (See https://github.com/PolyMC/PolyMC/issues/643).

Steps to reproduce

  • Run NixOS
  • Run minecraft 1.19.x
  • No sound!

Suspected cause

OpenAL fails to find libpulse.so. This is

stacktrace:

[12:53:43] [Render thread/ERROR]: Error starting SoundSystem. Turning off sounds & music
java.lang.IllegalStateException: Failed to open OpenAL device
	at net.minecraft.class_4225.method_38501(class_4225.java:283) ~[client-intermediary.jar:?]
	at net.minecraft.class_4225.method_19661(class_4225.java:153) ~[client-intermediary.jar:?]
	at net.minecraft.class_1140.method_4846(class_1140.java:113) ~[client-intermediary.jar:?]
	at net.minecraft.class_1140.method_4837(class_1140.java:103) ~[client-intermediary.jar:?]
	at net.minecraft.class_1144.method_18182(class_1144.java:112) ~[client-intermediary.jar:?]
	at net.minecraft.class_1144.method_18788(class_1144.java:38) ~[client-intermediary.jar:?]
	at net.minecraft.class_4080.method_18790(class_4080.java:13) ~[client-intermediary.jar:?]
	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?]
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
	at net.minecraft.class_4014.method_18365(class_4014.java:69) ~[client-intermediary.jar:?]
	at net.minecraft.class_1255.execute(class_1255.java:103) ~[client-intermediary.jar:?]
	at net.minecraft.class_4014.method_18367(class_4014.java:68) ~[client-intermediary.jar:?]
	at java.util.concurrent.CompletableFuture$UniCompletion.claim(CompletableFuture.java:572) ~[?:?]
	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714) ~[?:?]
	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
	at java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:614) ~[?:?]
	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:726) ~[?:?]
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
	at com.mojang.blaze3d.systems.RenderSystem.replayQueue(RenderSystem.java:211) [client-intermediary.jar:?]
	at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:198) [client-intermediary.jar:?]
	at net.minecraft.class_1041.method_15998(class_1041.java:315) [client-intermediary.jar:?]
	at net.minecraft.class_310.method_1523(class_310.java:1205) [client-intermediary.jar:?]
	at net.minecraft.class_310.method_1514(class_310.java:768) [client-intermediary.jar:?]
	at net.minecraft.client.main.Main.method_44604(Main.java:244) [client-intermediary.jar:?]
	at net.minecraft.client.main.Main.main(Main.java:51) [client-intermediary.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461) [fabric-loader-0.14.9.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.14.9.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.14.9.jar:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
	at org.polymc.impl.OneSixLauncher.invokeMain(OneSixLauncher.java:104) [NewLaunch.jar:?]
	at org.polymc.impl.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:175) [NewLaunch.jar:?]
	at org.polymc.impl.OneSixLauncher.launch(OneSixLauncher.java:185) [NewLaunch.jar:?]
	at org.polymc.EntryPoint.listen(EntryPoint.java:144) [NewLaunch.jar:?]
	at org.polymc.EntryPoint.main(EntryPoint.java:74) [NewLaunch.jar:?]

alsoft.log (ALSOFT_LOGLEVEL=3)

[ALSOFT] (II) Initializing library v1.21.1-2290817 master
[ALSOFT] (II) Supported backends: jack, pulse, alsa, oss, port, null, wave
[ALSOFT] (II) Loading config /etc/openal/alsoft.conf...
[ALSOFT] (II) Loading config /nix/store/j5k6wsb7i2v8q0x91ljr26j85x3p43n7-gnome-settings-daemon-42.2/etc/xdg/alsoft.conf...
[ALSOFT] (II) Loading config /run/current-system/sw/etc/xdg/alsoft.conf...
[ALSOFT] (II) Loading config /nix/var/nix/profiles/default/etc/xdg/alsoft.conf...
[ALSOFT] (II) Loading config /etc/profiles/per-user/jamie/etc/xdg/alsoft.conf...
[ALSOFT] (II) Loading config /home/jamie/.nix-profile/etc/xdg/alsoft.conf...
[ALSOFT] (II) Loading config /etc/xdg/alsoft.conf...
[ALSOFT] (II) Loading config /home/jamie/.alsoftrc...
[ALSOFT] (II)  found 'drivers' = 'pulse,'
[ALSOFT] (II) Loading config /home/jamie/.config/alsoft.conf...
[ALSOFT] (II) Got binary: /nix/store/lalm4p0gk4sc9qgxkk8vkb4xvg7fr2am-openjdk-17.0.3+7/lib/openjdk/bin, java
[ALSOFT] (II) Loading config /nix/store/lalm4p0gk4sc9qgxkk8vkb4xvg7fr2am-openjdk-17.0.3+7/lib/openjdk/bin/alsoft.conf...
[ALSOFT] (II) Key disable-cpu-exts not found
[ALSOFT] (II) Vendor ID: "AuthenticAMD"
[ALSOFT] (II) Name: "AMD Ryzen 9 5950X 16-Core Processor"
[ALSOFT] (II) Extensions: +SSE +SSE2 +SSE3 +SSE4.1
[ALSOFT] (II) Key rt-prio not found
[ALSOFT] (II) Key resampler not found
[ALSOFT] (II) Key trap-al-error not found
[ALSOFT] (II) Key trap-alc-error not found
[ALSOFT] (II) Key reverb/boost not found
[ALSOFT] (II) Found drivers = "pulse,"
[ALSOFT] (WW) Failed to load libpulse.so.0
[ALSOFT] (WW) Failed to initialize backend "pulse"
[ALSOFT] (WW) Failed to load libjack.so.0
[ALSOFT] (WW) Failed to initialize backend "jack"
[ALSOFT] (WW) Failed to load libasound.so.2
[ALSOFT] (WW) Failed to initialize backend "alsa"
[ALSOFT] (II) Key oss/device not found
[ALSOFT] (II) Key oss/capture not found
[ALSOFT] (II) Initialized backend "oss"
[ALSOFT] (II) Added "oss" for playback
[ALSOFT] (II) Added "oss" for capture
[ALSOFT] (II) Key excludefx not found
[ALSOFT] (II) Key default-reverb not found
[ALSOFT] (WW) Failed to open playback device: Could not open /dev/dsp: No such file or directory
[ALSOFT] (WW) Error generated on device (nil), code 0xa004
[ALSOFT] (II) Freeing device 0x7f60fb4cbc40
[ALSOFT] (WW) Failed to open playback device: Could not open /dev/dsp: No such file or directory
[ALSOFT] (WW) Error generated on device (nil), code 0xa004
[ALSOFT] (II) Freeing device 0x7f60fb4cbc40

This issue is unique

  • [X] I have searched the issue tracker and did not find an issue describing my bug.

Sciencentistguy avatar Oct 07 '22 11:10 Sciencentistguy

I think that might be an issue with the nixpkgs package, can you try our flake?

DioEgizio avatar Oct 07 '22 12:10 DioEgizio

Ah! The newest version of the flake indeed does not have this bug. This must have been a recent fix, as I was actually previously using your flake, and in troubleshooting reverted to the nixpkgs version due to an unrelated bug causing sporadic segfaults.

Thanks!

Sciencentistguy avatar Oct 07 '22 12:10 Sciencentistguy

Well this is odd. When running polymc with nix run github:PolyMC/PolyMC, the bug is not present.

When installed (with home-manager's home.packages) either from the command-line polymc or from the desktop entry (through gnome) the bug is present, even with the newest flake version.

Interestingly, nix run nixpkgs#polymc does have the bug

Sciencentistguy avatar Oct 07 '22 12:10 Sciencentistguy

DipEgizio

I think that might be an issue with the nixpkgs package, can you try our flake

@Sciencentistguy

When running polymc with nix run github:PolyMC/PolyMC, the bug is not present. Interestingly, nix run nixpkgs#polymc does have the bug

spikespaz avatar Oct 08 '22 06:10 spikespaz

Did you read the middle paragraph? @spikespaz. The bug is present with your flake, if it is installed. It appears that nix run is doing something differently with the flake.

Sciencentistguy avatar Oct 08 '22 23:10 Sciencentistguy

Did you read the middle paragraph? @spikespaz. The bug is present with your flake, if it is installed. It appears that nix run is doing something differently with the flake.

The flake and nixpkgs provide different packages. This is why they behave differently.

spikespaz avatar Oct 08 '22 23:10 spikespaz