Add extra receive buffering and decode Opus FEC on loss
A new Extra buffering setting (Network page) holds more playback delay than the jitter buffer measures it needs, so late packets still make it in time on a bad connection. A lost frame is now rebuilt from the FEC copy in the next packet when that one is already held, and the Connection Info shows how many were recovered. Held packets' arrival marks now move with the timeline when the delay changes; libspeex leaves them, which made a multi-frame jump count twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -420,6 +420,7 @@ class SessionController(private val context: Context) {
|
||||
for (server in _servers.value) {
|
||||
server.playback?.setMasterVolume(settings.outputVolume)
|
||||
server.playback?.setOutputDevice(settings.outputDevice)
|
||||
server.playback?.setReceiveBuffer(settings.receiveBuffer)
|
||||
server.microphone?.apply(settings)
|
||||
server.refresh()
|
||||
server.scheduleTree(structure = false)
|
||||
|
||||
@@ -18,7 +18,7 @@ import kotlin.math.roundToInt
|
||||
private const val MIN_BITRATE_KBITS = 8f
|
||||
private const val MAX_BITRATE_KBITS = 160f
|
||||
|
||||
/** What voice costs and survives on the wire: bitrate, error correction and duplicate packets. */
|
||||
/** What voice costs and survives on the wire: bitrate, error correction, duplicate packets and receive buffering. */
|
||||
@Composable
|
||||
fun NetworkSettingsScreen(vm: SessionController, onBack: () -> Unit) {
|
||||
val settings = vm.settings
|
||||
@@ -30,6 +30,7 @@ fun NetworkSettingsScreen(vm: SessionController, onBack: () -> Unit) {
|
||||
var fec by remember { mutableStateOf(settings.fec) }
|
||||
var redundancy by remember { mutableStateOf(settings.redundancyDelay) }
|
||||
var copies by remember { mutableStateOf(settings.redundancyCopies) }
|
||||
var receiveBuffer by remember { mutableStateOf(settings.receiveBuffer) }
|
||||
|
||||
SubScreen("Network", onBack) { padding ->
|
||||
Column(Modifier.padding(padding).verticalScroll(rememberScrollState()).padding(bottom = 8.dp)) {
|
||||
@@ -57,6 +58,12 @@ fun NetworkSettingsScreen(vm: SessionController, onBack: () -> Unit) {
|
||||
change { redundancyCopies = it }
|
||||
}
|
||||
}
|
||||
|
||||
Section("Receive")
|
||||
Picker("Extra buffering", Settings.RECEIVE_BUFFERS.map { it to if (it == 0) "Off" else "$it ms" }, receiveBuffer) {
|
||||
receiveBuffer = it
|
||||
change { this.receiveBuffer = it }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ fun SettingsScreen(vm: SessionController, onContacts: () -> Unit, onBack: () ->
|
||||
LinkRow("Sound Settings", "Devices, transmission, voice activation, processing, volume", "PLAYBACK") {
|
||||
page = SettingsPage.SOUND
|
||||
}
|
||||
LinkRow("Network", "Bitrate, error correction, redundancy", "PING_4") {
|
||||
LinkRow("Network", "Bitrate, error correction, redundancy, buffering", "PING_4") {
|
||||
page = SettingsPage.NETWORK
|
||||
}
|
||||
LinkRow("Design", "Icon pack, country flags, description pictures", "GUISETUP") {
|
||||
|
||||
Reference in New Issue
Block a user