Programming > OpenAL
Can't get sound to work (LWJGL 3.2.1 build 12, Win10 64-bit)
princec:
Try as I might... no sound. LWJGL2.9 works, of course.
My init code:
--- Code: --- String defaultDeviceName = alcGetString(0, ALC_DEFAULT_DEVICE_SPECIFIER);
LOGGER.finer(() -> "Default OpenAL device: " + defaultDeviceName);
long device = alcOpenDevice(defaultDeviceName);
if (device == 0L) {
throw new IllegalStateException("Can't open device " + defaultDeviceName);
}
int[] attributes = {0};
long context = alcCreateContext(device, attributes);
if (!alcMakeContextCurrent(context)) {
throw new IllegalStateException("Context cannot be made current");
}
alcCapabilities = createCapabilities(device);
alCapabilities = createCapabilities(alcCapabilities);
--- End code ---
Prints "Default OpenAL device: OpenAL Soft", as expected. No errors seem to be raised with alGetError (and why should they - the rest of my code is unchanged from 2.9)
Cas :)
spasi:
Hey Cas,
A few things to try:
1. Pass NULL to alcOpenDevice:
--- Code: ---alcOpenDevice((ByteBuffer)null)
--- End code ---
2. Print the list of the available devices with:
--- Code: ---List<String> devices = ALUtil.getStringList(NULL, ALC_ALL_DEVICES_SPECIFIER)
--- End code ---
and use one of those names with alcOpenDevice.
3. Enable OpenAL Soft's logging by setting the ALSOFT_LOGLEVEL=3 environment variable. More info here. Anything interesting in the output?
4. Use the OpenAL Soft shared library that comes with LWJGL 2. You can do that easily with -Dorg.lwjgl.openal.libname=<path_to_OpenAL64.dll>. Does that resolve the issue?
princec:
Firstly the AL debug output goes like this:
AL lib: (II) alc_initconfig: Initializing library v1.19.1-0da960c HEAD
AL lib: (II) alc_initconfig: Supported backends: wasapi, dsound, winmm, null, wave
AL lib: (II) ReadALConfig: Loading config C:\Users\foo\AppData\Roaming\alsoft.ini...
AL lib: (II) GetProcBinary: Got path: C:\Program Files\Java\zulu11.2.3-jdk11.0.1-win_x64\bin
AL lib: (II) ReadALConfig: Loading config C:\Program Files\Java\zulu11.2.3-jdk11.0.1-win_x64\bin\alsoft.ini...
AL lib: (II) GetConfigValue: Key disable-cpu-exts not found
AL lib: (II) FillCPUCaps: Detected max CPUID function: 0xd (ext. 0x80000008)
AL lib: (II) FillCPUCaps: Vendor ID: ""
AL lib: (II) FillCPUCaps: Name: "Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz"
AL lib: (II) FillCPUCaps: Extensions: +SSE +SSE2 +SSE3 +SSE4.1
AL lib: (II) GetConfigValue: Key rt-prio not found
AL lib: (II) GetConfigValue: Key resampler not found
AL lib: (II) GetConfigValue: Key trap-al-error not found
AL lib: (II) GetConfigValue: Key trap-alc-error not found
AL lib: (II) GetConfigValue: Key reverb/boost not found
AL lib: (II) GetConfigValue: Key drivers not found
AL lib: (II) ALCwasapiProxy_messageHandler: Starting message thread
AL lib: (II) ALCwasapiProxy_messageHandler: Message thread initialization complete
AL lib: (II) ALCwasapiProxy_messageHandler: Starting message loop
AL lib: (II) alc_initconfig: Initialized backend "wasapi"
AL lib: (II) alc_initconfig: Added "wasapi" for playback
AL lib: (II) alc_initconfig: Added "wasapi" for capture
AL lib: (II) GetConfigValue: Key excludefx not found
AL lib: (II) GetConfigValue: Key default-reverb not found
AL lib: (II) GetConfigValue: Key channels not found
AL lib: (II) GetConfigValue: Key sample-type not found
AL lib: (II) GetConfigValue: Key frequency not found
AL lib: (II) GetConfigValue: Key periods not found
AL lib: (II) GetConfigValue: Key period_size not found
AL lib: (II) GetConfigValue: Key sources not found
AL lib: (II) GetConfigValue: Key slots not found
AL lib: (II) GetConfigValue: Key sends not found
AL lib: (II) ALCwasapiProxy_messageHandler: Got message "Open Device" (0x0400, lparam=00000176856784F8, wparam=00000076531FF120)
AL lib: (II) GetConfigValue: Key ambi-format not found
AL lib: (II) alcOpenDevice: Created device 000001768BB05A50, "OpenAL Soft on Speakers (High Definition Audio Device)"
AL lib: (II) GetConfigValue: Key hrtf not found
AL lib: (II) UpdateDeviceParams: Pre-reset: Stereo, Float, 44100hz, 1024 update size x3
AL lib: (II) ALCwasapiProxy_messageHandler: Got message "Reset Device" (0x0401, lparam=00000176856784F8, wparam=00000076531FF020)
AL lib: (II) UpdateDeviceParams: Post-reset: Stereo, Float, 48000hz, 960 update size x3
AL lib: (II) GetConfigValue: Key stereo-mode not found
AL lib: (II) aluInitRenderer: HRTF disabled
AL lib: (II) GetConfigValue: Key cf_level not found
AL lib: (II) aluInitRenderer: BS2B disabled
AL lib: (II) GetConfigValue: Key stereo-encoding not found
AL lib: (II) aluInitRenderer: UHJ disabled
AL lib: (II) UpdateDeviceParams: Channel config, Dry: 2, FOA: 0, Real: 0
AL lib: (II) UpdateDeviceParams: Allocating 2 channels, 16384 bytes
AL lib: (II) UpdateDeviceParams: Max sources: 256 (255 + 1), effect slots: 64, sends: 2
AL lib: (II) GetConfigValue: Key dither not found
AL lib: (II) GetConfigValue: Key dither-depth not found
AL lib: (II) UpdateDeviceParams: Dithering disabled
AL lib: (II) GetConfigValue: Key output-limiter not found
AL lib: (II) UpdateDeviceParams: Output limiter enabled
AL lib: (II) UpdateDeviceParams: Fixed device latency: 1000000ns
AL lib: (II) ALCwasapiProxy_messageHandler: Got message "Start Device" (0x0402, lparam=00000176856784F8, wparam=00000076531FF020)
AL lib: (II) GetConfigValue: Key volume-adjust not found
AL lib: (II) alcCreateContext: Created context 00000176FF514110
Which to my mind looks like everything is good.
Cas :)
princec:
Also hampering my testing, I'm getting a ton of native crashes. It crashes 50% of the time, sometimes with a Hotspot error log, sometimes with bizarro VM corruption like being unable to find classes, sometimes just aborting without any explanation. I don't think this is related to the sound but it's hard to isolate. Here's an example:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffb7f52b9c3, pid=1292, tid=20772
#
# JRE version: OpenJDK Runtime Environment (11.0.1+13) (build 11.0.1+13-LTS)
# Java VM: OpenJDK 64-Bit Server VM (11.0.1+13-LTS, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C [CoreMessaging.dll+0xb9c3]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Projects\Battledroid\hs_err_pid1292.log
#
# If you would like to submit a bug report, please visit:
# http://www.azulsystems.com/support/
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Cas:)
princec:
FWIW the hotspot log referred to there contains this:
Command Line: -Djava.util.logging.config.file=C:\Projects\Resources\logging.properties -ea --illegal-access=permit -Xss1m -Djava.library.path=C:\Projects\Common11\lib\windows64;C:\Projects\Steam11\lib\windows -XX:MaxDirectMemorySize=1024m -Xmx1024m -Xms256m -XX:MaxGCPauseMillis=1 -Dorg.lwjgl.util.NoChecks=false -Dspgl3.game.Launcher.resources=resources-steam.dat -Dspgl3.game.Game.gameResource=game.steam -Dnet.puppygames.steam.Steam.DEBUG=true -Djava.util.logging.config.file=C:\Projects\Battledroid\src-client/logging.properties -Dnet.puppygames.common.threading.TaskGraphBuilder.check=truex -Dfile.encoding=Cp1252 spgl3.game.Launcher
Host: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz, 8 cores, 15G, Windows 10 , 64 bit Build 17134 (10.0.17134.556)
Time: Sat Feb 16 13:25:56 2019 GMT Standard Time elapsed time: 4 seconds (0d 0h 0m 4s)
--------------- T H R E A D ---------------
Current thread (0x00000210f6fcd800): JavaThread "main" [_thread_in_native, id=20772, stack(0x000000f809800000,0x000000f809900000)]
Stack: [0x000000f809800000,0x000000f809900000], sp=0x000000f8098fe630, free space=1017k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [CoreMessaging.dll+0xb9c3]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j org.lwjgl.system.JNI.invokeV(J)V+0
j org.lwjgl.glfw.GLFW.glfwPollEvents()V+8
j spgl3.game.Display.processMessages()V+6
j spgl3.game.Display.update()V+3
j bots.client.Splash$1.execute()V+54
j spgl3.opengl.AbstractRenderer.build()Lspgl3/sprites/GeometryData;+117
j spgl3.opengl.GLRenderer.render()V+1
j bots.client.Splash.update(II)V+385
j spgl3.game.Game.init(Ljava/util/Properties;Ljava/io/InputStream;)V+802
j spgl3.game.Launcher.main([Ljava/lang/String;)V+247
v ~StubRoutines::call_stub
siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x00007ffb00000050
Cas :)
Navigation
[0] Message Index
[#] Next page
Go to full version