Jump to content

Unable to use HW acceleration


agottschling

Recommended Posts

agottschling

Hi Emby Team,

I've been noticing recently that HW acceleration isn't active when I watch content from my server. I've attached logs below, and I'm noticing the following error in the logs:

19:07:29.327 Error creating a QSV device
19:07:29.327 qsv hwaccel requested for input stream #0:0, but cannot be initialized.
19:07:29.327 Error while decoding stream #0:0: No such device or address
19:07:29.327 [AVHWDeviceContext @ 0xd57ac0] libva: /opt/emby-server/extra/lib/dri/iHD_drv_video.so init failed
19:07:29.327 [AVHWDeviceContext @ 0xd57ac0] Failed to initialise VAAPI connection: 1 (operation failed).
19:07:29.327 Error creating a QSV device

This error repeats constantly until it gives up and ends up doing software transcoding. For context, this used to work flawlessly on the exact same hardware.

Anything I can try to fix this?

The physical host is Fedora server 35 running on a Sandy Bridge Mac Mini Server

ffmpeg-transcode-b6453c3d-7980-498f-8146-88e0a59b1353_1.txthardware_detection-63782103926.txtffmpeg-transcode-b0c0b155-982a-4a97-b39e-66abd2a2032d_1.txt

 

EDIT:  Here's the output of vainfo as well:

