Chris Robinson wrote:
Speaking of which, what should be done with all these LOKI extensions? I have
several concerns and questions I want to bring up.
Not surprising :-)
I offer my opinions and fuzzy recollections from the early days below.
I'd like to hear what some of the others think before we decide to do
anything permanent (at least Dan, Prakash, and Sven if he's listening).
What should be done with whatever extension exposes alBufferi_LOKI, given that
the mixer can't work with whatever the program can set (in fact, it'd only
allow setting of the channel count without immediately breaking anything). I
really don't think it'd be wise to complicate the mixer with dealing with
program-specified formats, especially given that the OpenAL spec seems to
imply the API is designed to keep internal data formatting hidden so it could
be made efficient (really important for software implementations, and when
dealing with hardware-specific stuff I'd imagine).
And OpenAL.org's extension list is missing pages for some extensions (for
Windows and OSX, mainly), so it's very difficult to discern what some of
these extensions are supposed to actually do, other than by looking at what it
currently does (which is quite possibly not correct, depending on changes to
the code base). The pages I have read have been relatively sparse on
information. The upkeep on these extensions will be very difficult without
sufficient documentation on what they're supposed to do. Some are obvious,
but others aren't.
At one point, there was a brief effort to collect all the extensions
that had been implemented (whether documented or not) into a single
location, with the hopes that they would all be properly and uniformly
documented eventually. Some have been done (the more popular ones in
particular), but as you've seen, most haven't. A bigger problem is that
many of the LOKI extensions in the SI were written in the early
(pre-1.0) days of OpenAL for specific purposes (often, for a specific
game) and never used again. These extensions I'd be for getting rid of,
as the games in question will have their own app-local copy of OpenAL
anyway (if they're even played anymore). I believe
LOKI_buffer_data_callback and friends fall into this set.
A couple such extensions I'm concerned with are AL_EXT_vorbis (which I've read
is discouraged, being that it's only available in the SI, along with
AL_LOKI_WAVE_format and AL_LOKI_IMA_ADPCM_format) and AL_LOKI_play_position
(which is missing documentation, but from what I can gather is superceded by
the *_OFFSET enums in 1.1?). As well, I don't see any extensions that include
the functions:
alutLoadMS_ADPCMData_LOKI, alutLoadRAW_ADPCMData_LOKI,
alGenStreamingBuffers_LOKI, alBombOnError_LOKI, alReverbScale_LOKI,
alReverbDelay_LOKI, alBufferi_LOKI, alBufferAppendData_LOKI,
alBufferWriteData_LOKI, and alBufferAppendWriteData_LOKI.
Some of those functions seem to be related to code that add significant
complexity and/or dead code (alReverb*, alGenStreamingBuffers_LOKI), and
others belonging to ALUT which is no longer part of the core lib.
Let's see, reverb only ever reached the early stages (I don't believe it
was ever used), and the "streaming buffers" API was superseded by buffer
queues, so anything related to these can probably go. The
callback-based extensions (including EXT_vorbis and EXT_MP3) probably
should be reimplemented to use queued buffers as a data source instead.
Furthermore, any function which has this for a comment:
* FIXME: this is the most horrible function ever. I can only
* claim responsibility for 50% of the hideous horror that
* is this function. Before you smite me to eternal damnation
* for the monstrosity that follows, please keep in mind that
* the remaining half of the horror belongs squarely on those
* who defined the semantics and side effects of this disgusting
* monster.
probably should at least be considered a candidate for removal :-)
Also, the extensions related to compressed formats seem to have several
issues. The first being that they apparently have implementation-specific
differences. AL_EXT_vorbis, LOKI_IMA_ADPCM_format, and such seem to have a
dependancy on AL_LOKI_buffer_data_callback.. which is only available on the
SI. So how is the multi-platform extension AL_EXT_MP3 (which lacks
documentation) supposed to be handled? One would assume the same as the
others, but given that the others depend on an extension not available to all
implementations AL_EXT_MP3 is on...
If you look in the extension registry, there is brief documentation for
EXT_MP3 that mentions that the LOKI_buffer_data_callback dependency only
applies to the Linux implementation. That said, I'm not sure EXT_MP3 is
supported by any platform anymore. I believe the main purpose of
EXT_MP3 (as well as EXT_IMA4, EXT_MULAW, EXT_ALAW, EXT_float32, etc,
etc) is to define the format tokens for various audio formats ahead of
time, in case someone wants to implement support for them. I don't
believe any of these extensions are meant to use anything but
alBufferData() as an entry point.
AL_LOKI_buffer_data_callback also has the problem of not being able to specify
the format of the incoming data (perhaps that's what alBufferi_LOKI is for? I
don't know, it's not mentioned in the spec for the extension). It basically
relies on the program providing the data in whatever format the canon format
is, which is a bit much to ask, IMO. It'd be much simpler (and more
efficient) for programs to just use buffer queues since that'd give them
format conversions, and not tie up the mixer processing.
Agreed. If we want to keep the compressed formats around, we probably
should rework them to use buffer queues instead of the callback
mechanism. If it's not worth it, we should think about dumping them
(there should be a discussion about the impact on old software before we
decide to remove anything).
I'm basically looking to drop what's either A) broken, B) redundant, or C)
unofficial. The more stuff I can get out, the easier it'll be to fix and make
room for new things (such as extensions from other platforms; get some
cross-platform compatibility going there).
Well, "unofficial" is hard to define, since there isn't really any
official authority anyway, but I agree at least in principle. We need
to make sure that we're not breaking anything that people are using, but
I doubt anyone is using the old LOKI extensions these days.
--
--"J"
"I'm a castaway stranded in a desolate land,
I can see the footprints in the virtual sand."
--Neil Peart
|