Skip to content

feat(webos): switch to game picture mode while streaming - #319

Open
zampierilucas wants to merge 1 commit into
punktfunk:mainfrom
zampierilucas:feat/game-picture-mode
Open

zampierilucas wants to merge 1 commit into
punktfunk:mainfrom
zampierilucas:feat/game-picture-mode

Conversation

@zampierilucas

Copy link
Copy Markdown

Sets the TV's picture mode to "game" when a stream starts and puts the previous mode back when it ends, so the panel skips the extra picture processing while you play.

The mode goes through settingsservice (getSystemSettings and setSystemSettings, category picture) on the in process LS2 bus, Bus::call_text is the one new helper. The previous mode is saved to picture-mode.prev in the app dir before switching and restored when the stream guard drops. It's only restored if the mode is still "game", so if you change it mid stream that sticks. If the app dies while in game mode, the next launch restores the saved mode. If the TV is already in game mode nothing is touched, and any failure is just logged.

It's on by default and controlled by webos.game_picture in settings.json. The settings screen lives in pf-console-ui so there's no row for it here yet.

Heads up on the effect, on my C5 with HEVC the TV already switches itself to game when the NDL video starts, so there it's a no op. It does matter for video that doesn't go through NDL (the PyroWave path in #317) and for TVs or webOS versions that don't switch on their own. The settingsservice calls are in the public group, which store installed apps like GeForce NOW also get, so a normal install should be fine, but I couldn't test a store install.

Tested with the armv7 release build and cargo fmt. Save, switch, restore on exit and on SIGTERM, and recovery after kill -9 were tested on a PyroWave stream on an LG C5, plus the HEVC no op on this branch.

Sets the TV's pictureMode to "game" when a stream starts and puts the
previous mode back when it ends. The previous mode is parked in
picture-mode.prev in the app dir, so a crash or kill is repaired on the
next launch. A mode changed by the user mid-stream is left alone.

Controlled by the webos.game_picture setting, on by default. The shell's
settings screen lives in punktfunk, so there is no row for it yet; set it
to false in settings.json to turn it off.

Signed-off-by: Lucas Zampieri <lcasmz54@gmail.com>
@dyptan-io

Copy link
Copy Markdown
Collaborator

It doesn’t seem to handle HDR picture mode, or am I wrong? We already had the implementation that handled SDR, HDR and sound mode, but it was removed after we changed the UI. @enricobuehler can we get the option from the console-ui for it please?

@zampierilucas

Copy link
Copy Markdown
Author

@dyptan-io oh you're right, I only did the SDR "game" preset, I read on the website that it just suggests to do it manually and thought it just had not been implemented yet and I didn't know about the old game_mode.rs.
Also the old way went through the Homebrew Channel exec as root because settingsservice denied the public bus there. This PR calls getSystemSettings/setSystemSettings directly from the app's own LS2 handle, and that works on my C5 (webOS 10.3.1) as a dev install, so at least there it doesn't need root, but I haven't tried a store install tho.

But either way, happy to close or rework this or just close in favor of a better approach.

@dyptan-io

Copy link
Copy Markdown
Collaborator

If it works on non-rooted devices, it makes your approach much better. Let me test it on my rooted TV to see if it works before committing to more polish.

@dyptan-io

Copy link
Copy Markdown
Collaborator

It worked on my TV, but I'm rooted. Let's get the HDR and prettify it a bit, then we would need the pf-console setting for it.

@enricobuehler

Copy link
Copy Markdown
Member

I can add the toggle, I would propose making it an advanced option that's on by default.

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.

3 participants