Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do it faster #7

Open
weidaxu1988 opened this issue May 24, 2017 · 5 comments
Open

How do it faster #7

weidaxu1988 opened this issue May 24, 2017 · 5 comments

Comments

@weidaxu1988
Copy link

weidaxu1988 commented May 24, 2017

Hi,
I am trying out this project, and it works nicely. But my case is time sensitive, I use iphone and my nexus phone as transmitter, raspberry pi as receiver, and I send 32 bytes once a time. It costs around 800ms for both prefix audible mode and ultrasonic-experimental mode.

Is there any way that I can do with config file to make it faster?

PS: distance is not a issue, I can make it close enough. ^^

Any suggestion from you will really help me.

@brian-armstrong
Copy link
Member

This will ultimately come down to which profile you use. You could, as a starting point, try out some of the other profiles just to see if they get closer to what you want. The profile names are just the top-level keys in quiet-profiles.json

@scream7
Copy link

scream7 commented May 25, 2017

Hi @brian-armstrong
I think @weidaxu1988 means to adjust parameters of default profiles, not only apply the default settings.
And I also faced to this situation.

@brian-armstrong
Copy link
Member

One option would be to try out https://quiet.github.io/quiet-profile-lab though unfortunately it hasn't been updated with all the newest features.

In general, changing the modulation and samples per symbol will have the greatest effect on the speed

@weidaxu1988
Copy link
Author

@scream7 yes, @brian-armstrong I tried all prefixed method, the result seems the same. I also change the frame_lenght, checksum method, but not quiet good. I also realized that send 32 bytes need around 800ms, can I reduce length from the sender? 32Byte is all I need.

@brian-armstrong
Copy link
Member

Oh, I bet you're running into the audio latency. There is a way to shorten this.

You'll want to change numBuffers and bufferLength on QMReceiverConfig and QMTransmitterConfig.

You can see the default values here https://github.com/quiet/QuietModemKit/blob/master/QuietModemKit/QMReceiverConfig.m . You'll want bufferLength to be a power of 2.

Presently there are 3 buffers of 4096 samples each on transmitter and receiver side. 2 * (3 * 4096) / 44100. = 557 ms. I bet that's most of what you're seeing. There are other latencies that could be improved but this will be the largest one.

Reducing the buffers will make it more likely that the app stutters and doesn't receive correctly, so you'll have to experiment. This is just an area I haven't optimized yet :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants