Project

General

Profile

Bug #1118

[OpenAL] patch #27 revisited

Added by galt_gendo about 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
2013-04-07
% Done:

100%


Description

OK, let's start with a simple thing:
marking just the declarations with 'extern "C"' is not enough,
definitions must be marked too, otherwise plugin doesn't load (my patch was marking both).

Second, AL_INVALID_OPERATION:
I've chatted briefly with openal-soft upstream and he came up with a solution that seems to be working.
A few quotes:
"don't call alSourcei(srcName, AL_BUFFER, bufName); until after the buffer has been filled
I suspect you could avoid calling that in DS_SFX_CreateBuffer, and let DS_SFX_Play do it when it's ready to play"
"you don't need the buffer attached to the source until you go to actually play the source."
"if a buffer will only ever be attached to one source, then what you can do in DS_SFX_Load is call
alSourceStop(source);
alSourcei(source, AL_BUFFER, 0);
before alBufferData
DS_SFX_Play will then reattach the buffer before playing it"

After making those changes in the code, openal seems to work correctly ingame (there's an odd crash upon quiting (segfault after "Event loop exited with code 0." message) with hexen, doom seems fine though - go, figure). (The most annoying part of the crash is its heisenbug nature: if I try attaching gdb, I can't trigger the crash)

As the changes regarding AL_INVALID_OPERATION are more of an idea than a fully tested solution, I'm creating this as a bug, not a patch.

On a not quite related note: what's with "Z_ChangeTag: An owner is required for purgable blocks." flood while openal is not in use ?

Labels: OpenAL

Attachments:

History

#1 Updated by galt_gendo about 11 years ago

OK, correction on the first problem - I haven't read my own patch correctly.

It was not 'extern "C"' part that mattered, it was something more trivial and obvious.
device = alcOpenDevice((ALCchar*) "DirectSound3D");
can't really work outside Windows, Linux needs the standard
device = alcOpenDevice((ALCchar*) NULL);

The second part is unchanged.

#2 Updated by skyjake about 11 years ago

I have applied the changes recommended here and it seems to have sorted out the OpenAL errors. The fixes will be in 1.11.0.

Also, there was a thread-related issue in the engine's audio subsystem that likely was the cause for the random crash at shutdown.

#3 Updated by galt_gendo about 11 years ago

Thank you.

Now, if only doomsday could get a module for Strife...

vavoom has one, but that port went into "suspended animation" and when I recently tested it with gcc 4.8.1, the result was a broken build with either '-O' or '-O2' (without either it's still working). Can't really tell if it's a compiler bug or bad code.

#4 Updated by skyjake almost 11 years ago

- status: open --> fixed
- Milestone: v1.9.10 --> v1.11

#5 Updated by skyjake almost 11 years ago

- summary: patch #27 revisited --> [OpenAL] patch #27 revisited

#6 Updated by galt_gendo over 10 years ago

The first part is a bit odd though - fluidsynth doesn't need such markings to work...

#7 Updated by skyjake over 10 years ago

- labels: --> OpenAL
- assigned_to: Jaakko Keränen
- priority: 1 --> 5

Also available in: Atom PDF