Commit graph

2258 commits

Author SHA1 Message Date
David Kelly
c1feac971b CR feedback 2016-11-01 15:17:07 -07:00
David Kelly
0b80610e65 Needed to properly remove hrtfs for avatar audio 2016-11-01 15:09:14 -07:00
David Kelly
404c08b0c7 Un-do of previous commit
Seems to add an artifact when using our test scripts.  Will work on that
as a separate issue, as it would be an existing issue in any case.
2016-11-01 10:46:22 -07:00
David Kelly
fb2968a419 Reset bytes sent counter when setting avatar sound
It could be past the end of the buffer if you changed sounds, and the
new one is shorter.  Won't happen with our current tests, but that could
change, and in general no reason it couldn't happen.
2016-11-01 09:12:35 -07:00
David Kelly
5714063eff Make more reliable
Need to be sure we don't change the _isAvatar or
_isListeningToAudioStream from one thread while processing audio in
another.  Also, fixed issue sending NLPacketList.
2016-10-31 16:38:01 -07:00
David Kelly
e63e9bc017 Remove HRTFs for Avatar too
Turns out there was already a function for that, if you just call
removeHRTFForStream without a 2nd param, it appears to just delete
the audio with uuid of QUuid() which is the avatar's mic.  That is
what we want, so cool.
2016-10-31 13:25:22 -07:00
David Kelly
80e38c395e Send KillAvatar to AudioMixer too
So it can remove the listening agent avatar audio streams.  Otherwise
they stick around forever, and eventually swamp the audio mixer.
2016-10-31 10:35:16 -07:00
David Kelly
e3a22618d1 CR feedback 2016-10-27 17:49:43 -07:00
David Kelly
52a14bf5c3 Merge branch 'master' of github.com:highfidelity/hifi into dk/moreACAudioArtifacts 2016-10-27 16:52:25 -07:00
David Kelly
292dd67433 cleanup 2016-10-27 16:04:30 -07:00
Howard Stearns
d2b83b47ba Merge pull request #8936 from zzmp/clean/audio-mixer
clean audio mixer
2016-10-27 15:57:16 -07:00
David Kelly
5e4f539144 AudioMixer flushes now
And protected agent from case with no codec
2016-10-27 14:46:04 -07:00
Zach Pomerantz
a7d54b8e0a rm unused lastCutoffRatio 2016-10-27 14:38:17 -07:00
Zach Pomerantz
c14a928db5 convert size_t to int 2016-10-27 14:34:10 -07:00
David Kelly
d00a73dde1 Play the flushed encoder sound at end
Basically 0-padding the end of the sound buffer.  Next do that in
AudioMixer and we should be good.
2016-10-27 14:27:15 -07:00
Zach Pomerantz
32040a9047 add stat for streams in audio mixer 2016-10-27 13:55:17 -07:00
Zach Pomerantz
68f05bee87 fix underflow for agent audio timer 2016-10-27 13:47:22 -07:00
Zach Pomerantz
20bac5aeef clean up broadcastMixes 2016-10-27 13:47:00 -07:00
Zach Pomerantz
9e9f8666ce clean up handleMismatchAudioFormat comment 2016-10-27 13:46:53 -07:00
Zach Pomerantz
04e5d8e302 initialize audio client data 2016-10-27 13:46:42 -07:00
Zach Pomerantz
3e16dabb75 fix audio mixer throttling 2016-10-27 13:46:33 -07:00
David Kelly
6a61762659 First try
AudioMixer has same issue transitioning from silence to encoded
audio and back, it seems.  This makes that go away, but I don't
like it.  Better to support a flush function in the encoder but
for now lets do this and be sure it is the entire issue.
2016-10-26 17:41:34 -07:00
David Kelly
b09364c288 whitespace 2016-10-25 12:22:26 -07:00
David Kelly
30d8f1967c Flushing encoder
Seems they have some state.  So if you play a sound, then silence
that doesn't go through the encoder (SilentAudioFrame), then a
sound again, you will hear a click.  Now, I just pop a frame of
0s through the encoder at the end of each .wav it plays.  Poof!
2016-10-25 12:15:48 -07:00
David Kelly
86e01bbae6 First cut
Started with the horrible screaming when avatar goes away, seems
due to not putting a codec string in the packets.  This was an existing
issue, not due to recent changes.  Also, some weird indenting was
fixed, etc...  Still hear an artifact when audio starts, but only when
a codec was negotiated.  Hoping to fix that too.
2016-10-24 15:18:29 -07:00
David Kelly
bdcb58bf8b Merge pull request #8847 from sethalves/fix-audio-mixer-data-race-1
fix some data-races in logging system
2016-10-21 15:33:40 -07:00
Seth Alves
5660063702 code review 2016-10-21 11:05:50 -07:00
Seth Alves
5af8dfdfbd move ScriptEngines to Agent 2016-10-21 10:57:58 -07:00
Seth Alves
30f29d1796 move ScriptEngines to Agent 2016-10-21 10:57:22 -07:00
Seth Alves
e988941d14 undo bad script-engine AC change 2016-10-21 10:53:13 -07:00
Clément Brisset
b63eb6ba9f Merge pull request #8665 from zzmp/feat/audio-stats
move audio stats to QML/JS, with graphs
2016-10-20 16:43:49 -07:00
Seth Alves
8ac799ddaf Merge branch 'master' of github.com:highfidelity/hifi into fix-audio-mixer-data-race-1 2016-10-20 10:02:58 -07:00
Chris Collins
98e7d6d0eb Merge pull request #8843 from sethalves/fix-audio-mixer-data-race-0
Fix some audio mixer data races
2016-10-20 10:01:26 -07:00
Stephen Birarda
eb8f67b612 cleanup asset file regex, comment in renameMapping 2016-10-19 11:47:57 -07:00
Stephen Birarda
7aac2e6916 restrict asset file mapping operations to file path 2016-10-19 10:57:23 -07:00
Seth Alves
af5be8d1d9 reduce data-races in logging 2016-10-18 15:59:00 -07:00
Seth Alves
9cb4756fce only ScriptEngines for agent ACs 2016-10-18 13:57:30 -07:00
Seth Alves
0c6dedff45 avoid various data-races related to stats collection and delivery 2016-10-18 13:05:53 -07:00
Seth Alves
1203aae96b don't create ScriptEngines for ACs that don't need them 2016-10-18 10:29:09 -07:00
howard-stearns
055e2ffcb0 Merge branch 'master' of https://github.com/highfidelity/hifi into crowd-animation 2016-10-12 14:38:07 -07:00
Atlante45
36bd9ef4e6 Update new ACClientApp code 2016-10-12 14:02:05 -07:00
David Kelly
c8850a8b8e PR feedback
AgentAvatarTimer now in its own files.  The thread still is created
the same way, and started only when you are an avatar, but now I
remember to stop it when you no longer are one.  Audio is still at
100Hz, but avatar messages go at 60Hz as before.  Unsure it matters,
but easy to do.   Looking at that buzz now.
2016-10-12 12:44:24 -07:00
Atlante45
eaca3b672f Switch to JSON for application settings 2016-10-12 10:20:19 -07:00
howard-stearns
884d22a59b make agent avatar animations work again, and use them in crowds 2016-10-11 16:06:55 -07:00
David Kelly
1fb7b42f0b One more comment removed 2016-10-11 09:37:42 -07:00
David Kelly
ef844cbd00 Cleanup artifacts
Seems playAvatarSound could be called from a thread other than
the Agent's thread.  So, artifacts happen when that pointer changes
while a 'tick' is happening.  Also cleaned up code a bit, got rid
of some hard-coded stuff I had in just for dev purposes.
2016-10-11 09:33:55 -07:00
David Kelly
fa9c3951c7 Merge branch 'master' into dk/codecInAgentAvatar 2016-10-10 19:51:56 -07:00
David Kelly
b58c36cb12 Rolling my own 100hz timer
Starting with the simplest possible thing - just sleep for 10000
microseconds.  Can make it adaptive if need be.
2016-10-10 17:57:04 -07:00
David Kelly
b4c064a538 Hack in a 100hz timer
sounds crappy, more to do, just push to not lose anything.

