Application crashes because can't connect to PulseAudio

Hello guys!

I’ve reinstalled my OS on my computer and continued developing my JMonkeyEngine application on this fresh install. However I can’t start the application because it crashes instantly with the exception below. I’m using Pop_OS. My game works on other linux and on other Windows10 machine, except on this Pop_OS one.

I’ve tried messing around with settings and looked up multiple forums but nothing helped me so far. I’ve never configured audio system on linux before so I’m in the dark completely.

What can I do?

2022-04-15 17:55:09 | WARNING | com.jme3.asset.AssetConfig loadText | Cannot find loader com.jme3.audio.plugins.OGGLoader 
ALSA lib ../../pulse/pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused

AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': Connection refused
2022-04-15 17:55:09 | SEVERE  | com.jme3.app.LegacyApplication handleError | Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.NullPointerException
	at org.lwjgl.system.Checks.check(Checks.java:100)
	at org.lwjgl.openal.ALC10.nalcCreateContext(ALC10.java:137)
	at org.lwjgl.openal.ALC10.alcCreateContext(ALC10.java:153)
	at com.jme3.audio.lwjgl.LwjglALC.createALC(LwjglALC.java:58)
	at com.jme3.audio.openal.ALAudioRenderer.initOpenAL(ALAudioRenderer.java:95)
	at com.jme3.audio.openal.ALAudioRenderer.initialize(ALAudioRenderer.java:226)
	at com.jme3.app.LegacyApplication.initAudio(LegacyApplication.java:292)
	at com.jme3.app.LegacyApplication.initialize(LegacyApplication.java:642)
	at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:198)
	at com.jme3.system.lwjgl.LwjglWindow.initInThread(LwjglWindow.java:520)
	at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:619)
	at com.jme3.system.lwjgl.LwjglWindow.create(LwjglWindow.java:473)
	at com.jme3.app.LegacyApplication.start(LegacyApplication.java:491)
	at com.jme3.app.LegacyApplication.start(LegacyApplication.java:443)
	at com.jme3.app.SimpleApplication.start(SimpleApplication.java:126)
	at com.loopotron.server.ServerApp.main(ServerApp.java:54)

https://javadoc.jmonkeyengine.org/v3.5.1-stable/com/jme3/system/AppSettings.html#setAudioRenderer-java.lang.String-

Setting the audio renderer to null will get around the issue if you don’t plan to use audio.

3 Likes

I’ve tried what you’ve told me. It is perfect for a temporary solution. I can continue working on my project untill I find out what’s wrong with the OS configuration.
Thank you!

1 Like

Are you using lwjgl3?

If you mean the Renderer option in the appSettings then I’m using the default: “LWJGL-OpenGL2”

Edit: Oh I guess you mean AudioRenderer then I use LWJGL in appsettings, so the default setting. The nullpointer comes when I use the defaults but only on Pop!_OS