Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

HW encoding on Intel Celeron N5105 on Linux seems to be broken

Open frumble opened this issue 1 year ago • 3 comments

Describe the Bug

Hi, Sunshine does just use CPU encoding on my Celeron N5105, considering it is using 22% CPU. OS is Manjaro Linux, intel-media-driver is installed. Look at the vainfo output.

When I start Sunshine in verbose mode, I get:

[hevc_vaapi @ 0x555a5fa77200] Using nv12 as format of reconstructed frames.
[AVHWFramesContext @ 0x555a5e2c8cc0] Created surface 0x1.
[AVHWFramesContext @ 0x555a5e2c8cc0] Direct mapping possible.
[hevc_vaapi @ 0x555a5fa77200] Using fixed QP = 28 / 28 / 34 for IDR- / P- / B-frames.
[hevc_vaapi @ 0x555a5fa77200] Using level 4.
[hevc_vaapi @ 0x555a5fa77200] Input frame: 1920x1080 (1).
[hevc_vaapi @ 0x555a5fa77200] Pick forced IDR-picture to encode next.
[hevc_vaapi @ 0x555a5fa77200] Issuing encode for pic 0/0 as type IDR.
[hevc_vaapi @ 0x555a5fa77200] No reference pictures.
[hevc_vaapi @ 0x555a5fa77200] Input surface is 0.
[hevc_vaapi @ 0x555a5fa77200] Recon surface is 0x1.
[hevc_vaapi @ 0x555a5fa77200] Allocated output buffer 0
[hevc_vaapi @ 0x555a5fa77200] Output buffer is 0.
[hevc_vaapi @ 0x555a5fa77200] Param buffer (22) is 0x1.
[hevc_vaapi @ 0x555a5fa77200] Param buffer (27) is 0x2.
[hevc_vaapi @ 0x555a5fa77200] Param buffer (23) is 0x3.
[hevc_vaapi @ 0x555a5fa77200] Packed header buffer (1) is 0x4/0x5 (792 bits).
[hevc_vaapi @ 0x555a5fa77200] Slice 0: 0-33 (34 rows), 0-2039 (2040 blocks).
[hevc_vaapi @ 0x555a5fa77200] Packed header buffer (3) is 0x6/0x7 (64 bits).
[hevc_vaapi @ 0x555a5fa77200] Param buffer (24) is 0x8.
[hevc_vaapi @ 0x555a5fa77200] Failed to end picture encode issue: 24 (internal encoding error).
[hevc_vaapi @ 0x555a5fa77200] Encode failed: -5.
[hevc_vaapi @ 0x555a5fa77200] Freed output buffer 0
[2022:09:14:21:00:09]: Error: Could not send a frame for encoding: Input/output error
…
[AVHWDeviceContext @ 0x555a5e3f3400] Format 0x30313459 -> unknown.
[AVHWDeviceContext @ 0x555a5e3f3400] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 22.4.4 ().
[AVHWDeviceContext @ 0x555a5e3f3400] Driver not found in known nonstandard list, using standard behaviour.
[AVHWFramesContext @ 0x555a5e3f3100] Unsupported format: yuv420p10le.
[2022:09:14:21:00:09]: Info: 
[2022:09:14:21:00:09]: Info: //////////////////////////////////////////////////////////////
[2022:09:14:21:00:09]: Info: //                                                          //
[2022:09:14:21:00:09]: Info: // Ignore any errors mentioned above, they are not relevant //
[2022:09:14:21:00:09]: Info: //                                                          //
[2022:09:14:21:00:09]: Info: //////////////////////////////////////////////////////////////

yuv420p10le? The monitor configuration isn’t 10 bit but 8 bit. When I select HEVC in Moonlight, the Moonlight client shows me a message that the host doesn’t support HEVC even it should, considering the vainfo output. This is another proof that the HW encoding doesn’t work at all on this system.

Expected Behavior

No response

Additional Context

No response

Host Operating System

Linux

Operating System Version

Manjaro

Architecture

64 bit

Sunshine Version

0.14.1

GPU Type

Intel

GPU Model

Intel iHD

GPU Driver/Mesa Version

22.1.7

Capture Method (Linux Only)

No response

Relevant log output

vainfo: VA-API version: 1.15 (libva 2.15.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.4.4 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSliceLP
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSliceLP
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile1            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileVP9Profile3            : VAEntrypointVLD
      VAProfileHEVCMain422_10         : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_10         : VAEntrypointVLD
      VAProfileHEVCMain444_10         : VAEntrypointEncSliceLP

frumble avatar Sep 14 '22 19:09 frumble

Try intel_gpu_top and see if the video part is registering activity

praxis88 avatar Sep 23 '22 02:09 praxis88

Hey, intel_gpu_top is reporting around 70% load on "Video" with installed intel-media-driver and libva-intel-driver and the 22% CPU load like reported above. When I deinstall these packages, the load on "Video" goes down to 0% and the CPU load to up to 50%. So, this means the hardware encoding seems to be working. But still, why not in H.265, why does my client report that the server doesn’t support this codec when it clearly should? And comparing Sunshine performance with HW encoding and NoMachine encoding without HW encoding, NoMachine feels faster with less frame drops at around the same CPU load as Sunshine with HW encoding, at least on this cheap Celeron N5105 platform.

frumble avatar Oct 06 '22 22:10 frumble

@frumble @ReenigneArcher Sunshine seems to be broken with the newer Intel drivers.

You can use the Flatpak version instead.

https://github.com/LizardByte/Sunshine/releases/download/v0.14.1/sunshine.flatpak

More info here: https://github.com/istori1/Easy-Tan

istori1 avatar Oct 28 '22 10:10 istori1

This issue is stale because it has been open for 90 days with no activity. Comment or remove the stale label, otherwise this will be closed in 10 days.

LizardByte-bot avatar Jan 27 '23 00:01 LizardByte-bot

This issue was closed because it has been stalled for 10 days with no activity.

LizardByte-bot avatar Feb 06 '23 10:02 LizardByte-bot