<squash this>
2016-10-07 13:20:08 -07:00
David Kelly
ab6ccac631 Merge pull request #8741 from howard-stearns/kill-agents
kill agents in avatar mixer when they stop being avatars
2016-10-07 09:16:49 -07:00
David Kelly
95aa18f66d Some cleanup
unnecessary stuff removed, added some cleanup code.
2016-10-06 16:18:22 -07:00
Chris Collins
8310a9fe8a Merge pull request #8730 from huffman/feat/script-req-retry
Add retrying of script requests
2016-10-06 16:09:04 -07:00
David Kelly
a0c731a0c6 Initial attempt
Kinda works, but sounds 'scratchy'.  Surely I've done something
lame.
2016-10-06 14:57:40 -07:00
howard-stearns
dc7a9f253c kill agents in avatar mixer when they stop being avatars 2016-10-05 13:06:11 -07:00
Zach Pomerantz
5af95c6062 store channels on audio stream 2016-10-05 12:04:24 -07:00
Ryan Huffman
9dfa3e4a17 Move ScriptCache from AssignmentClient to Agent 2016-10-04 16:43:14 -07:00
Ryan Huffman
ae507c4609 Add ScriptCache to assignment clients 2016-10-04 16:43:14 -07:00
Clément Brisset
becee3bba3 Merge pull request #8685 from thoys/ac-fixes
Assignment Client fixes
2016-09-30 11:05:58 -07:00
Zach Pomerantz
43c40aa090 avoid repetition with fade on injectors 2016-09-29 15:25:41 -07:00
Thijs Wenker
7e3073e163 fix spelling bugs 2016-09-29 22:13:27 +02:00
Zach Pomerantz
055fabf57b fix audio AppendFlag semantics 2016-09-26 18:51:51 -07:00
Zach Pomerantz
d3132d8746 denote terminal audio stats packet 2016-09-26 16:50:51 -07:00
Zach Pomerantz
b9c4018b8e expose AudioStats to qml/js 2016-09-26 15:35:29 -07:00
Zach Pomerantz
a9318d052b Merge branch 'master' of github.com:highfidelity/hifi into clean/audio-config 2016-09-23 13:11:52 -07:00
Brad Davis
09a218b9fd Fix build after moving network function 2016-09-23 12:05:04 -07:00
Zach Pomerantz
562e8e0c65 disable excessive audio settings logging 2016-09-23 11:58:02 -07:00
Zach Pomerantz
e2ff738fc3 strip unused audio settings
- remove parameters on the jitter buffer algorithm, these are now static
- remove parameters on the output starve detection algorithm, now static
- move interface audio settings to the Developer menu
2016-09-21 17:35:27 -07:00
Zach Pomerantz
177466e4c7 calculate unplayed ms on all streams/buffers as max 2016-09-15 17:54:41 -07:00
SamGondelman
544606bccc cmake fix 2016-09-06 17:40:44 -07:00
SamGondelman
74e5814a48 try to fix rpath issue 2016-09-06 17:40:43 -07:00
Seth Alves
b7da72cc46 try again on fix for ACs seeing other avatars 2016-09-02 16:06:51 -07:00
Seth Alves
b6ef6fec73 Revert "fill in linked node data for avatar identity packets, also" 2016-09-02 15:43:25 -07:00
Seth Alves
014190a1bf fill in linked node data for avatar identity packets, also 2016-09-02 13:52:37 -07:00
Brad Hefta-Gaub
376756d413 include the codec name in the agent avatar audio stream 2016-08-25 09:58:36 -07:00
Seth Alves
9bcda1bb45 merge from upstream 2016-08-20 15:25:04 -07:00
Seth Alves
87dbfa7e47 add -Wsuggest-override to compile flags and deal with fallout 2016-08-18 09:51:41 -07:00
Ryan Huffman
727d59ab27 Add backup directory setting to domain server 2016-08-16 17:33:32 -07:00
Brad Hefta-Gaub
7cbc0bcabe Merge pull request #8366 from kencooke/master
optimized distance-attnuation calculation
2016-08-05 16:45:35 -07:00
Ken Cooke
7629e34586 optimized distance-attnuation calculation 2016-08-04 11:05:34 -07:00
Brad Hefta-Gaub
ca3a194454 implment coded renegotiation in client if for some reason unexpected audio codecs come in to inbound stream 2016-08-02 15:30:03 -07:00
Brad Hefta-Gaub
c6ffd81c4b some cleanup 2016-07-18 22:42:38 -07:00
Brad Hefta-Gaub
2e63aba8c9 when getting unexpected codec in the mixer, send a message to the client to select a different codec 2016-07-18 22:29:05 -07:00
Brad Hefta-Gaub
20824f038c include codec in audio stream packets so that each side can discard packets that don't match 2016-07-18 21:59:44 -07:00
Brad Hefta-Gaub
dc2741950a Merge pull request #8259 from kencooke/improved-hrtf
Fix the AudioMixer distance attenuation.
2016-07-15 22:36:51 -07:00
Ken Cooke
59ac2a789f Fix the AudioMixer distance attenuation.
The zone settings are still used, and still match the documentation where 0 = no attenuation and 1 = max attenuation.  The default is now 0.5 which corresponds to -6dB per doubling of distance. This is the attenuation for a spherical wave in the free field.
2016-07-15 18:07:19 -07:00
Brad Davis
846c2457a3 Merge pull request #8236 from huffman/fix/atp-reliable
Update all asset server responses to be reliable
2016-07-15 10:33:11 -07:00
Ken Cooke
7a4bdc1779 enable in Interface and AudioMixer, by passing distance between source and listener 2016-07-14 11:30:55 -07:00
Ken Cooke
d7399f5781 Improved HRTF.
Adds a distance filter to model the frequency-dependent attenuation of sound propagation in open air.
Optimized using SIMD and computing all biquads in parallel. Performance impact is almost zero.
Filter updates are continuously interpolated and clean to -90dB.

