Skip to content

Implement voice chat (VoIP)#303

Open
LegendaryGuard wants to merge 12 commits into
DarkPlacesEngine:masterfrom
LegendaryGuard:voip
Open

Implement voice chat (VoIP)#303
LegendaryGuard wants to merge 12 commits into
DarkPlacesEngine:masterfrom
LegendaryGuard:voip

Conversation

@LegendaryGuard

@LegendaryGuard LegendaryGuard commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

Closes #61

With DP_RM_VOIP extension, use one of my branches to experiment with QuakeC: https://github.com/LegendaryGuard/darkplaces/tree/LegendaryGuard/DP_RM_VOIP
you're free to do whatever there.

That implementation came from DarkPlaces RM.
This feature can be tested on the latest version of Rexuiz, just bind the key of the voice chat feature, press and hold the binded key, and speak, everyone will hear the voice and noises of who enables it if the microphone is on.
Uses OPUS.

Added cvars:

  • sv_voip: Enable voip support in server
  • sv_voip_echo: Echo mode for VOIP, for testing purpose
  • sv_voip_force: Force VOIP between players, even if QuakeC didn't want it

  • voipvolume: volume of voip
  • snd_input_boost: Audio input boost
  • snd_input_boost_auto: Audio input boost

Added commmands:

  • snd_list_input_devices: list input audio devices
  • snd_set_input_device: set input audio device
  • snd_echo_start: start microphone echo test
  • snd_echo_stop: stop microphone echo test

To bind keys:

  • +snd_voip_talk: start voip
  • -snd_voip_talk: stop voip

NOTE: Feel free to tweak the code and contribute, you can open other new PR as copy of that if I'm not active.
Anyone is free to copy the code, it's GPL-licensed.

P.D. If the owners/maintainers don't agree, feel free to fork my branch repository and do experiments.

@LegendaryGuard LegendaryGuard changed the title Implement VoIP Implement voice chat (VoIP) Feb 17, 2026
Comment thread netconn.c Outdated
Comment thread netconn.c
@hemebond

hemebond commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

What is the workflow/usage around voipgroup? Currently it defaults to zero, which, by default, means no one hears voip unless sv_voip_force is enabled on the server.

@LegendaryGuard

Copy link
Copy Markdown
Contributor Author

@hemebond I overwritten the commit.
Also, is squash merge allowed here?
Just asking, because I think after that feature is merged, we could trace better the source of an issue that could happen.

@LegendaryGuard

LegendaryGuard commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

What is the workflow/usage around voipgroup? Currently it defaults to zero, which, by default, means no one hears voip unless sv_voip_force is enabled on the server.

Not sure. I believe "voipgroup" and "voiplistengroup" should mean only can talk and listen in such group of people while others can't talk and listen in that same one.

Imagine playing team gamemodes like Team Deathmatch, Capture The Flag, Prop Hunt, Trouble in Terrorist Town, ...
You would wanna talk to your team to plan your strategies in the matches.

Also in normal gamemodes, while being a spectator and you don't play, you would wanna talk with the spectators without disturbing the players.

Comment thread prvm_offsets.h
@hemebond

Copy link
Copy Markdown
Contributor

@hemebond I overwritten the commit. Also, is squash merge allowed here? Just asking, because I think after that feature is merged, we could trace better the source of an issue that could happen.

When it's merged into main/master your PR should be squash merged, yes. So you can just add commits to your PR.

@hemebond

hemebond commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

What is the workflow/usage around voipgroup? Currently it defaults to zero, which, by default, means no one hears voip unless sv_voip_force is enabled on the server.

Not sure. I believe "voipgroup" and "voiplistengroup" should mean only can talk and listen in such group of people while others can't talk and listen in that same one.

Imagine playing team gamemodes like Team Deathmatch, Capture The Flag, Prop Hunt, Trouble in Terrorist Town, ... You would wanna talk to your team to plan your strategies in the matches.

Also in normal gamemodes, while being a spectator and you don't play, you would wanna talk with the spectators without disturbing the players.

So voipgroup 0 means no voip, unless sv_voip_force is enabled. Otherwise modders use voipgroup and voiplistengroup fields to group players allowing them to talk to each other. Sounds good.

I'm having a bit of trouble getting it to work reliably. With player 1 (listen host) sending voip (snd_voip_force enabled), player 2 console gets a constant stream of:

