feat(host/gamestream): priority-boost the video + send threads like the native path
The GameStream video thread ran unboosted on Linux and the send thread only got the Windows MMCSS call; both now use boost_thread_priority (Linux nice -10/-5, Windows HIGHEST/ABOVE_NORMAL + session tuning). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,9 @@ pub fn start(
|
|||||||
let _ = std::thread::Builder::new()
|
let _ = std::thread::Builder::new()
|
||||||
.name("punktfunk-video".into())
|
.name("punktfunk-video".into())
|
||||||
.spawn(move || {
|
.spawn(move || {
|
||||||
|
// Same scheduling posture as the native path's capture/encode thread (Linux nice -10 /
|
||||||
|
// Windows HIGHEST + session tuning) — GameStream previously ran unboosted on Linux.
|
||||||
|
crate::punktfunk1::boost_thread_priority(true);
|
||||||
tracing::info!(?cfg, "video stream starting");
|
tracing::info!(?cfg, "video stream starting");
|
||||||
if let Err(e) = run(
|
if let Err(e) = run(
|
||||||
cfg,
|
cfg,
|
||||||
@@ -391,8 +394,9 @@ fn spawn_sender(
|
|||||||
std::thread::Builder::new()
|
std::thread::Builder::new()
|
||||||
.name("punktfunk-send".into())
|
.name("punktfunk-send".into())
|
||||||
.spawn(move || {
|
.spawn(move || {
|
||||||
// GameStream send thread: Windows session tuning + MMCSS (no-op off Windows).
|
// Transmit thread: above-normal, matching the native path's send thread (includes the
|
||||||
crate::session_tuning::on_hot_thread();
|
// Windows session tuning/MMCSS this used to call directly; adds the Linux nice -5).
|
||||||
|
crate::punktfunk1::boost_thread_priority(false);
|
||||||
// Chunk pacing: 16 packets per burst, bursts spread across the send budget.
|
// Chunk pacing: 16 packets per burst, bursts spread across the send budget.
|
||||||
const PACE_CHUNK: usize = 16;
|
const PACE_CHUNK: usize = 16;
|
||||||
let budget = frame_interval.mul_f32(0.75);
|
let budget = frame_interval.mul_f32(0.75);
|
||||||
|
|||||||
Reference in New Issue
Block a user