Not enabled yet (distance hardcoded to 0.0f)
2016-07-14 10:34:42 -07:00
Stephen Birarda
b68958317a re-send ignore requests when mixers are re-added 2016-07-13 15:06:31 -07:00
Stephen Birarda
6b6513d5f9 immediately fade out ignored avatars 2016-07-13 15:06:31 -07:00
Stephen Birarda
095bd7e6c8 cleanup logging, move packet parsing to mixers 2016-07-13 15:06:31 -07:00
Stephen Birarda
a134ac72de add packet type and plumbing for node ignore 2016-07-13 15:06:31 -07:00
Ryan Huffman
b4b7b7ea34 Update all asset server responses to be reliable 2016-07-13 13:41:45 -07:00
Brad Hefta-Gaub
6d7c8d5759 fix crash in audio-mixer if no plugins installed 2016-07-12 16:11:43 -07:00
Brad Hefta-Gaub
71b6210c4e removed some log spam 2016-07-12 10:18:37 -07:00
Brad Hefta-Gaub
7d608ba592 groundwork for injector support 2016-07-10 21:01:20 -07:00
Brad Hefta-Gaub
ed9715ae5f some cleanup, proper memory allocation/deallocation 2016-07-10 17:40:58 -07:00
Brad Hefta-Gaub
ba6bb24595 rework plugins to allow different decoder/encoder instances per streams 2016-07-10 16:49:03 -07:00
Brad Hefta-Gaub
a71baf5601 handle codec prioritization, handle multiple codec choices 2016-07-08 21:18:03 -07:00
Brad Hefta-Gaub
126e5c2926 codec pipeline working, zlib example 2016-07-08 14:34:44 -07:00
Brad Hefta-Gaub
3c6447326e more codec plumbing 2016-07-07 21:24:24 -07:00
Brad Hefta-Gaub
7a4b11ee97 more work on codecs 2016-06-27 13:06:19 -07:00
Brad Hefta-Gaub
d7bffc3eab first cut at negotiating codecs 2016-06-23 17:14:41 -07:00
Seth Alves
bade215907 maximum 'tmp' entity lifetime is now a domain-server setting, defaults to 1 hour 2016-06-09 10:41:30 -07:00
Seth Alves
b2f63a2132 hook up can-rez-tmp and can-write-to-asset-server 2016-06-07 16:17:58 -07:00
Seth Alves
fc92268641 Merge branch 'master' of github.com:highfidelity/hifi into permissions-grid 2016-06-02 15:38:24 -07:00
Seth Alves
83f2c723eb collect permissions into their own data structure 2016-06-02 13:15:30 -07:00
Brad Hefta-Gaub
f65f99a3e0 fix warning 2016-05-29 12:34:57 -07:00
Brad Hefta-Gaub
7fd531541c simplify 2016-05-29 12:08:10 -07:00
Brad Hefta-Gaub
1e7cd06d0e add audio peak limiter to audio mixer 2016-05-28 20:34:27 -07:00
Brad Hefta-Gaub
06cb625d09 Merge pull request #7959 from hyperlogic/tony/improved-avatar-mixer-precision
Improved Avatar Mixer Rotation Precision
2016-05-25 17:14:12 -07:00
Anthony J. Thibault
a1c32f8c44 Merge branch 'master' into tony/improved-avatar-mixer-precision 2016-05-23 10:24:52 -07:00
Seth Alves
d7142aee80 try to make osx clang happy, also 2016-05-21 18:06:21 -07:00
Seth Alves
40e862cf9e quiet gcc 5 warnings 2016-05-21 16:53:01 -07:00
Atlante45
8be6bc6460 Add missing overrides 2016-05-19 22:00:22 -07:00
Ryan Huffman
dd093e3fcd Make AccountManager a DependencyManager singleton 2016-05-18 15:38:54 -07:00
Anthony J. Thibault
c48fce4f5a WIP commit, socket errors when AvatarIdentity is larger then MTU 2016-05-18 15:24:10 -07:00
Anthony J. Thibault
dc6e1afae6 Changed empty AvatarIdentity packet to AvatarData packet
Just in-case it actually gets through, it will fail to be parsed
by AvatarData::parseDataFromBuffer() due to it's size.
AvatarData::hasIdentityChangedAfterParsing() has no such checks.
2016-05-17 16:34:30 -07:00
Anthony J. Thibault
b82356a249 AvatarMixer: Clients will show incompatible version dialog
For this to work, the server needs to send an empty AvatarIdentity packet back to the sender
when it receives a packet mismatch error.  This AvatarIdentity packet will be different then
what the client expects and will trigger the incompatible version dialog.

