LizardByte / Sunshine

Self-hosted game stream host for Moonlight.
http://app.lizardbyte.dev/Sunshine/
GNU General Public License v3.0
16.33k stars 784 forks source link

Wrong screen orientation on Steam Deck (Linux) using KMS #2439

Closed Lamfi closed 3 months ago

Lamfi commented 3 months ago

Is there an existing issue for this?

Is your issue described in the documentation?

Is your issue present in the nightly release?

Describe the Bug

Fedora 39 - Bazzite Linux Steam Deck Wayland image

Sunshine from ujust setup-sunshine also tried from dnf Same problem when i try x11 :0

Expected Behavior

No response

Additional Context

No response

Host Operating System

Linux

Operating System Version

Fedora 39 - Bazzite Linux

Architecture

64 bit

Sunshine commit or version

Last version

Package

Linux - pkg.tar.zst

GPU Type

AMD

GPU Model

Steam Deck custom

GPU Driver/Mesa Version

idk

Capture Method (Linux Only)

No response

Config

capture = kms
encoder = vaapi

Apps

No response

Relevant log output

SadShrimp, [18.04.2024 9:54]
[2024:04:18:09:56:57]: Info: Sunshine version: 0.23.0.8999264
[2024:04:18:09:56:57]: Info: /dev/dri/card1 -> evdi
[2024:04:18:09:56:57]: Warning: No render device name for: /dev/dri/card1
[2024:04:18:09:56:57]: Info: /dev/dri/card2 -> evdi
[2024:04:18:09:56:57]: Warning: No render device name for: /dev/dri/card2
[2024:04:18:09:56:57]: Info: /dev/dri/card3 -> evdi
[2024:04:18:09:56:57]: Warning: No render device name for: /dev/dri/card3
[2024:04:18:09:56:57]: Info: /dev/dri/card4 -> evdi
[2024:04:18:09:56:57]: Warning: No render device name for: /dev/dri/card4
[2024:04:18:09:56:57]: Info: /dev/dri/card5 -> amdgpu
[2024:04:18:09:56:57]: Error: Environment variable WAYLAND_DISPLAY has not been defined
[2024:04:18:09:56:57]: Info: Trying encoder [vaapi]
[2024:04:18:09:56:57]: Info: Screencasting with KMS
[2024:04:18:09:56:57]: Info: /dev/dri/card1 -> evdi
[2024:04:18:09:56:57]: Warning: No render device name for: /dev/dri/card1
[2024:04:18:09:56:57]: Info: /dev/dri/card2 -> evdi
[2024:04:18:09:56:57]: Warning: No render device name for: /dev/dri/card2
[2024:04:18:09:56:57]: Info: /dev/dri/card3 -> evdi
[2024:04:18:09:56:57]: Warning: No render device name for: /dev/dri/card3
[2024:04:18:09:56:57]: Info: /dev/dri/card4 -> evdi
[2024:04:18:09:56:57]: Warning: No render device name for: /dev/dri/card4
[2024:04:18:09:56:57]: Info: /dev/dri/card5 -> amdgpu
[2024:04:18:09:56:57]: Info: Found monitor for DRM screencasting
[2024:04:18:09:56:57]: Info: Found connector ID [107]
[2024:04:18:09:56:57]: Info: Found cursor plane [90]
[2024:04:18:09:56:57]: Info: System tray created
[2024:04:18:09:56:57]: Info: SDR color coding [Rec. 601]
[2024:04:18:09:56:57]: Info: Color depth: 8-bit
[2024:04:18:09:56:57]: Info: Color range: [JPEG]
[2024:04:18:09:56:57]: Error: [h264_vaapi @ 0x7fbcfc039e80] No usable encoding entrypoint found for profile VAProfileH264High (7).
[2024:04:18:09:56:57]: Info: Retrying with fallback configuration options for [h264_vaapi] after error: Функция не реализована
[2024:04:18:09:56:57]: Warning: [h264_vaapi @ 0x55fe962d77c0] Driver does not support some wanted packed headers (wanted 0xd, found 0x1).
[2024:04:18:09:56:58]: Info: SDR color coding [Rec. 601]
[2024:04:18:09:56:58]: Info: Color depth: 8-bit
[2024:04:18:09:56:58]: Info: Color range: [JPEG]
[2024:04:18:09:56:58]: Error: [hevc_vaapi @ 0x55fe96c1c740] No usable encoding entrypoint found for profile VAProfileHEVCMain (17).
[2024:04:18:09:56:58]: Info: Retrying with fallback configuration options for [hevc_vaapi] after error: Функция не реализована
[2024:04:18:09:56:58]: Warning: [hevc_vaapi @ 0x55fe96c31ec0] Driver does not support some wanted packed headers (wanted 0xd, found 0x1).
[2024:04:18:09:56:58]: Info: SDR color coding [Rec. 601]
[2024:04:18:09:56:58]: Info: Color depth: 8-bit
[2024:04:18:09:56:58]: Info: Color range: [JPEG]
[2024:04:18:09:56:58]: Error: [av1_vaapi @ 0x55fe96c1c740] No usable encoding entrypoint found for profile VAProfileAV1Profile0 (32).
[2024:04:18:09:56:58]: Info: Retrying with fallback configuration options for [av1_vaapi] after error: Функция не реализована
[2024:04:18:09:56:58]: Error: [av1_vaapi @ 0x55fe96c31ec0] No usable encoding entrypoint found for profile VAProfileAV1Profile0 (32).
[2024:04:18:09:56:58]: Error: Could not open codec [av1_vaapi]: Функция не реализована
[2024:04:18:09:56:58]: Info: SDR color coding [Rec. 601]
[2024:04:18:09:56:58]: Info: Color depth: 8-bit
[2024:04:18:09:56:58]: Info: Color range: [JPEG]
[2024:04:18:09:56:58]: Error: [av1_vaapi @ 0x55fe96c1c740] No usable encoding entrypoint found for profile VAProfileAV1Profile0 (32).
[2024:04:18:09:56:58]: Info: Retrying with fallback configuration options for [av1_vaapi] after error: Функция не реализована
[2024:04:18:09:56:58]: Error: [av1_vaapi @ 0x55fe963a1540] No usable encoding entrypoint found for profile VAProfileAV1Profile0 (32).
[2024:04:18:09:56:58]: Error: Could not open codec [av1_vaapi]: Функция не реализована
[2024:04:18:09:56:58]: Info: Screencasting with KMS
[2024:04:18:09:56:58]: Info: /dev/dri/card1 -> evdi

