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
mpv detects the wrong resolutin with wayland session if the session is using fractional zoom. #9443
Comments
I'm not sure I understand. Is your laptop actually 2560x1440 or not? If so, that's what should be reported at fullscreen regardless of whatever your scaling/dpi settings are. As an aside, clients in wayland can't do non-integer scaling so the 150% setting is completely done compositor side by plasma. |
sorry I seems to have forgotten to type that. also I dont understatnd this part (not being fluent in english) btw I dont know how kde plasma kwin window manager works and monitor scaling in xorg doesn't reduce the resolution but wayland does. I think my issue that I need to zoom for is that linux is very buggy and immature vs windows in handing ppi for screens (hdr and so on are also other issues that other systems ether solved or are solving, I hope red hat solves that) or maybe this is just kde fault but I tested with gnome too and text in firefox is very bad there too. now after than rant, I type my issue one more time. |
Can you post a log file? |
not right now. |
Very late here, but I understand what this issue is after reading it again. It's just crappy wayland fractional scaling behavior. What's happening is that mpv renders above your laptop's resolution (based on information from the compositor) and then the compositor downscales it to the "correct" one. This isn't fixable since wayland has no real fractional scaling atm. We would need this protocol. |
yeah. a command that I found helpful is wayland-info. that shows that way land sees a physical 1080p screen but a 72op logical one is used. |
I was searching for wayland scaling issue and found this. Haven't actually noticed it for mpv but apparently it's a XWayland wide issue that affects many applications. See https://bugs.kde.org/show_bug.cgi?id=389191 |
That's a scaling issue, but a totally different one. It's not related. |
It is same thing, scaling in Wayland breaks X11 apps. Same root cause - different ways it manifests (blurry apps, wrong resolution etc). This is https://youtu.be/AS9H8QrV5Ig what it does for me :D |
Please don't confuse this issue with xwayland problems. Xwayland has no hidpi support which leads to various scaling issues. That is not the issue in this ticket. mpv is a native wayland client that supports hidpi. The problem is that the wayland protocol does not support fractional scaling. |
Yeah I would highly recommend using only integer scaling with mpv because of this. For some applications, this behavior may not be that big of a deal, but for mpv it is awful. It's a great way to nuke your performance. |
when I reported this issues I didnt know it was a wayland issue. even when I reported it here right now I even have no way of confidently knowing what my whole desktop runs at when using 150% zoom in kde with wayland, because every app that I use seems to use a 720p screen in that scenario, when my physical screen is 1080p. as I explained on that bug try to view a picture(not video) that has the same pixels as your physical screen in this zoomed wayland mode and tell the program to show the picture in 100% zoom, you see it stretches beyond screen because that app is getting a, for my case, virtual 720p screen and so it stretches the 1080p beyond my screen and even if you dont notice it that much because of ,my-not-20-20-eye-sight or software magic/fu..kery, this still is a physic/math issue of matching a 1080 dots to 720 dots and again 720 to 1080 that cant happen. so basically we need for wayland to fix this and fix this correctly and stabilize before we try anything (if it is not fixed automatically in mpv because of wayland fix). I think we should keep this issue open and refer others that get this issue to it. so that others don't get confused and have all the available data we gathered in one place for this issue. |
this seems to affect all wayland wayland app views in weird ways. for example I have firefox on wayland and and in kde setting I have set my 1080p screen to 150% scaling so I can test and websites see a 720p screen,and also I have a addon that when I open a picture directly it shows in original resolution and also the resolution that it is displayed in and in full screen it shows the max view resolution for picture as 720p . so when I change firefox window size the resolution for that image changes but the max that addon sees is a 720p screen. now the weird part: so the image and firefox web sees a 720p but firefox process uses a 1440 graphic output. this is really bad for performance. remember this is not a video I am talking about. |
For reference, this Wayland protocol discussion describes this exact issue:
Looks like a workaround right now is to implement wl_viewporter to get it to render without going through a larger-than-native buffer but it has the downside of a potential off-by-one error.
|
Using viewporter alone is not really acceptable because that means the compositor does all the scaling which defeats one of the purposes of mpv. From the client side, there is no way to tell the difference between a normal integer scale (which works correctly) and a fractional scale so you would just be making it strictly worse for anyone on the former. The leading fractional scale proposal involves using viewporter though so I'll have to hook that up in the future anyway if it ever gets merged upstream. |
I knew about that. so firefox only sees that 1440 but somehow shows the 720p to webpages to achieve the zoom. |
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted because we want the compositor to handle all the scaling for that VO (i.e. just leave the default buffer scale of one). Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted because we want the compositor to handle all the scaling for that VO (i.e. just leave the default buffer scale of one). However, we are making viewport required (everyone supports this anyway) with this commit so go ahead and remove the redundant check in vo_dmabuf_wayland. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted because we want the compositor to handle all the scaling for that VO (i.e. just leave the default buffer scale of one). However, we are making viewport required (everyone supports this anyway) with this commit so go ahead and remove the redundant check in vo_dmabuf_wayland. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. As an aside, this makes the viewport protocol required for simplicity (but everyone supports that anyway). Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. As an aside, this makes the viewport protocol required for simplicity (but everyone supports that anyway). Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
I see that mpv is trying to implement fractional scaling support for wayland with the new protocol addition in wayland. Am I wrong to assume that if that protocol is implemented in both kde and mpv, for example a year from now, then if I use fraction scaling then the video at fullscreen would see my physical resolution regardless of scale, just like integer scaling ? as in my video screen in full screen for a 1080p movie would be 1080p for both native and scaled screen? so a pixel to pixel match? |
That's correct. KDE actually already implemented this in their master branch btw. I want to get around to finishing up the mpv implementation soon-ish (it's already 90% there; just need to test some more exotic cases). |
Some Addition Info for KDE: |
are those numbers dates? |
yes |
It won't take me that long to get this in master. Probably later this week or next week hopefully. As far as releases go, this wouldn't land until 0.36 which would be later down the road (i.e. likely near the end of this year). |
I am not a pro with graphic stack on any OS, but shouldn't the underlying desktop (Window manager) support it too for it to work? |
Right, you need both the application and compositor/window manager to support it. I was just saying I should be able to get support in git master before the next KDE release. |
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes #9443.
I'll just drop a workaround here, albeit for a very specific case - this exact issue, but under chromeos. 14" 1080p chromebook screen, default scaling is set to 864p and it looks great, but weston-info returns 2x scale and 1728p resolution, which mpv ends up scaling to, oversampling and ruining performance (no hardware-accelerated decoding under linux vm doesn't make it any better, and while opengl and as a result, gpu output, work just fine, N4020 with integrated graphics won't handle mpv displaying 60fps video at 1728p in such scenario).
Unfortunately, I guess it's strictly chromeos-related and there isn't anything similar under other desktops, at least nothing that I'm aware of. On the other hand, it'll likely take some time before necessary changes hit chromeos, so perhaps it'll help someone. Related docs: https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/vm_tools/sommelier/README.md |
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
I updated my mpv to the newest version via archlinux package manager today. I literally had two mpv running. desktop: plasma-wayland-session Version 5.27.6-2 so.... |
Important Information
Provide following Information:
Reproduction steps
I have removed xorg to debug a separate issue I have with my ram usage.
so I use wayland for now with plasma kde session.
and in both xorg and plasma I have set my scaling to 150% from setting panel ,monitor tab.
in xorg and wayland everything is zoomed so I can actually read on my small 14inch 1080p laptop.
but it seems that they use different ways for this zoom.
in xorg I still have the 1080 resolution and just the it is zoomed. so if I open a1080p movie in mpv and fullscreen it say native resolution is 1080 and scaled one the same.
but in wayland the resolution and laptop also changes with the zoom to 720p.
so far this a wayland/xorg difference/issue but the bug with mpv is that when I open a movie with mpv it thinks my laptop resolution is 1440p. so in the video info at fullscreen for scaled one it says 2560x1440
The text was updated successfully, but these errors were encountered: