moonlight-stream / moonlight-qt

GameStream client for PCs (Windows, Mac, Linux, and Steam Link)
GNU General Public License v3.0
10.81k stars 630 forks source link

Intel Iris Xe - H.265/HEVC broken #673

Closed xmorepixelx closed 3 years ago

xmorepixelx commented 3 years ago

Hi,

I just noticed that Intel Iris Xe driver - specifically 30.0.101.1069 - make H265 setting broken ( DX12 related ? ) Can we expect to have a fix for Moonlight-QT client, or, do we have to downgrade in order to be able to use it ?

Thx for the feedback

makedir commented 3 years ago

Same for me on UHD630 on 8th gen Intel 8750H, it is not Iris Xe only. Since I upgraded to 30.0.101.1069, Moonlight says the hardware doesnt support HEVC decoding anymore. Whats going on? Is this a bug of the Intel driver, so hevc decode is broken everywhere? I cant think it is just Moonlight related. Did Intel mess something up pr remove something in that driver?

Edit: Looked into Moonlight logs and this line is the culprit I guess:

00:00:00 - SDL Info (0): Detected buggy Intel GPU driver installed. Update your Intel GPU driver to enable HEVC!

So I guess this is just a bug in Moonlight code, with bad pattern detection. I guess because Intel changed the driver numbers

from 30.0.100 to 30.0.101. I would assume there is some stupid dirty code in Moonlight just looking at the last 4 digits of the driver, and the new 30.0.101.1069 is detected as an "old" driver, because of the 1069, which would be in the previous build a very old version, when it would have been xx.0.100.1069

This should be very easy and quickly to fix. Next time, better pattern detection please with regex.

cgutman commented 3 years ago

It's not a regex actually. It's the low word of a version number. The problem is the driver build number rolled over, forcing use of more digits than before. Moonlight's logic was correct until Intel changed the driver build number semantics.

Intel has a note on this and the updated driver version semantics on the driver download page

Note: The driver version numbering has rolled over from 100.9999 to 101.1069. This requires the use of all 7-digits instead of 4-digits for the driver build number. For more information, see Understanding the Intel® Graphics Driver Version Number.

Fortunately the fix is very simple.

makedir commented 3 years ago

It's not a regex actually. It's the low word of a version number. Fortunately the fix is very simple.

That is what I said. 100% what I said. Stupid coding. Just checking last 4 digits of the driver instead of proper regex usage. And easy to fix.

cgutman commented 3 years ago

A "proper regex" would not have caught this.

It's not as easy as just 1.2.3.4 < 2.3.4.5. Certain parts of the version have specific meanings that are unrelated to the chronological order of the driver releases (which is what Moonlight needs to check).

For example, the left-most portion of the version number is the WDDM version. Prior to version 100, the 3rd version field was a mapping of the "driver baseline" and doesn't indicate the chronology of the releases. On the graphics drivers download page, we can see that 15.45.34.5174 is actually an older driver than 15.36.41.5180 despite having a "higher version" in the traditional sense.

Using this "proper" version checking logic on drivers below version 100 would be incorrect. We would be catching the driver baseline as part of the build number which would result in incorrect matches as mentioned above.

See Intel's page on driver version semantics for more details on both the new and the old version semantics. Note that Moonlight sees the "Driver Version" column, not the "Release Version" column.

cgutman commented 3 years ago

Here is a build from our CI that contains the HEVC fix: https://ci.appveyor.com/project/cgutman/moonlight-qt/builds/41522148/job/dfckoea8961b0bir/artifacts

You can use that to use HEVC until the next official Moonlight release. Thanks for the report!

makedir commented 3 years ago

Here is a build from our CI that contains the HEVC fix: https://ci.appveyor.com/project/cgutman/moonlight-qt/builds/41522148/job/dfckoea8961b0bir/artifacts

You can use that to use HEVC until the next official Moonlight release. Thanks for the report!

There is no installer version without debug.

cgutman commented 3 years ago

Yeah, unfortunately the way the version number is stamped on the installer makes producing installers for dev builds problematic. They are stamped with whatever is in version.txt in the repo, which happens to be the last official release version. Producing multiple installers with the same version causes issues for upgrades (like if you wanted to upgrade from the latest release to a CI version, or a CI version to another CI version).

You can delete portable.dat in the extracted portable Moonlight folder and then Moonlight will act like a non-portable installation (using your existing paired PCs and settings). You could probably even replace your existing installation in Program Files with the dev build binaries if you wanted. I'm not sure if that would cause problems with Windows Installer when you try to upgrade though.

makedir commented 3 years ago

Wouldnt it be enough to replace moonlight.exe or wouldnt that work in this case?

cgutman commented 3 years ago

That will probably work, but you may also need SDL2.dll.

makedir commented 3 years ago

That will probably work, but you may also need SDL2.dll.

Tried replacing, but not the app is broken, settings are ignored and not saved. Ok never mind was because of the portable.dat.

cgutman commented 2 years ago

Fix released in v3.2.0.