feat: add DAVE E2EE voice support#453
Open
coderobe wants to merge 3 commits into
Open
Conversation
… add a handful of short DAVE: debug lines in the voice state machine so debug mode still shows useful milestones without dumping MLS payload hex
Author
|
resolves #448 |
Droid00000
reviewed
May 3, 2026
Co-authored-by: Droid <johnship2876@gmail.com>
Collaborator
|
Hey, thank you for the PR. After some more testing, I've found a few issues. It may be worth noting that I'm on MacOS, and unsure if any of these issues are platform specific. In essence:
User Join:[DEBUG : vws-i @ 2026-05-08 22:27:46.692] DAVE: Processing MLS proposals (499 bytes)
[ERROR : vws-i @ 2026-05-08 22:27:46.693] DAVE: Attempted to verify credential for unrecognized user ID: 673658900435697665
[ERROR : vws-i @ 2026-05-08 22:27:46.693] DAVE: MLS add proposal must be for recognized user
[WARN : vws-i @ 2026-05-08 22:27:46.694] VWS close: DAVE MLS failure from ValidateProposalMessage: Unexpected user ID in add proposal
[DEBUG : vws-i @ 2026-05-08 22:27:46.701] Received VWS binary opcode 30 (958 bytes)
[DEBUG : vws-i @ 2026-05-08 22:27:46.701] DAVE: Processing MLS welcome for transition 0
[ERROR : vws-i @ 2026-05-08 22:27:46.703] DAVE: Attempted to verify credential for unrecognized user ID: 673658900435697665
[ERROR : vws-i @ 2026-05-08 22:27:46.703] DAVE: MLS welcome lists unrecognized user ID
[DEBUG : vws-i @ 2026-05-08 22:27:46.703] DAVE: Transition 0 is ready
[DEBUG : vws-i @ 2026-05-08 22:27:46.703] Sending voice opcode 23 with data: {transition_id: 0}
#<Thread:0x0000000123bcc270 core.rb:60 run> terminated with exception (report_on_exception is true):
/Users/qs/.rbenv/versions/4.0.1/lib/ruby/gems/4.0.0/bundler/gems/discordrb-dave-0a7c89b4be88/lib/discordrb/voice/network.rb:440:in 'Discordrb::Voice::VoiceWS#ready_for_media?': RuntimeError (RuntimeError)
from /Users/qs/.rbenv/versions/4.0.1/lib/ruby/gems/4.0.0/bundler/gems/discordrb-dave-0a7c89b4be88/lib/discordrb/voice/network.rb:429:in 'Discordrb::Voice::VoiceWS#connect'
from core.rb:60:in 'block in Discordrb::Voice::VoiceBot#initialize'User Leave[DEBUG : vws-i @ 2026-05-08 22:28:22.635] Received VWS message! {"seq":8,"op":13,"d":{"user_id":"673658900435697665"}}
[DEBUG : vws-i @ 2026-05-08 22:28:22.636] Received VWS message! {"seq":9,"op":24,"d":{"protocol_version":1,"epoch":1}}
[DEBUG : vws-i @ 2026-05-08 22:28:22.636] DAVE: Preparing epoch 1 for protocol version 1
[DEBUG : vws-i @ 2026-05-08 22:28:22.638] DAVE: Sending MLS key package
[DEBUG : vws-i @ 2026-05-08 22:28:22.639] Sending voice binary opcode 26 (390 bytes)
[DEBUG : vws-i @ 2026-05-08 22:28:22.642] Received VWS message! {"seq":10,"op":21,"d":{"transition_id":0,"protocol_version":1}}
[DEBUG : vws-i @ 2026-05-08 22:28:22.642] DAVE: Preparing transition 0 for protocol version 1
[WARN : vws-i @ 2026-05-08 22:28:22.644] VWS close: Failed to create DAVE key ratchet for user 1268769703027933235 |
Author
|
I get the user leave warn on close occasionally, although not always. Haven't investigated, but it's not fatal. The other issue i can't reproduce. Audio works fine for me - I have been using my branch for multiple sound bots, although largely with short soundbites. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds DAVE E2EE voice protocol support through ffi discord/libdave bindings. DAVE support is only enabled when the libdave native libraries are found and can be loaded, so it is not a new hard dependency unless bot operators want to use voice features.
For testing on macos, i provide a libdave homebrew cask so you can
brew tap coderobe/libdave && brew install libdaveand this change should pick it up and enable it automatically.The path to the libdave shared library can be overridden by setting
DISCORDRB_LIBDAVE_PATH, and additional libdave-internal debug log verbosity can be tuned withDISCORDRB_LIBDAVE_LOG_LEVEL(defaults towarning).Added
discordrb/voice/dave: DAVE E2EE protocol support