agottschling@MediaServer /o/e/bin> uname -a
Linux MediaServer 5.15.17-200.fc35.x86_64 #1 SMP Thu Jan 27 16:29:05 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
agottschling@MediaServer /o/e/bin> ./emby-vainfo
error: can't connect to X server!
libva info: VA-API version 1.12.0
libva info: Trying to open /opt/emby-server/extra/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_12
libva error: /opt/emby-server/extra/lib/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: Trying to open /opt/emby-server/extra/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_12
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.12 (libva 2.13.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Ivybridge Mobile - 2.4.1
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD
agottschling@MediaServer /o/e/bin>

 

Edited by agottschling
Link to comment
Share on other sites

Q-Droid

Your log shows HEVC media which Sandy Bridge can't handle in hardware. This looks like a HW detection issue and while @softworkz may be a wizard even he can't make a Sandy Bridge CPU decode HEVC in HW...or can he?

 

  • Haha 1
Link to comment
Share on other sites

agottschling
2 hours ago, Q-Droid said:

Your log shows HEVC media which Sandy Bridge can't handle in hardware. This looks like a HW detection issue and while @softworkz may be a wizard even he can't make a Sandy Bridge CPU decode HEVC in HW...or can he?

 

So, I'm aware that it can't encode in HEVC, but it's transcoding to H.264, which SB can do in HW. I'm OK doing software decode as long as it can encode using hardware. Hence my confusion.

Link to comment
Share on other sites

Q-Droid

Does your Emby server show an active HEVC hardware decoder in the Transcoding settings? If it does then disable the decoder manually and try the playback again. If no HEVC HW decoders are listed/enabled then the devs will have to figure out why it's trying to decode in HW when it doesn't support it.

Link to comment
Share on other sites

agottschling

Decoders show the following (I was previously on auto settings for transcoding), and encoders only show H.264 for VAAPI and QS.

I'm not entirely sure if the SB iGPU can decode HEVC or not, but it's showing on the list. Will try disabling it and see how it goes.

EDIT: According to Intel, HEVC encode/decode support didn't start until 6th Gen CPUs (Skylake?). So at a minimum, there is a bug with regards to HW support here.

image.png.514cf8b74b011b2e2618677c40655d4f.png

Edited by agottschling
Added HEVC decode info
Link to comment
Share on other sites

You could also try the 4.7 beta server and see if the detection has improved with that. That would be good info to know.

Link to comment
Share on other sites

agottschling
21 minutes ago, Luke said:

You could also try the 4.7 beta server and see if the detection has improved with that. That would be good info to know.

Is it possible to roll back after upgrading to the beta? I'd much prefer to stay on production builds if possible.

Link to comment
Share on other sites

agottschling
7 hours ago, Q-Droid said:

Does your Emby server show an active HEVC hardware decoder in the Transcoding settings? If it does then disable the decoder manually and try the playback again. If no HEVC HW decoders are listed/enabled then the devs will have to figure out why it's trying to decode in HW when it doesn't support it.

Update: Disabling the HEVC decoder for HW Transcoding allowed the episode to encode using HW acceleration. So it appears that the issue is that SB CPUs (and maybe more) are incorrectly being detected as having HEVC Decode capability.

image.png.1f18a01edcc5e4250ea896b70d4aa73c.png

Edited by agottschling
add image
Link to comment
Share on other sites

Q-Droid

Without test cases and data it could be hard to root out these detection problems and why Luke suggested trying the beta server. But if you want to remain on the stable release and are satisfied with the workaround then I think you're set. At least until the next release which could possibly have improved detection and you wouldn't have to override.

 

  • Like 1
Link to comment
Share on other sites

Happy2Play
2 hours ago, agottschling said:

@Luke@Q-Droid Any thoughts on the above?

Q-Droid called it above.

That is why Luke was asking if you got the same results in 4.7 as this would be a defect in hardware detect as you should not have the decoder listed as the hardware itself does not support it in a 3rd gen Sandy Bridge.  

Otherwise you will just have to ensure that decoder is disabled.

Edited by Happy2Play
Link to comment
Share on other sites

agottschling
16 minutes ago, Happy2Play said:

Q-Driod called it above.

That is why Luke was asking if you got the same results in 4.7 as this would be a defect in hardware detect as you should not have the decoder listed as the hardware itself does not support it in a 3rd gen Sandy Bridge.  Unless the driver is doing something odd with your hardware.

Otherwise you will just have to ensure that decoder is disabled.

Ok. Let me see if I can spin up a VM or something to test. I'd rather not compromise my production server

Link to comment
Share on other sites

Hi,

thanks for the logs.

On 3/6/2022 at 1:34 AM, agottschling said:

This error repeats constantly until it gives up and ends up doing software transcoding. For context, this used to work flawlessly on the exact same hardware.

The change is that we have added QSV hwa support to work out-of-the-box on Linux which we didn't have before.

At the same time, QSV doesn't support Sandy Bridge, Ivy Bridge and Haswell at all: https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk_release_notes.md#system-requirements

Also, the iHD driver doesn't support Sandy Bridge.

Just out of curiosity to see what happens, you could try to enforce the I965 instead of the iHD driver in the following way:

  • Install the Diagnostics plugin from the catalog
  • Restart Emby Server
  • Got to the page as shown below
  • On Linux, there's more below on this page and you will be able to choose different VAAPI drivers
  • Select i965 and restart Emby Server again
  • Retry

image.thumb.png.b7b849d74b25e44520df61371d3b62b5.png

 

Most likely it will fail, but I'm curious how.

Thanks,
sw

Link to comment
Share on other sites

agottschling
4 hours ago, softworkz said:

Hi,

thanks for the logs.

The change is that we have added QSV hwa support to work out-of-the-box on Linux which we didn't have before.

At the same time, QSV doesn't support Sandy Bridge, Ivy Bridge and Haswell at all: https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk_release_notes.md#system-requirements

Also, the iHD driver doesn't support Sandy Bridge.

Just out of curiosity to see what happens, you could try to enforce the I965 instead of the iHD driver in the following way:

  • Install the Diagnostics plugin from the catalog
  • Restart Emby Server
  • Got to the page as shown below
  • On Linux, there's more below on this page and you will be able to choose different VAAPI drivers
  • Select i965 and restart Emby Server again
  • Retry

image.thumb.png.b7b849d74b25e44520df61371d3b62b5.png

 

Most likely it will fail, but I'm curious how.

Thanks,
sw

Thanks for the info, but on my release server, I don't have the FFMPEG options tab at all, screenshot below. I'm still working on getting my beta server stood up if I can. Need to try and implement a jail or something.

Any thoughts?
image.thumb.png.f5471c3a594f72904b9d66b168862ebb.png

 

Link to comment
Share on other sites

agottschling
3 minutes ago, softworkz said:

In the release version, it should be under "Advanced Transcoding" (the rightmost tab)

Ok, I'm still not seeing an option under any of the tabs (diagnostics or advanced transcoding) to disable the iHD driver and fall back to the i965 driver. Is this a beta only thing or buried somewhere else in release?

Link to comment
Share on other sites

agottschling
3 minutes ago, softworkz said:

Which version of the diagnostics plugin do you have?

It should be in 4.6.0.31

I'm running 4.7.0.2, but I'll try downgrading to that version and will report back.

Link to comment
Share on other sites

6 minutes ago, agottschling said:

I'm running 4.7.0.2, but I'll try downgrading to that version and will report back.

I don''t think that would help. I meant it's included _since_ 4.6.0.31

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...