Skip to content
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

Streamed resolution doesn't match set resolution in moonlight (blurryness) #1466

Open
MikeDrewitt opened this issue Nov 19, 2024 · 2 comments

Comments

@MikeDrewitt
Copy link

MikeDrewitt commented Nov 19, 2024

Describe the bug
Video stream resoultion does not match resolution set in Moonlight settings. This causes blurryness when rendering the screen due to pixel misalignments.

Notably, this does not happen for every resolution. And if it helps, the WM I'm using is hyprland 0.45.0 (though this has been happening on previous version of hyprland as well).

Steps to reproduce
Connect to moonlight with resolution of 3440x1440 (either set via native option, or custom). The video stream will read out 3456x1440 after connecting.

Screenshots
Stream details
Resolution settings in moonlight

Note: The resolution set does not match the streamed resolution

Other Moonlight clients
Does not occur using the iOS client. I cannot test on the android client since the android client doesn't let you set a custom resolution.

Moonlight settings (please complete the following information)
image

Client PC details

  • OS: [e.g. Arch Linux]
  • Moonlight Version: [e.g. v6.1.0]
  • GPU: [e.g. AMD Radeon RX 7900XT]
  • Linux package type (if applicable): Installed via the AUR

Server PC details

  • OS: [e.g. Arch Linux]
  • Sunshine or GeForce Experience version: [e.g. Sunshine v0.23.1]
  • GPU: [e.g. AMD Radeon RX 7800 XT]
  • GPU driver: [e.g. Mesa 24.2.7-arch1.1]

Moonlight Logs (please attach)

00:00:17 - FFmpeg: [AVHWDeviceContext @ 0x741f3859a300] VAAPI driver: Mesa Gallium driver 24.2.7-arch1.1 for AMD Radeon RX 7900 XT (radeonsi, navi31, LLVM 18.1.8, DRM 3.59, 6.11.8-arch1-2).
00:00:17 - FFmpeg: [AVHWDeviceContext @ 0x741f3859a300] Driver not found in known nonstandard list, using standard behaviour.
00:00:17 - SDL Info (0): Selected overlay subpicture format: BGRA8888
00:00:17 - SDL Warn (0): Vulkan device 'AMD Radeon RX 7900 XT (RADV NAVI31)' does not support HDR10 (ST.2084 PQ)
00:00:17 - SDL Error (0): No suitable HDR-capable Vulkan devices found!
00:00:17 - SDL Info (0): Vulkan rendering device chosen: AMD Radeon RX 7900 XT (RADV NAVI31)
00:00:17 - SDL Info (0): Frame pacing disabled: target 165 Hz with 165 FPS stream
00:00:17 - SDL Info (0): Using VAAPI accelerated renderer on wayland
00:00:17 - SDL Info (0): FFmpeg-based video decoder chosen
00:00:17 - SDL Info (0): Dropping window event during flush: 6 (3440 1440)
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] Frame 0:  size 3456x1440  upscaled 3456  render 3456x1440  subsample 2x2  bitdepth 10  tiles 1x1.
00:00:17 - SDL Info (0): IDR frame request sent
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] Total OBUs on this packet: 4.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] OBU idx:0, type:2, content available:1.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] OBU idx:1, type:1, content available:1.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] OBU idx:2, type:3, content available:1.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] Format vaapi chosen by get_format().
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] Format vaapi requires hwaccel av1_vaapi initialisation.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] Considering format 0x3231564e -> nv12.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] Considering format 0x30313050 -> p010le.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] Ignoring unknown format 0x36313050.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] Picked p010le (0x30313050) as best match for yuv420p10le.
00:00:17 - FFmpeg: [AVHWFramesContext @ 0x741f1802ed40] Created surface 0x1.
00:00:17 - FFmpeg: [AVHWFramesContext @ 0x741f1802ed40] Direct mapping possible.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] Decode context initialised: 0x2/0x3.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] AV1 decode get format: vaapi.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] Param buffer (type 0, 1160 bytes) is 0x4.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] OBU idx:3, type:4, content available:1.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] Slice 0 param buffer (40 bytes) is 0x5.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] Slice 0 data buffer (19144 bytes) is 0x6.
00:00:17 - FFmpeg: [av1 @ 0x741f38026980] Decode to surface 0x1.
00:00:17 - SDL Info (0): Received first audio packet after 400 ms
00:00:17 - SDL Info (0): Initial audio resync period: 500 milliseconds
@Allsimon
Copy link

I also noticed that the performance overlay stats shows:

  • Video stream: 1920x1088 with HEVC codec
  • Video stream: 1920x1080 with H.264 codec

The stream is blurry in both cases though and they both log SDL Info (0): VDPAU surface size: 1920x1088

@cgutman
Copy link
Member

cgutman commented Dec 20, 2024

I believe this is alignment padding that is included in the bitstream from the host due to a hardware limitation in the AMD video encoder. See https://gitlab.freedesktop.org/mesa/mesa/-/issues/9185#note_1954937

We might be able to do better handling it, but that's why it's there.

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

No branches or pull requests

3 participants