Skip to content

Fix for an issue where voice rejected packets#5081

Merged
Lpsd merged 9 commits into
multitheftauto:masterfrom
MoriskaSosiska:fix_voice_failed
Jul 25, 2026
Merged

Fix for an issue where voice rejected packets#5081
Lpsd merged 9 commits into
multitheftauto:masterfrom
MoriskaSosiska:fix_voice_failed

Conversation

@MoriskaSosiska

@MoriskaSosiska MoriskaSosiska commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Fix for an issue where CVoiceDataPacket::Read rejected packets and caused audio dropouts due to while (uiSpeexFramesAvailable-- > 0).

Increased the MAX_VOICE_PACKETS_PER_INTERVAL limit from 5 to 32.

Moved the VOICE_PACKET_INTERVAL_MS and MAX_VOICE_PACKETS_PER_INTERVAL limits to the server configuration as voice_packets_interval and max_voice_packets_per_interval.
Also increased the default value of max_voice_packets_per_interval from 5 to 32.

Hopefully, there won't be any more issues.

@Lpsd

@MoriskaSosiska MoriskaSosiska changed the title Fix for an issue where CVoiceDataPacket::Read rejected packets Fix for an issue where voice rejected packets Jul 23, 2026
@Lpsd

Lpsd commented Jul 24, 2026

Copy link
Copy Markdown
Member

I will make these configurable by the server instead

@MoriskaSosiska

Copy link
Copy Markdown
Contributor Author

I will make these configurable by the server instead

Doesn't this seem a bit excessive?

@MoriskaSosiska

Copy link
Copy Markdown
Contributor Author

I will make these configurable by the server instead

If you consider this approach reliable, I can implement it in my PR

@Lpsd

Lpsd commented Jul 24, 2026

Copy link
Copy Markdown
Member

It's not really excessive to give server owners control. We do something similar already with player_triggered_event_interval and max_player_triggered_events_per_interval for events, why not have the same for voice packets?

@Lpsd

Lpsd commented Jul 24, 2026

Copy link
Copy Markdown
Member

If you consider this approach reliable, I can implement it in my PR

Go ahead

@MoriskaSosiska

Copy link
Copy Markdown
Contributor Author

Go ahead

Should VOICE_PACKET_INTERVAL_MS be controlled by the server?
I'm just not entirely sure

@Lpsd

Lpsd commented Jul 24, 2026

Copy link
Copy Markdown
Member

Should VOICE_PACKET_INTERVAL_MS be controlled by the server?
I'm just not entirely sure

The interval and threshold, yes. i.e VOICE_PACKET_INTERVAL_MS and MAX_VOICE_PACKETS_PER_INTERVAL

@Lpsd Lpsd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have also added max_voice_buffer_size as the 2048 default is excessive, new default 512 with min 128 and max 2048.

Thanks for your PR!

@Lpsd
Lpsd merged commit f1683fd into multitheftauto:master Jul 25, 2026
@MoriskaSosiska

Copy link
Copy Markdown
Contributor Author

I have also added max_voice_buffer_size as the 2048 default is excessive, new default 512 with min 128 and max 2048.

Thanks for your PR!

Are you sure 512 is enough? I think 2048 would be a better default, since the goal of this PR is to ensure everything works reliably out of the box. People will most likely set this parameter without giving it much thought, which could lead to issues.

@Lpsd

Lpsd commented Jul 25, 2026

Copy link
Copy Markdown
Member

2048 is an incredibly high value, even 512 is very generous. Would be safe with 128 even at wideband and highest bit rate, let alone narrowband. This is a single speex frame part

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

Successfully merging this pull request may close these issues.

2 participants