These are chat archives for highfidelity/hifi

21st
Feb 2017
Ryan Huffman
@huffman
Feb 21 2017 16:58
@TopRamenGod How far off are the beats?
Michael Varner
@TopRamenGod
Feb 21 2017 18:57
Well, the thing is that I suspect the timing of most things (detection of a hit, color change on beat, scoring) seems about right. If I stay in rhythm according to real world timing, it works. It's the audio cue that's getting an inconsistent amount of delay, and I think that's more fundamental to the audio having to go up to the audio mixer and having to come back down to the client. Otherwise, things that are off would at least be off close together, right?
Ryan Huffman
@huffman
Feb 21 2017 19:08
Sounds right. What type of script is this?
What is injecting the audio?
Ryan Huffman
@huffman
Feb 21 2017 19:16
server or client?
Michael Varner
@TopRamenGod
Feb 21 2017 19:18
Client, presumably
It's my understanding that a server entity script requires special consideration, whereas a a client entity script is written like has been in the past
Ryan Huffman
@huffman
Feb 21 2017 19:22
Try using localOnly: true in the audio injector options
To test injecting locally only
Ryan Huffman
@huffman
Feb 21 2017 19:27
I'm not sure that a round trip is incurred when injecting to the audio mixer, but you can try testing localOnly to confirm
Michael Varner
@TopRamenGod
Feb 21 2017 19:28
right. testing now
Michael Varner
@TopRamenGod
Feb 21 2017 19:38
Hmm. If there is difference, it's not apparent
So audio mixer probably isn't the issue...
We might just be dealing with some as of yet impassable fundamental JS issues. I've bumped the MIN_TIMEOUT_FOR_COARSE_TIMER in ScriptEngine.cpp all the way up to 500, which seemed to help
Michael Varner
@TopRamenGod
Feb 21 2017 19:55
Looking at stats.js, it looks like I'm getting ~100ms of latency with localOnly: false
and with localOnly: true, I'm gettting ~120ms
Ryan Huffman
@huffman
Feb 21 2017 23:02
I don't work on the audio code, but that looks to be round trip. There should be minimal latency when injected locally. If you just play a sound from a script right away, does it sound like there is a delay?
Michael Varner
@TopRamenGod
Feb 21 2017 23:04
There's an inconsitent delay even when it's a fairly simple repeating sound. Single 'one shots' play near immediately. It's when these repetitive sounds are played does the issue start.
Whatever inherrent overhead there is in even a local call is probably getting stacked and causing drift when sounds are fired successively