35 Commits

Author SHA1 Message Date
rdb
17bf50f1e8 audio: get_sound and uncache_sound should take Filename, not string 2018-09-02 20:55:58 +02:00
Sam Edwards
b2bfb31114 general: Remove using std::* from headers
Also remove most `using namespace std;` statements. The only one that remains is in py_panda.h.

Closes #350
Closes #335
2018-06-14 16:04:49 +02:00
Sam Edwards
e2b4353800 general: Replace NULL (and 0 as pointer) with C++11 nullptr
Exceptions to this replacement are:
- .c files
- Headers included by a .c file
- stb_image.h
- dr_flac.h
- Strings
- Comments
2018-06-03 16:35:13 -06:00
Sam Edwards
52e7c952b3 putil: Rename config_util to config_putil 2018-05-14 02:36:42 -06:00
Sam Edwards
99dc462174 openal: assert -> nassert 2018-03-06 19:02:05 -07:00
Sam Edwards
c89bb3d030 openal: "reattempt" -> "retry" 2018-03-06 19:02:05 -07:00
Sam Edwards
6ca0a68042 openal: Retry deleting a buffer until success
The rationale for this change is Apple's OpenAL implementation,
which needs a little time after the
`alSourcei(source, AL_BUFFER, 0);`
call before any buffers used by that source are free for deletion.

The defaults in the config variables are such that the OpenAL manager
will attempt to delete a buffer up to 6 times (that is, the original
attempt plus 5 reattempts), with delays of 1ms, 2ms, 4ms, 8ms, and 16ms
before each reattempt - which means it'll wait a grand total of 31ms for
a buffer to be free before assuming that some even greater problem must
be happening and giving up.
2018-03-06 19:02:05 -07:00
Sam Edwards
f970bc3229 openal: Don't return OpenALAudioSounds that fail to initialize
Also don't register them in _all_sounds, where they won't remove themselves
due to having already called cleanup() on themselves.

Additionally stops a sound in a cleaned-up state from being passed to the
app and played.
2018-02-20 00:55:49 -07:00
Sam Edwards
8a7b47d501 audio: Fix memory leak in OpenAL 2018-02-04 23:06:34 -07:00
rdb
4cd826e63a Merge branch 'fix-audio-distance-factor' of github.com:nikolmiv/panda3d
Closes: #13
2017-10-31 19:31:27 +01:00
rdb
4ed199cece Fix various compile warnings and a few code consistency issues 2017-01-09 20:36:53 +01:00
rdb
18874fa151 Replace PN_int/uint types with stdint.h types, since all compilers we support have them.
Plus, we already had code that relied on them being available anyway.
2016-05-11 00:27:58 +02:00
tobspr
0fcfb8e372 New file headers, new comment style 2016-02-17 17:47:48 +01:00
rdb
090e912ce6 Cleanup of comments and whitespace 2016-02-01 22:30:43 +01:00
rdb
a98d50cd61 Fix for older OpenAL versions 2015-11-23 16:33:16 +01:00
rdb
f84b9e1f63 More reliable OpenAL device selection mechanism, add fallbacks, prefer "OpenAL Soft" over "Generic Software" 2015-11-23 16:17:44 +01:00
Ed Swartz
4916aaca54 Add 'openal-device' configuration variable for selecting OpenAL device 2015-08-11 09:29:26 -05:00
rdb
82b3268786 Prevent crash when OpenAL device creation fails 2015-04-01 02:55:20 +02:00
Nikola Milentijevic
c0b2468b04 Consolidate distance factor for 3D audio
The semantics of distance factor is now same for both OpenAL and Fmod.
The value is given in units per meter, and the default is 1.0.
This means that Panda units are understood to be meters by default.
For example, for feet one would have to set this value to 3.28.
2015-03-16 22:24:29 +01:00
rdb
936fa653b0 Remove unneeded HAVE_ flags from dtool_config.h generation 2015-01-04 20:34:59 +01:00
rdb
5aa773b41a remove fmod speaker modes that aren't supported across versions 2013-09-16 10:18:26 +00:00
David Rose
17611c2d20 protecting openal against multithreaded access too 2011-11-08 01:44:33 +00:00
David Rose
501470169f stdfloat_double 2011-10-10 05:25:10 +00:00
treeform
d5ebb58874 Added more debug messages to openAL audio manager for closing it.
We use resent OpenAL-soft in the distribution (1.12 or more instead of 1.8)

There is this bug:
OpenAl soft some times selects ALSA software
ALSO software some times has a bug working with pulse audio
So we need to make sure OpenAL uses pulse audio directoly, then it works.

KittCat (openAL soft author):
well, more like worked around it. but it's not something I can fix in openal soft
I've gone over the code several times and had other people comment on it. alsa just enables mmap when using the pulse plugin even though the plugin doesn't support it
using the pulse api directly (or disable using mmap with alsa) gets around the problem, though
2010-04-03 07:26:00 +00:00
treeform
d5071f89b6 I have added the debug output for AL_RENDERE AL_VENDER and AL_VERSION when starting openAL 2010-04-03 06:08:56 +00:00
David Rose
179b578a64 use explicit initialization of audio library 2009-02-23 19:57:13 +00:00
David Rose
bcdab6f3d4 remove texture_path, sound_path, egg_path 2008-11-04 18:25:21 +00:00
David Rose
fb9c56432a we are now using the modified BSD license 2008-05-28 18:37:20 +00:00
Josh Yelon
4a474bfb13 Fixed several memory management bugs, and added streaming control 2008-04-24 01:59:04 +00:00
Josh Yelon
03715468ca Improvements to audio and creation of UserDataAudio 2008-03-31 05:51:11 +00:00
Josh Yelon
1ec5c0380d Fixed excessive use of make_current 2007-09-01 03:37:09 +00:00
Josh Yelon
725986da59 OpenAL includes are supposed to be in AL/* 2007-08-29 21:09:56 +00:00
Josh Yelon
a89589033b More improvements and bugfixes 2007-08-28 16:28:41 +00:00
Josh Yelon
40879d8def More work on OpenAL 2007-08-22 17:28:34 +00:00
Josh Yelon
1e02c06517 Major refactoring of movie code. 2007-08-20 22:34:58 +00:00