LWJGL / lwjgl3

LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan, bgfx), audio (OpenAL, Opus), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR, OpenXR) applications.
https://www.lwjgl.org
BSD 3-Clause "New" or "Revised" License
4.67k stars 628 forks source link

`alcCaptureSamples()` causes a straight-up crash. #867

Closed Brahvim closed 1 year ago

Brahvim commented 1 year ago

Version

3.3.2 (nightly)

Platform

Windows x64

JDK

Eclipse Adoptium jdk-17.0.3.7-hotspot

Module

OpenAL

Bug description

Attempting to record audio with the OpenAL bindings causes the JVM to crash due to "an error in the native code". The "problematic frame" was at OpenAL.dll+0x99e73.

Stacktrace or crash log output

[ALSOFT] (II) Opening default capture device
[ALSOFT] (II) Capture format: Mono, UInt8, 44100hz, 1024 / 1024 buffer
[ALSOFT] (II) Got message "Open Device" (0x0000, this=0000021592D2E048, param=0000000000000000)
[ALSOFT] (II) Got message "Reset Device" (0x0001, this=0000021592D2E048, param=0000000000000000)
[ALSOFT] (II) Device capture format:
    FormatTag      = 0xfffe
    Channels       = 2
    SamplesPerSec  = 48000
    AvgBytesPerSec = 384000
    BlockAlign     = 8
    BitsPerSample  = 32
    Size           = 22
    Samples        = 32
    ChannelMask    = 0x3
    SubFormat      = {00000003-0000-0010-8000-00aa00389b71}
[ALSOFT] (II) Requesting capture format:
    FormatTag      = 0xfffe
    Channels       = 1
    SamplesPerSec  = 44100
    AvgBytesPerSec = 44100
    BlockAlign     = 1
    BitsPerSample  = 8
Brahvim commented 1 year ago

Hello there! It is hard to understand what exactly needs to be done to record audio in OpenAL in general (I tried writing C++ code to do it and experienced nearly the same issues).

Since this is not an issue with LWJGL, I'll close this issue.