Commit Graph

445 Commits

Author SHA1 Message Date
af8a7b5be0 [*] Merge remote-tracking branch 'github/master'
[*] Updated synch primitives
2023-03-29 12:07:38 +01:00
Chris Robinson
ac01cbf7a5 Log the buffer format when queueing mismatched buffers 2023-03-22 23:21:01 -07:00
Chris Robinson
d4bfb62591 Remove the separate UserFmt types
All caller-usable formats are available as core formats now, so there's no
reason to distinguish between them.
2023-03-19 19:03:35 -07:00
Chris Robinson
f53b31b2c1 Simplify some samples-to-bytes conversions 2023-03-19 17:29:13 -07:00
Chris Robinson
186a29b77d Add a compat option to restore AL_SOFT_buffer_sub_data 2023-03-17 08:39:18 -07:00
Chris Robinson
24508c3901 Rename some member functions and variables for consistency 2023-03-16 04:56:08 -07:00
Chris Robinson
ef5373611f Commit deferred EAX properties in alcProcessContext 2023-03-16 02:46:19 -07:00
Chris Robinson
ff620411a7 Fix the format check for queueing buffers 2023-03-15 00:59:24 -07:00
Chris Robinson
4c89d76ec3 Set a default version for EAX source properties 2023-03-14 16:53:43 -07:00
Chris Robinson
9fd9fee35c Don't allow queueing a buffer with no format 2023-03-12 15:13:18 -07:00
Chris Robinson
c7da1696a4 Rename some class members for styling consistency 2023-03-11 21:48:34 -08:00
Chris Robinson
e7610b90da Check the correct ID value for clearing the deferred flag
property_id is the original value with the deferred flag in the msb. If the
call is deferred, that flag is set, preventing it from matching any of the
enums. The property_id_ member has the ID without the flag.
2023-03-11 20:55:38 -08:00
Chris Robinson
20ab7645fb Don't set a default EAX version for fx slots 2023-03-11 19:21:19 -08:00
Chris Robinson
a9319a794b Update the EAX version after setting fx slot properties 2023-03-11 18:43:17 -08:00
Chris Robinson
3f45b3c0c9 Avoid copying to a temporary 2023-03-11 18:15:59 -08:00
Chris Robinson
368b3db4eb Remove some more unnecessary clamps 2023-03-11 17:10:12 -08:00
Chris Robinson
167feb35c6 Remove an unused function 2023-03-11 17:04:38 -08:00
Chris Robinson
86d4a77e62 Rename some struct members for clarity 2023-03-11 17:03:51 -08:00
Chris Robinson
028e7eff52 Convert the remaining EAX effects 2023-03-11 16:24:01 -08:00
Chris Robinson
96b3d98ac3 Simplify committing EAX effect properties
There's no need to explicitly clamp to EFX limits when they're the same as or
more lenient than EAX, which were already validated when set, or when it's
within tolerance of the effect implementation.

Also it's generally better to check once all properties for changes and apply
them all if one is different, rather than checking and setting each member
individually.
2023-03-11 15:03:18 -08:00
Chris Robinson
0bda22af10 Convert the EAX Frequency Shifter effect 2023-03-11 14:19:00 -08:00
Chris Robinson
1e226fd54d Don't commit EAX updates in applyAllUpdates
To avoid alcProcessContext causing deferred EAX properties to be committed.
This simplifies updates when EAX has been initialized, but never or rarely
used.

Committing now always occurs in EAXSet when the property is non-deferred,
updating the OpenAL object(s) with it (with OpenAL's updates then being applied
based on the context's defer state).
2023-03-11 12:16:32 -08:00
Chris Robinson
64ead7d36d Convert the EAX Echo and Equalizer effects 2023-03-11 00:47:22 -08:00
Chris Robinson
1d112eee0f Convert the EAX Autowah and Compressor effects 2023-03-11 00:16:32 -08:00
Chris Robinson
f85bf6fd98 Convert the EAX Compressor effect
And combine some type checks.
2023-03-10 23:39:39 -08:00
Chris Robinson
c9bedb1a4c Convert EAX chorus and flanger effects 2023-03-10 23:03:07 -08:00
Chris Robinson
8c3948c4de Rework EAX effect handling
Allocate a base EaxEffect object once for all effect types, instead of
reallocating different derived types on effect changes. The reverb and null
effects have been converted to the new interface, the others are currently
broken/unsupported, but will be restored shortly.
2023-03-10 19:58:45 -08:00
Chris Robinson
605fa78159 Update the effect EAX version only after setting a property 2023-03-09 21:46:39 -08:00
Chris Robinson
f7d051fb78 Have the null effect inherit from EaxEffect4 2023-03-09 21:37:13 -08:00
Chris Robinson
1ea8f7a9a1 Add a type indicator to EaxEffectProps 2023-03-09 21:29:53 -08:00
Chris Robinson
5b3c27ea58 Store the per-version EAX effect state in the base class
This is the start of the refactoring for holding separable per-version EAX
effects. Currently the effect state is stored in the effect object, which is
instantiated per-type. This makes it impossible for different effects to be
assigned on different EAX versions for a given effect slot (e.g. if the app
sets a Chorus effect on EAX4 Slot0, it would fail to get or set the EAX1/2/3
reverb properties since it's a Chorus effect object).

Seperate per-version effects will allow for switching the OpenAL effect by
switching versions. This will provide an extra benefit in being able to delay
OpenAL effect initialization until some EAX version has been set, avoiding an
extraneous reverb and/or chorus processor for apps that only query some EAX
properties but don't set anything (or which only use Slot0, leaving Slot1 with
a defaulted Chorus effect running).
2023-03-09 19:58:42 -08:00
Chris Robinson
8697789797 Support aLaw samples for UHJ 2023-03-07 22:53:58 -08:00
Chris Robinson
e4b205414c Don't use "hardware" for automatic buffer storage 2023-03-07 21:35:14 -08:00
Chris Robinson
a1bd8875ae Avoid duplicate parameter validation 2023-03-07 17:27:21 -08:00
Chris Robinson
ed6b8230bd Add queries for the buffer byte/sample/sec length
These used to exist with the now-defunct AL_SOFT_buffer_samples extension, this
just restores those queries without extra baggage.

The sample length query are necessary when handling ADPCM buffers, since the
size/channels*8/bits calculation is incorrect with ADPCM. 'Bits' is usually
reported as 4 since most samples in a block are stored as nibbles, but that's
only approximate and doesn't account for the block header. The average number
of bits per sample in an ADPCM block can't be represented as an integer, so the
more blocks there are stored in the buffer, the more inaccurate the calculation
becomes.
2023-03-07 13:30:15 -08:00
Chris Robinson
f11313c62d Don't assume the max property size unchecked for user pointers 2023-03-06 14:32:01 -08:00
Chris Robinson
3184ab5d67 Don't get the front element of an empty queue 2023-03-05 23:27:55 -08:00
Chris Robinson
1e5af1eb2f Report the current buffer ID of a streaming source
The AL_BUFFER query should only return the buffer that was set on a static
source, but some apps used it to detect when a current buffer of a streaming
source changed instead of AL_BUFFERS_PROCESSED.
2023-03-05 18:45:17 -08:00
Chris Robinson
fde74453a6 Use macros for the likely/unlikely attributes
The syntax parser for GCC 8 (and earlier?) fails when these attributes are in
certain places.
2023-03-01 11:35:39 -08:00
Chris Robinson
ec9c421d31 Remove another gratuitous [[likely]] 2023-02-28 21:33:22 -08:00
Chris Robinson
0b700286bd Add formats for UHJ with muLaw, and ADPCM for 2-channel UHJ
ADPCM doesn't seem to be well defined for more than two channels, even though
there doesn't seem to be any issue with simply increasing the channel step over
interleaved data (ffmpeg refuses to create IMA4 or MSADPCM files with more than
two channels, and its decoder behaves oddly different when channels > 2). So
IMA4 and MSADPCM can only safely handle 2-channel UHJ.

There's no problem with muLaw supporting 2-, 3-, or 4-channel UHJ though.
2023-02-26 01:38:46 -08:00
Chris Robinson
d66107e9f0 Don't start with fading for negative offsets 2023-02-18 17:27:19 -08:00
Chris Robinson
9f49f6cab0 Track the callback buffer base separately
Instead of recalculating it all the time, even for sources that don't use
callback buffers.
2023-02-18 17:16:00 -08:00
Chris Robinson
3e26402762 Set the proper block align for callback buffers 2023-02-16 17:27:25 -08:00
Chris Robinson
6ca1af8d5d Remove unused decoder functions 2023-02-14 10:08:34 -08:00
Chris Robinson
1b3c8f606c Don't convert MS ADPCM on load 2023-02-14 09:06:50 -08:00
Chris Robinson
5c8855b9a1 Support MSADPCM samples in the mixer 2023-02-14 08:39:30 -08:00
Chris Robinson
a84efdc459 Don't convert IMA4 samples on load 2023-02-14 07:56:52 -08:00
Chris Robinson
d0c28c652f Support IMA4 ADPCM as a mixing voice format 2023-02-14 02:32:07 -08:00
Chris Robinson
63f840d31f Separate decoding and mixing from resampling 2023-02-12 03:15:40 -08:00