-
Notifications
You must be signed in to change notification settings - Fork 287
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
fix: Use Opus in the CBR mode #2757
Conversation
@iphydf cimple doesn't recognize OPUS_SET_VBR macro
It's defined in opus_defines.h, which is included by opus.h, included by audio.h, included by audio.c. |
is this fully working?
|
@zoff99 Are you saying that it's not fully working for you? How so? Also, what are quoting? Can you link to the source of what are you quoting? Is that an output you get when compiling toxav? Perhaps an output of one of our CIs? Or are you just quoting the documentation?
I saw this warning when reading earlier versions of the Opus documentation, e.g. in Opus 1.0.3 released on Jul 11, 2013. But later versions removed that warning, e.g. it seems to be gone in Opus 1.1.3 released on Jul 15, 2016, and the later versions. So it appears that this was resolved in Opus long time ago and that warning no longer applies. Am I wrong? Do you think we need to enable the MDCT mode?
Could you clarify on how is The documentation says: so it appears that this setting does nothing when using the CBR mode, which is what this PR makes toxav use. Am I missing something? |
i activated CBR mode for opus some years ago in my fork, and then switched back to VBR again. can't remember the reason right now. if we are switching to CBR mode i would want that $someone tests with the 2 (3) still maintained clients in some real world audio calls. |
I'm unable to test it at the moment. Did you get any chance to test this, @zoff99? There is a person on IRC claiming that it works for them using toxic and qtox clients, over localhost udp, tcp and tcp over tor. Tough given they are the same person who authored the PR diff, I'd prefer if someone else tested it too. |
i will hopefully get the chance to test it in the next weeks |
setting VBR to false, and use CBR. for details see: TokTok#2757
first test completed: tox_videoplayer -> toxblinkenwall (audio quality test with https://yewtu.be/watch?v=o8dEgTMZ81g) |
2nd test completed: making sure it actually has the wanted effect in the context and setup of toxav (caveat: using my fork) with VBR:
with CBR:
seems it does work properly. |
@JFreegman did anybody test this with toxic audio and video calls? |
depends on TokTok/hs-tokstyle#254 |
The cimple CI check is still failing. |
yea, something still needs updating. |
@nurupo is it possible we need to update cimple in the toktok-stack repo too? |
lets see if it automatically creates a pr after I interacted with it. |
|
toktok-stack docker images should be up-to-date now, @nurupo can you try to force push again? |
The CI is passing now. Only a review approval is left. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. I compared it to other opus voip applications, and they do is exactly the same.
still missing the tests for toxic like me and nurupo like to see. did it get tested? |
I just performed a test with 3 clients. I routed the audio from No audible difference was detected. |
VBR is susceptible to a transcription attack, where words can be deducted from bandwidth fluctuations, even despite the audio being encrypted. Toxcore does add padding, but it's just 0-7 bytes, to pad to a 8 byte boundary, which might not be enough. CBR is safe from this attack, it is the industry recommendation to use CBR: "Applications conveying highly sensitive unstructured information SHOULD NOT use codecs in VBR mode."[1], and is what other secure messengers use too, e.g. Signal. Here are some papers on this topic: - A. M. White, A. R. Matthews, K. Z. Snow and F. Monrose, "Phonotactic Reconstruction of Encrypted VoIP Conversations: Hookt on Fon-iks," 2011 IEEE Symposium on Security and Privacy, Oakland, CA, USA, 2011, pp. 3-18, doi: 10.1109/SP.2011.34. - L. A. Khan, M. S. Baig, and Amr M. Youssef. Speaker recognition from encrypted VoIP communications. Digit. Investig. 7, 1–2 (October, 2010), 65–73. https://doi.org/10.1016/j.diin.2009.10.001 - C. V. Wright, L. Ballard, S. E. Coull, F. Monrose and G. M. Masson, "Spot Me if You Can: Uncovering Spoken Phrases in Encrypted VoIP Conversations," 2008 IEEE Symposium on Security and Privacy (sp 2008), Oakland, CA, USA, 2008, pp. 35-49, doi: 10.1109/SP.2008.21. Thanks to an IRC user who asked to remain anonymous for sending the diff. [1] https://datatracker.ietf.org/doc/html/rfc6562#section-3
e032761
to
03e9fbf
Compare
For some reason |
VBR is susceptible to a transcription attack, where words can be
deducted from bandwidth fluctuations, even despite the audio being
encrypted. Toxcore does add padding, but it's just 0-7 bytes, to pad to
a 8 byte boundary, which might not be enough. CBR is safe from this
attack, it is the industry recommendation to use CBR: "Applications
conveying highly sensitive unstructured information SHOULD NOT use
codecs in VBR mode."[1], and is what other secure messengers use too,
e.g. Signal.
Here are some papers on this topic:
Reconstruction of Encrypted VoIP Conversations: Hookt on Fon-iks,"
2011 IEEE Symposium on Security and Privacy, Oakland, CA, USA, 2011,
pp. 3-18, doi: 10.1109/SP.2011.34.
from encrypted VoIP communications. Digit. Investig. 7, 1–2 (October,
2010), 65–73. https://doi.org/10.1016/j.diin.2009.10.001
"Spot Me if You Can: Uncovering Spoken Phrases in Encrypted VoIP
Conversations," 2008 IEEE Symposium on Security and Privacy (sp 2008),
Oakland, CA, USA, 2008, pp. 35-49, doi: 10.1109/SP.2008.21.
Thanks to an IRC user who asked to remain anonymous for sending the
diff.
[1] https://datatracker.ietf.org/doc/html/rfc6562#section-3
This change is