SadShrimp, [18.04.2024 9:54]
[2024:04:18:09:56:58]: Warning: No render device name for: /dev/dri/card1
[2024:04:18:09:56:58]: Info: /dev/dri/card2 -> evdi
[2024:04:18:09:56:58]: Warning: No render device name for: /dev/dri/card2
[2024:04:18:09:56:58]: Info: /dev/dri/card3 -> evdi
[2024:04:18:09:56:58]: Warning: No render device name for: /dev/dri/card3
[2024:04:18:09:56:58]: Info: /dev/dri/card4 -> evdi
[2024:04:18:09:56:58]: Warning: No render device name for: /dev/dri/card4
[2024:04:18:09:56:58]: Info: /dev/dri/card5 -> amdgpu
[2024:04:18:09:56:58]: Info: Found monitor for DRM screencasting
[2024:04:18:09:56:58]: Info: Found connector ID [107]
[2024:04:18:09:56:58]: Info: Found cursor plane [90]
[2024:04:18:09:56:59]: Info: SDR color coding [Rec. 709]
[2024:04:18:09:56:59]: Info: Color depth: 10-bit
[2024:04:18:09:56:59]: Info: Color range: [JPEG]
[2024:04:18:09:56:59]: Error: [hevc_vaapi @ 0x55fe96c1c740] No usable encoding entrypoint found for profile VAProfileHEVCMain10 (18).
[2024:04:18:09:56:59]: Info: Retrying with fallback configuration options for [hevc_vaapi] after error: Функция не реализована
[2024:04:18:09:56:59]: Warning: [hevc_vaapi @ 0x55fe964a0840] Driver does not support some wanted packed headers (wanted 0xd, found 0x1).
[2024:04:18:09:56:59]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2024:04:18:09:56:59]: Info: 
[2024:04:18:09:56:59]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2024:04:18:09:56:59]: Info: 
[2024:04:18:09:56:59]: Info: Found H.264 encoder: h264_vaapi [vaapi]
[2024:04:18:09:56:59]: Info: Found HEVC encoder: hevc_vaapi [vaapi]
[2024:04:18:09:56:59]: Info: Adding avahi service Sunshine
[2024:04:18:09:56:59]: Info: Configuration UI available at [https://localhost:47990]
[2024:04:18:09:57:00]: Info: Avahi service Sunshine successfully established.
[2024:04:18:09:57:07]: Info: Opening UI from system tray
[2024:04:18:09:57:07]: Info: Opened url [https://localhost:47990]
[2024:04:18:09:57:11]: Info: Web UI: [127.0.0.1] -- not authorized
[2024:04:18:09:57:13]: Info: Web UI: [127.0.0.1] -- not authorized
gschintgen commented 3 months ago

It took me a moment to realize what the actual issue even is. Your screenshot is showing a working stream...

You might want to edit the title and specify something like "Wrong screen orientation on Steam Deck (Linux) using KMS".

The Steam Deck seems to use a portrait mode display in a landscape device. This is then accounted for in software. Ecept that Sunshine fails to detect this. (Or it does and it's actually Moonlight that misinterprets the incoming stream.)

ReenigneArcher commented 3 months ago

I thought the orientation issue was fixed way back in https://github.com/LizardByte/Sunshine/pull/711

But maybe something changed since then?

Lamfi commented 3 months ago

Okay, it main problem of KMS and i changed environment to x11 and in advance settings specific capture mode to X11 and all fixed. Thx for help.

gschintgen commented 3 months ago

Thanks for posting the workaround. It's still weird that it does not work correctly with kmsgrab.