Commit Graph

100 Commits

Author SHA1 Message Date
Zack Middleton 615b73288f Use Opus for VoIP
Server/client VoIP protocol is handled by adding new cvars
cl_voipProtocol and sv_voipProtocol, sv_voip and cl_voip
are used to auto set/clear them. All users need to touch
are cl/sv_voip as 0 or 1 just like before.

Old Speex VoIP packets in demos are skipped.
New VoIP packets are skipped in demos if sv_voipProtocol
doesn't match cl_voipProtocol.

Notable difference between usage of speex and opus codecs,
when using Speex client would be sent 80ms at a time.
Using Opus, 60ms is sent at a time. This was changed because
the Opus codec supports encoding up to 60ms at a time.
(Simpler to send only one codec frame in a packet.)
2016-01-06 05:19:10 -06:00
Zack Middleton 4fb053b8e7 Fix incorrect strncpy in S_AL_StartBackgroundTrack
Error is loop argument is NULL.
Ensure that s_backgroundTrack is a null terminated string.
2015-02-05 04:37:26 -06:00
MAN-AT-ARMS a3653e475e Change default value for s_alDopplerSpeed 2014-09-09 13:03:29 -04:00
Tequila baca82d64e Bunch of comment fixes 2014-03-13 02:20:54 +01:00
MAN-AT-ARMS 89fab090d7 Fix s_alDopplerSpeed default value 2014-03-02 23:00:46 -06:00
MAN-AT-ARMS 6887a69064 Replace deprecated alDopplerVelocity with alSpeedOfSound per OpenAL 1.1 spec 2014-02-22 18:02:22 -06:00
Zack Middleton 36a4075a8d Try default OpenAL driver if user set one fails to load 2014-01-27 20:09:55 -06:00
Amanieu d'Antras efe8437cde Fix crash in OpenAL when no input devices are available 2013-12-10 16:40:28 -06:00
Zack Middleton 203ab7b9af Fix cinematics often being silent on OS X
If OpenAL source isn't playing, often what happens is: queued buffers is 0 and processed buffers is non-0.
S_AL_StreamUpdate won't play the steam if queued buffers 0.
So start the stream in S_AL_RawSamples.
2013-11-11 00:21:53 -06:00
Zack Middleton b3bd74fce7 Fix restoring loop sound position on OS X
The default OpenAL library on OS X errors AL_INVALID_VALUE for AL_SEC_OFFSET if source isn't playing.
2013-11-10 23:28:54 -06:00
Zack Middleton 5795be68f6 Make OpenAL buffer management work on OS X
Don't assume we have unlimited OpenAL buffers.
Detach buffers from sources by setting AL_BUFFER to 0. Cannot delete buffers on OS X immediately after alSourceUnqueueBuffers.
Free unprocessed stream and music buffers.
Free unused sfx buffers when sound file exists and fails loading into OpenAL (though I haven't seen it fail).
2013-11-10 22:55:35 -06:00
Zack Middleton a836c2db89 Drop sounds starting with * before allocating sfx slot
Causes handle 0 to be returned by S_RegisterSound.
2013-10-09 09:51:32 -05:00
Zack Middleton 3d69ae9995 Fix OpenAL music stop issues using stream stop code
S_AL_StopBackgroundTrack would sometimes generate AL errors.
S_AL_MusicSourceFree needs to kill source or next track may have short looping buffer.
2013-08-16 15:29:12 -05:00
Jonathan Gray 3234d2b141 dlopen libopenal.so not libopenal.so.1 on OpenBSD 2013-05-05 11:28:54 +10:00
Tim Angus 98360bcd57 Fix some of the things clang --analyze flagged 2013-03-26 16:50:03 +00:00
Tim Angus d201443350 Remove a few name tags 2013-02-16 21:03:56 +00:00
Zack Middleton 3da8779180 - Check for invalid filename in OpenAL's RegisterSound function.
- Changed Base sound system to warn not error when sound filename is empty or too long.
2012-11-19 00:40:03 +00:00
Zack Middleton 82f83cd092 Fix some "> MAX_*" to be ">= MAX_*". 2012-11-18 19:09:54 +00:00
Zack Middleton d49d0753eb When in third person, don't play player's sounds as full volume in Base sound system. OpenAL already does this. (Related to bug 5741.) 2012-10-17 20:39:45 +00:00
Zack Middleton ce9f2ee5f9 Check last listener number instead of clc.clientNum in S_AL_HearingThroughEntity so sound work correctly when spectate following a client. (Related to bug 5741.) 2012-10-17 19:30:41 +00:00
Zack Middleton f3e7012bdb REFACTOR [a vs an]
From /dev/humancontroller.
2012-06-18 16:31:16 +00:00
Thilo Schulz 23f6fd1633 Bug 5094 - Code cleanup, patch by Zack Middleton and DevHC. Fixes unused-but-set gcc warnings 2011-07-29 12:27:00 +00:00
Thilo Schulz 2349148cf1 - Apply parts of Ben Millwood's target bitfield patch (#3787)
- Fix Ryan's FIXME and have voip packet buffer on the server dynamically allocated via Z_Malloc and store pointers in a circular buffer
- Improve voip target parsing on top of Ben Millwood's patch
- Add new "spatial" target where speaker is spatialized in 3d space and can be heard by all clients in hearing range (s_alMaxDistance)
  (#4467)
- Decrease voip sound lengths from 240ms to 80ms per voip packet to mitigate udp packet loss and decrease latency
- Protocol version incremented to 71
2011-07-27 15:47:29 +00:00
Thilo Schulz 1972bf97db Fix client crash on windows with old OpenAL 2011-07-22 16:43:27 +00:00
Thilo Schulz 4c5e9963e3 Fix compile for USE_VOIP=0 2011-07-16 11:14:20 +00:00
Thilo Schulz a5f31084d4 - Fix memory leak in DMA sound after S_Shutdown()
- Make codec load use temp hunk memory instead of zone mem
- Fix sound issues with direct sound and game_restart (#4526)
2011-06-17 23:29:19 +00:00
Thilo Schulz c95bd0a684 Remove newlines from Com_Error message format strings, patch by DevHC 2011-05-12 14:02:48 +00:00
Thilo Schulz 379dfbf496 - Properly use ALC_ALL_DEVICES_SPECIFIER in sound info
- Properly use ALC_CAPTURE_DEVICE_SPECIFIER in sound info
2011-03-14 16:36:40 +00:00
Tim Angus e0eb1b4227 * Fix whitespace 2011-03-14 16:04:49 +00:00
Thilo Schulz 182b344818 - Remove alext.h dependency and manually add the required macros
- Use ALC_DEFAULT_ALL_DEVICES_SPECIFIER instead of ALC_DEFAULT_DEVICE_SPECIFIER if extension exists
2011-03-14 15:57:39 +00:00
Thilo Schulz bce3848523 Make buffers for device lists a bit longer. Just in case. 2011-03-11 13:53:22 +00:00
Thilo Schulz a3def2744f - Fix a compiler warning
- Fix the detection of the enumeration extensions
- Fix default device for s_alInputDevice
- Adjust formatting of S_AL_Info output
2011-03-09 23:34:15 +00:00
Thilo Schulz 7ca1dc6f8b - I accidentally committed patch by slacker from (#4915) in r1916. Patch adds input device selection support
- Add check for ALC_ENUMERATE_ALL_EXT before using ALC_ALL_DEVICES_SPECIFIER in device enumeration
- Patch readme for new cvars by Zack Middleton
2011-03-09 12:59:25 +00:00
Thilo Schulz 8c3f320504 (#3767) Some protection from malicious qvms - patches and ideas by Amanieu d'Antras and Ben Millwood 2011-03-08 01:39:34 +00:00
Zachary Slater 275d3b45b5 Patch from /dev/humancontroller (thx) 2011-01-27 07:00:35 +00:00
Thilo Schulz eb2860f756 Fix "unhandles OpenAL error", and sound fallback behaviour for model files. Thanks Ansa89 for reporting, and Zack Middleton for the patch. 2010-08-29 18:11:15 +00:00
Thilo Schulz 2a0812bc06 Mute sounds with 0 volume when game is minimized/unfocused instead of Stopping all sounds. Fixes (#4336) 2009-11-10 01:08:15 +00:00
Thilo Schulz e345f9f81f New batch of fixes for the OpenAL part:
- Don't play sources outside the listening range (Thanks Kpaxian for bringing this to my attention)                                                         
 - Handle previously unhandled errors for old OpenAL sample implementation which does not support AL_SEC_OFFSET (sounds won't be synchronized then),
   thanks to Tequila from SmokingGuns for reporting this.
2009-10-27 11:13:33 +00:00
Thilo Schulz 0ecfcfa872 Make not playing loop sources weaker in priority, so if we have reached the maximum number of sources, inaudible loops are removed first. 2009-10-26 23:20:05 +00:00
Thilo Schulz 0adae90465 Fix another issue I didn't know about: cgame does not kill sound loops it startet, just stops sending the entity information for these loops. Changed it so that loops added with AddLoopingsound() are being killed again as soon as the entity to the source is not sent anymore. 2009-10-26 05:02:18 +00:00
Thilo Schulz 3c501df298 A few more last fixes that will handle some special cases 2009-10-24 08:33:12 +00:00
Thilo Schulz 1ea420e8a8 Better stop than just pause. 2009-10-23 23:51:00 +00:00
Thilo Schulz 898f1ed2f7 Don't kill sources out of range, just pause them. Make sure the listener gets the impression sources have been continuing to run in the background. 2009-10-23 23:32:52 +00:00
Thilo Schulz 465c6101e0 remove redundancy 2009-10-23 12:30:00 +00:00
Thilo Schulz d12751f62b Synchronize looping ambient sounds (#2984) 2009-10-23 12:18:49 +00:00
Thilo Schulz 290f51e353 - Change default openal lib to libopenal.so.1
- USE_OPENAL_DLOPEN=1 now default
2009-10-13 15:39:39 +00:00
Thilo Schulz fc539dc46a Improve OpenAL error handling, patch by Ben Millwood. https://bugzilla.icculus.org/show_bug.cgi?id=3776 2009-10-13 15:23:17 +00:00
Ludwig Nussel b35c63f37a don't modify s_alDevice and add fallback to let openAL choose the device 2009-05-08 09:13:06 +00:00
Ludwig Nussel de19303320 mark s_alDriver CVAR_LATCH 2009-05-08 09:13:03 +00:00
Tim Angus 53adde9fb2 * Fix leaking OpenAL buffers (Amanieu) 2009-03-15 12:39:53 +00:00