Hardware Transcoding issues - ApolloLake & GeminiLake CPUs

Yes, I hold degrees in engineering.

I built my own CPU out of discrete components as a teenager.
The rest was easy. :slight_smile:

If given enough time, until age and health started getting in the way, I could build a computer (CPU) , add discretes for the memory and I/O systems, and then write the tools (assembler, compilers, OS, and support programs). There’s a lot you can do on 9U VME boards. ( A couple boards for the CPU, add memory boards, and various I/O controller/interface )

Please remember, the dinosaurs and I were on a first-name basis :rofl:

1 Like

Impressive! That makes you even more valuable here.

Nah, just someone who enjoys helping because the alternative would be making folks miserable. I’m not that type of person. lol

I don’t know, what you are trying to show us here. Difference between what?

And can we assume, that you finally have acknowledged the fact, that there happened something to subtitle burning between i965 and iHD? Would be great if you folks are able to fix that in iHD.

I guess you still want to have that detailed comparison you asked us for?

Should I add the XML Infos for my experiments above in the meantime?

@pommesmatte

  1. Yes, there is something. I’m trying to pinpoint where the problem is.

  2. Look here:

(Supported Platforms)

  • BXTx (BXT: Broxton, APL: Apollo Lake, GLK: Gemini Lake)

(Decoding/Encoding Features) – Right most column is ApolloLake & GeminiLake

What I see looks very much like a smoking gun

  • The current version of the Intel Media Driver , as supplied by Intel, does not support “BXT” processors – which includes ApolloLake and GeminiLake.

  • Our engineer had to make modifications to get ApolloLake working. Now I’m understanding where the problem probably is – In the Intel Media Driver.

I suggest this because

  1. Plain HEVC 10 bit - OK
  2. HEVC 10 bit which is 4:2:2 encoded → not supported
  3. HEVC 10 bit which is 4:4:4 encoded → not supported

This is where I’m trying to learn as fast as possible.

The performance hit I’m seeing looks to be happening because the implementation was pushed from the QSV ASIC to OpenCL (which strains the HECK out of CPUs internal PCI 2.0 bus).

It you do the math, 4K HEVC HDR → 1080p SDR will saturate the internal PCI resulting in major stuttering.

I can’t find my writeup right now (2:30am) but, off the cuff -

  1. The bus is PCI 2.0 (500 MB/sec)
  2. 3840*2160 * 24 fps = 204Million / sec
  3. Decode (read), OpenCL tonemap (read+write), Encode (write)
  4. 204 * 4 operations = 816 M
  5. This assumes each pixel is 1 byte but it’s 3 bytes (RGB).
  6. 816 * 3 = 2.4 GB/sec required
    ==> about 20% of the required performance is available.

So something is very much off. I pray it’s my math or what I think I’m seeing it do in there. I’m not a video engineer. Video is its very own special skill.

For reasons I DO NOT yet understand, the i915/i965 pair support what’s needed and somehow PMS isn’t smart enough to automatically select it (it could if so programmed)

This is where I’m at.

My hope is that you all can confirm the behavior under these different conditions.

  • Counting how many times it stalls in a minute allows me to calculate the deficiency (500 MB/sec vs 2.4 GB/sec) to confirm or negate the hypothesis.
3 Likes

Some really great info coming through here. So @ChuckPa I added the i965 driver linked earlier and placed it in the correct folder, with a preferences reference activating it. I use a 720+. Gemini lake. Would you suggest I replace this with your latest GitHub version?

@SilverSurfer-JM

The i965 driver hasn’t changed in a very long time. (it’s legacy)
It gets retagged for each release but the code is legacy

How is the manual addition of VaapiDriver=“i965” working for you?

Is 1080p and 2160p behaving / functioning fully ?

I was running version .6999 until the weekend and only added the driver Sunday and upgraded to the latest spk. I tested with some subtitles on one movie and all was well, very low cpu resource usage.
I’d test a few more but I’m typing this from a sunbed in Spain lol so will likely need to wait a little until I can do any real testing.

Don’t get up. I’ll be there in about 10 hours

:stuck_out_tongue:

:rofl:

I’ll get you a drink in ready :wink:.

@ChuckPa You posted the i965 driver and a description to add it back some time ago.

Are there any problems you would expect with that?

Because in the meantime I’m using that workaround with my J4125 (in an Asustor) and 1.32.5 to get subtitle burning working again.

So I’m looking forward to a fix, but for the moment I’m fine. :grinning:

No, I don’t see a problem with manually adding it.

The “what to include” issue is where we’re at.

It actually requires code changes so PMS does know to use it first (IMPORTANT)
This is all part of the “MDE:” you see. It’s a nasty piece of work in there.

A complete rewrite would be welcome. Something simplified with a FSM.

Coming back after a pause, I see a lot of things happened here.
There is still issue, especially with burning sub on JXXX (like my DS918+) that were not here until .6999 version (so, this is no true the nas wasn’t capable of doing it).

I saw some workaround with using vaapi965 (never used that before) and I must say that with this option enabled + the driver provided earlier in the topic, no more persistent buffering with subs.

Thanks for your help and your patience ChuckPa.
I hope PMS team will find a “real” solution instead of this workaround.

1 Like

so I’m on 1.32.0.6973 with a Synology DS920+ (Gemini Lake) and I don’t believe anyone’s asked but am I missing any major feature by not updating? I tried reading through changelogs, but might have missed something. Definitely don’t want to break any hw transcoding since I’ll be using my server remotely whilst travelling a lot in the next few months. TIA

Are there instructions on how I can integrate VaapiDriver=“i965” into my ds918 and have Plex use it?

Look here: 1.32.2.7002 - #54 by ChuckPa (point 1 2 and 3 are sufficient), the driver is here: i965_drv_video.zip - Google Drive , then add

VaapiDriver=“i965”

in preferences.xml

Thank you so much for all your support in this kerfuffle.

I’ve been sitting on 6999 for a while now waiting for “Gemini Lake” to show up in the fixes section. Continuing to be back-revved has me nervous from a security standpoint, but I absolutely cannot go forward without hardware transcoding on my 920+. (My mother watches network TV through my tuner so she doesn’t have to pay for a cable tv package and her internet speed is “better than dialup”, so encoding is regularly invoked).

The most recent update notification brings me back here, where it seems there is a “less than super complicated” workaround.

I’ve done a little digging, and what I’m seeing indicates I need to add VaapiDriver=“i965” to the Preferences.xml file.

Is this correct? Is there anything else to be done, or am I missing something obvious?

So whats the best method at this time? Stay on 6999 or download one of the provided betas in this thread and add the drivers?

FOLKS:

  1. If you have anything except GeminiLake CPUs, you’re free to upgrade to build 1.32.6.7521

  2. While we’ve fixed the regressions / failures of the previous 1.32.6 / 1.32.7, we’ve not yet fixed GeminiLake. This is our current task.

1 Like

Noting here for convenience (since it’s now waaaaay back in the thread) that the Celeron J4125 in the Synology DS920+ is a Gemini Lake CPU.

1 Like