dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Dragonfly latency

Open techtonik opened this issue 9 years ago • 11 comments

What is the delay (lag) between speaking a command and recognizing it?

In other words, how many commands is it possible to execute in one second? Does Dragonfly provide any capabilities to measure this lag (latency) between spoken sound and executed command?

techtonik avatar Dec 17 '15 08:12 techtonik

Can you clarify your question? I've executed literally hundreds of Dragonfly commands in less than a second via unit tests, but obviously no one can speak that many in such a short time.

Also, I'm not sure what you mean about network latency. Dragonfly doesn't send anything to any computer other than the one it is installed on (barring sending keystrokes into virtual machines, etc.). Maybe you're thinking of Aenea? Or the Ruby Dragonfly?

synkarius avatar Dec 23 '15 02:12 synkarius

@synkarius I've updated the question.

techtonik avatar Dec 23 '15 02:12 techtonik

Ah. The lag between speaking and execution depends on hardware, and the complexity of the Grammar(s) you have active. After upgrading my soundcard, there was a noticeable decrease in lag, sometimes by as much as a second. Complex CCR commands might take longer to be recognized too. Usually though, on my I3 processor / 16GB RAM / SoundBlaster E1 external card, the delay is about half a second.

As for measuring the lag, I am unaware of any such tools.

synkarius avatar Dec 23 '15 04:12 synkarius

It may also be worth mentioning-- by using CCR commands, though the total time for a series of commands will be greater than one second, your commands per second will be higher. Meaning, if you speak single commands, you'll be able to speak one or two per second. Speaking strings of commands, you might average more like 3-4.

synkarius avatar Dec 23 '15 04:12 synkarius

Thanks for the explanation. It would be nice to see this documented or even better - visualized, but that is not trivial. Inkscape / D3.js madskilz are required. =)

techtonik avatar Dec 23 '15 22:12 techtonik

Interesting note about the external sound card. I noticed a significant latency improvement moving from a XLR->USB adapter to a XLR->3.5mm adapter (plugged in to motherboard's onboard sound), but I'm running dragonfly inside a VirtualBox VM on Ubuntu, and it could be the USB audio layer on Linux is slow. Did you get the card specifically to help latency? On Dec 23, 2015 4:50 PM, "anatoly techtonik" [email protected] wrote:

Thanks for the explanation. It would be nice to see this documented or even better - visualized, but that is not trivial. Inkscape / D3.js madskilz are required. =)

— Reply to this email directly or view it on GitHub https://github.com/t4ngo/dragonfly/issues/48#issuecomment-167004613.

jgarvin avatar Dec 24 '15 01:12 jgarvin

@jgarvin, yes. Anything is better than the integrated Realtek cards I've got both at work and at home. I could have gotten internal cards, but I change hardware a lot and USB travels better.

synkarius avatar Dec 24 '15 01:12 synkarius

Interesting, is there any way to get quantitative data about latency in addition to subjective measurement?

techtonik avatar Dec 25 '15 12:12 techtonik

One route might be to look at the callbacks assigned in _load_grammar in dragonfly/engines/backend_natlink/engine.py. You could decorate them such that they report their times to some global object.

synkarius avatar Dec 27 '15 00:12 synkarius

I'm trying out one of the sound blaster e's and I've noticed the app has a lot of potential configuration options for echo cancellation, noise reduction, "smart volume", etc. What settings do you use? Or do you just shut it all off? On Dec 23, 2015 7:12 PM, "David Conway" [email protected] wrote:

@jgarvin https://github.com/jgarvin, yes. Anything is better than the integrated Realtek cards I've got both at work and at home. I could have gotten internal cards, but I change hardware a lot and USB travels better.

— Reply to this email directly or view it on GitHub https://github.com/t4ngo/dragonfly/issues/48#issuecomment-167017321.

jgarvin avatar Jan 25 '16 15:01 jgarvin

I left everything as the defaults, except for the Advanced Options, in which I specified that I wanted the headset mic to use the headset microphone.

Also possibly relevant though: I've noticed that DNS gets lower recognition accuracy if your mic volume is too high, so I have a batch script constantly running which sets the volume to 20%. (YMMV.) For some reason, every time I switch DNS off and on (the red icon to the green in DNS 12.51), DNS resets my mic volume to 100%.

synkarius avatar Jan 27 '16 10:01 synkarius