Repository navigation
Disable Wi-Fi power saving during streaming #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ const geforce_catalog = @import("../provider/geforce_now/catalog_service.zig"); | |
| const geforce_session = @import("../provider/geforce_now/session_client.zig"); | ||
| const geforce_webrtc = @import("../provider/geforce_now/webrtc_session.zig"); | ||
| const geforce_ads = @import("../provider/geforce_now/ad_playback.zig"); | ||
| const wifi_power_save = @import("../platform/linux/wifi_power_save.zig"); | ||
|
|
||
| const c = @cImport({ | ||
| @cInclude("SDL2/SDL.h"); | ||
|
|
@@ -86,6 +87,7 @@ pub const Release = struct { | |
| geforce_catalog: ?*geforce_catalog.Service = null, | ||
| provider: ?Provider = null, | ||
| curl_initialized: bool = false, | ||
| wifi: wifi_power_save.Guard = .{}, | ||
| requested_title: [128]u8 = [_]u8{0} ** 128, | ||
| title_id: [128]u8 = [_]u8{0} ** 128, | ||
| title_name: [192]u8 = [_]u8{0} ** 192, | ||
|
|
@@ -490,6 +492,7 @@ pub const Release = struct { | |
|
|
||
| pub fn createSession(self: *Release) Result { | ||
| if (self.title_id[0] == 0) return .failed; | ||
| self.wifi.begin(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Render the loading screen before the Wi-Fi probe.
Proposed fix
|
||
| self.drawLoading("STARTING GAME", "ALLOCATING CLOUD SESSION", c.GO_HANDHELD_UI_ACTION_CANCEL); | ||
| debug("Creating session ({s})\n", .{std.mem.sliceTo(&self.title_id, 0)}); | ||
| if (self.provider == .geforce_now) { | ||
|
|
@@ -840,6 +843,7 @@ pub const Release = struct { | |
| self.geforce_cloud.?.stop() catch |err| | ||
| std.debug.print("GeForce NOW session cleanup failed: {s}\n", .{@errorName(err)}); | ||
| } | ||
| self.wifi.end(); | ||
| } | ||
|
|
||
| pub fn resetSession(self: *Release) Result { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Restoration only happens on normal shutdown paths. A panic, SIGKILL, or SIGHUP (only INT/TERM are handled) leaves Wi-Fi power save disabled. Because the next launch sees it already disabled, it takes no ownership and never restores it, so it stays off until reboot. Consider persisting the changed interface to a state file and restoring it at startup.
Prompt for AI agents