Previously, the avatar-mixer was just silently dropping incoming mismatched version packets.
Causing the client to never get a response, and thus never showing the incompatible version dialog.
2016-05-17 15:02:04 -07:00
Stephen Birarda
aa226739d3 remove billboard code from Agent 2016-05-12 16:41:44 -07:00
Brad Hefta-Gaub
350743454b Merge pull request #7839 from sethalves/entity-simulation-smart-pointers-1
use smart pointers for entity simulations
2016-05-10 11:35:57 -07:00
Brad Hefta-Gaub
d7eee98acc Merge pull request #7827 from AndrewMeadows/threadsafe-viewfrustum
resurrection of threadsafe ViewFrustum
2016-05-10 09:06:38 -07:00
Seth Alves
b761ecf44f merge from upstream 2016-05-10 08:18:45 -07:00
Andrew Meadows
db9a4d6b8f cleanup for code review 2016-05-10 07:49:11 -07:00
Brad Hefta-Gaub
0de721e8f4 Merge pull request #7838 from zzmp/refactor/script-sleep
Use sleep_until for ScriptEngine
2016-05-09 15:58:22 -07:00
Seth Alves
a0771f8ee5 use smart pointers for entity simulations 2016-05-07 09:14:33 -07:00
Zach Pomerantz
173d2a590c Use sleep_until for ScriptEngine 2016-05-06 19:30:37 -07:00
Brad Hefta-Gaub
99d35c37db switch OctreeSendThread to use std::this_thread::sleep_for() instead of usleep() 2016-05-06 10:42:07 -07:00
Andrew Meadows
71b2d647e8 add locks and explicitly copy ViewFrustums 2016-05-05 18:28:27 -07:00
Andrew Meadows
bcf2cc8074 use references not pointers for ViewFrustums
also unravelling some spaghetti:
(1) split Octree stuff out of ViewFrustum
(2) moved ViewFrustum from octree to shared lib
(3) removed some cruft
2016-05-05 18:28:27 -07:00
Brad Hefta-Gaub
e8af41c6ab more CR feedback 2016-04-21 15:54:51 -07:00
Brad Hefta-Gaub
31f9d592e0 support for larger than 35 minute clock skew 2016-04-20 18:42:00 -07:00
Stephen Birarda
93cf5a1035 fixes for CR comments 2016-04-18 16:53:02 -07:00
Stephen Birarda
1d256be7ee fix random stats sending for AudioMixer clients 2016-04-18 16:04:20 -07:00
Stephen Birarda
33b46bd8e3 remove the billboard packet handling from AM 2016-04-18 16:02:46 -07:00
Stephen Birarda
38481aac53 use HRC clock timings in avatar mixer 2016-04-15 11:36:07 -07:00
Stephen Birarda
925c1ce26b don't send all stats to audio-mixer clients at same time 2016-04-15 11:04:56 -07:00
Stephen Birarda
0fd32b36ad use a steadier clock for AudioMixer block timing 2016-04-15 11:04:35 -07:00
Stephen Birarda
d7450b8178 release pending ATP script request for active AssetServer 2016-04-13 14:25:23 -07:00
Seth Alves
0980ab5c2d Merge pull request #7634 from birarda/asset-server-clean
cleanup unmapped asset server files
2016-04-12 11:59:41 -07:00
Stephen Birarda
76af3efe73 fix for active socket check on ATP script download 2016-04-11 17:59:27 -07:00
Stephen Birarda
190d11e0bf rename the set of hashes to check for deletion 2016-04-11 17:16:52 -07:00
Stephen Birarda
026f58c866 don't perform asset cleanup if mapping file load fails 2016-04-11 17:14:31 -07:00
Stephen Birarda
334dc3cb6c cleanup left file debug, add check for deleted mapping 2016-04-11 09:05:11 -07:00
Stephen Birarda
775898893b add deletion of unmapped files during delete op 2016-04-11 08:57:07 -07:00
Stephen Birarda
fae9b061a3 promote a debug to info 2016-04-11 08:42:52 -07:00
Stephen Birarda
4d0976f730 remove migration code for pre-mapping migrations 2016-04-11 08:41:42 -07:00
Stephen Birarda
bf3324fc6b hold download of ATP script if Asset Server isn't ready 2016-04-08 15:28:12 -07:00
Stephen Birarda
1df0dce971 use ResourceRequest in Agent to handle ATP scripts 2016-04-08 14:38:26 -07:00
Brad Hefta-Gaub
40e53baa79 Merge pull request #7597 from Atlante45/fix/script-sound-hold-strong-ref
Fix audio injectors not working
2016-04-06 16:57:29 -07:00