Schedule voip sfx remove
VOIP sound buffer truncated
Schedule voip sfx remove
VOIP sound buffer truncated
VOIP sound samples missed (too far in future)

and no sound. Not sure how I got it to work previously. snd_echo_start works okay.

Signed-off-by: LegendaryGuard <rootuser999@gmail.com>
Comment thread cap_ogg.c
@hemebond

hemebond commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

The new QuakeC fields and functions should probably also be added to the dpdefs files; otherwise modders won't know about them.

EDIT: I've created #306 as a follow up task for myself to add the defs after I've tested them.

@LegendaryGuard

Copy link
Copy Markdown
Contributor Author

The new QuakeC fields and functions should probably also be added to the dpdefs files; otherwise modders won't know about them.

EDIT: I've created #306 as a follow up task for myself to add the defs after I've tested them.

@hemebond
Done at e443c08. Tell me if something is missing or wrong. Thanks!

Comment thread makefile.inc Outdated
Comment thread prvm_offsets.h Outdated
Comment thread prvm_offsets.h
@Cloudwalk9 Cloudwalk9 self-assigned this Feb 23, 2026
@Cloudwalk9 Cloudwalk9 added the enhancement New feature or request label Feb 23, 2026
@Cloudwalk9

Cloudwalk9 commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Not gonna merge this yet because we want to track FTEQW compatibility as closely as possible. We want to make sure this at least won't complicate FTEQW compatibility later. So consider this pending or "will merge what ever it takes eventually". Definitely not saying no to the Opus capture plumbing at least.

@Cloudwalk9

Copy link
Copy Markdown
Contributor

On closer review: absolutely not. I'll merge everything except the extension. This creates a parallel mini protocol on raw UDP with the magic bytes "VOIP" and yells it directly into the bowels of the audio subsystem. Demos won't be able to record voice, it doesn't benefit from the same serialization and debugging ability as the protocol layer and its own bounds and sanity checks. It's not something I'm comfortable upstreaming.

FTE uses a pair of netmessages, and so does Source and GoldSrc. I'd rather we go that route than trying to sidestep the Quake protocol state machine.

Yeah it's insane to mint a new protocol number every new feature we add. So FTE pext is something we want to consider eventually. But this is a recipe for some fun extra bugs from edge cases because it doesn't go through an existing battle tested path that everything else does.

@LegendaryGuard

Copy link
Copy Markdown
Contributor Author

@Cloudwalk9
I didn't know that was sensitive.

I just did that at 5b91d28 regarding your reply, anything else?

@Cloudwalk9

Cloudwalk9 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

@LegendaryGuard I will merge basically everything except the networking bits. We'll have to do that ourselves but that's the "easy" and fun part. The audio capture plumbing is fine, which is the soul-crushing, gruelling boilerplate part. And we want it in Opus anyway.

I want VoIP too, but not brute forced. We have to do this right. Once an extension is implemented, if mods start depending on it and it's categorically unserviceable without breaking compatibility due to design or intrinsic security concerns, there's no Ctrl+Z.

@Cloudwalk9

Cloudwalk9 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

I should remind people that they're implementing the equivalent of a syscall for certain things. It's a contract rather than a mere feature.

If it's found to be faulty and applications depend on its behavior, but the fault is part of the behavior, it cannot be fixed without breaking applications. No amount of shim magic in the world will fix that. There's no going back quickly and technical debt is accrued.

That's also why compatibility layers strive for bug-for-bug compatibility. Because even the bugs define the contract.

Could I merge this as-is? I mean, I'd probably keep it disabled by default. But it's also a matter of willingness to maintain two parallel VoIP implementations and fixing its inevitable security bugs.

We generally do not wish to become a compatibility layer bazaar for everyone's new thing in their own fork or port. We have our own compatibility issues with stock Quake and its mods as it is.

@LegendaryGuard

LegendaryGuard commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Understandable. I really appreciate you reviewing completely the feature in great detail. 👍
Please, don't merge yet, we'll need to check some stuff before, although the networking bits are removed.

We could summon kasymovga if he wants to talk here, I see that he's the one who implemented that feature, maybe he could review the details.

So, I opened an issue in their own engine where handles that implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add voice chat (VoIP)

3 participants