Transcoder no longer using QSV

First time poster, long time lurker and enjoyer of Plex.

Server Version#: 1.25.4. 5487
Player Version#: 4.69.1
Synology NAS DS918+ intel J3455 CPU
DSM7.0.1-42218-2
Docker version v20.10.3-1239, Docker Compose v1.28.5-324b023a
Running through docker-compose w/ image from linuxserver/plex, macvlan networking (essentially host mode).
Passthrough /dev/dri with proper group permissions and chmod 666 (). Devices appear in /dev/dri of the container.
image

Noticed recently that transcoding performance felt a bit off. Shows/movies that would transcode from 4K HEVC HDR → 1080 SDR over web player flawlessly before now struggle to even buffer the first 10 seconds. Average server use is 2-4 4K HEVC HDR without the server breaking a sweat.

Dashboard shows HW accel is being used but top output from the host shows CPU is being slammed

image

Tried reverting back as far as 1.22.0 but no luck.

I’ve tried turning off HDR tone mapping; it results in a slightly faster transcode but with obviously washed out colors.
Turned off subtitles; resulted in slightly less CPU hit to the point where things would be watchable but not even close to how it performed before.

I tried various combinations of installing/removing intel opencl libs/intel-media-va-driver(free and non-free)/beignet/etc and at one point managed to get things back to how they were installing vainfo but shortly afterwards performance was back in the gutter. Unfortunately could not replicate what I did after a whole day of trying again.

clinfo shows that the container recognizes the iHD device
image

One thread had mentioned a newer version of intel-opencl-icd being the issue but current installed is the version that was recommended to work

 root@67e966dd0394:/# apt info intel-opencl-icd
Package: intel-opencl-icd
Version: 21.49.21786+i643~u20.04

Noticed an interesting bit in the logs

Feb 07, 2022 22:08:58.083 [0x7f3e34c7ab38] DEBUG - [Transcode/JobRunner] Job running: FFMPEG_EXTERNAL_LIBS='/config/Library/Application\ Support/Plex\ Media\ Server/Codecs/62cc2bc-4226-linux-x86_64/' LIBVA_DRIVERS_PATH='/usr/lib/plexmediaserver/lib/dri' XDG_CACHE_HOME='/config/Library/Application Support/Plex Media Server/Cache' XDG_DATA_HOME='/usr/lib/plexmediaserver/Resources' X_PLEX_TOKEN='xxxxxxxxxxxxxxxxxxxx' '/usr/lib/plexmediaserver/Plex Transcoder' '-codec:0' 'hevc' '-hwaccel:0' 'vaapi' '-hwaccel_fallback_threshold:0' '10' '-hwaccel_device:0' 'vaapi' '-codec:4' 'dca' '-analyzeduration' '20000000' '-probesize' '20000000' '-i' '/volume1/Anime/Kimi no Na Wa/[NoobSubs] Kimi no Na Wa 2016 (2160p 4k Ultra Blu-ray HDR10 Dual Audio)[0731BD8C].mkv' '-map_inlineass' '0:8' '-filter_complex' '[0:0]scale=w=2276:h=1280:force_divisible_by=4[0];[0]format=p010,tonemap=mobius[1];[1]format=pix_fmts=nv12[2];[2]inlineass=font_scale=1.000000:font_path=/usr/lib/plexmediaserver/Resources/Fonts/NotoSans-Medium.otf:fontconfig_file=/usr/lib/plexmediaserver/Resources/fonts.conf:language=en[3];[3]hwupload[4]' '-map' '[4]' '-metadata:s:0' 'language=jpn' '-codec:0' 'h264_vaapi' '-b:0' '14792k' '-maxrate:0' '19723k' '-bufsize:0' '39446k' '-r:0' '23.975999999999999' '-force_key_frames:0' 'expr:gte(t,n_forced*1)' '-filter_complex' '[0:4] aresample=async=1:ocl='\''stereo'\'':rematrix_maxval=0.000000dB:osr=48000[5]' '-map' '[5]' '-metadata:s:1' 'language=jpn' '-codec:1' 'aac' '-b:1' '256k' '-f' 'dash' '-seg_duration' '1' '-dash_segment_type' 'mp4' '-init_seg_name' 'init-stream$RepresentationID$.m4s' '-media_seg_name' 'chunk-stream$RepresentationID$-$Number%05d$.m4s' '-window_size' '5' '-delete_removed' 'false' '-skip_to_segment' '1' '-time_delta' '0.0625' '-manifest_name' 'http://127.0.0.1:32400/video/:/transcode/session/pkik4eykjkz9cowjeqo1iein/2b8042b9-5958-48be-916f-b24336e68ef9/manifest?X-Plex-Http-Pipeline=infinite' '-avoid_negative_ts' 'disabled' '-map_metadata' '-1' '-map_chapters' '-1' 'dash' '-map' '0:8' '-f' 'null' '-codec' 'ass' 'nullfile' '-start_at_zero' '-copyts' '-vsync' 'cfr' '-init_hw_device' 'vaapi=vaapi:,driver=i965' '-filter_hw_device' 'vaapi' '-y' '-nostats' '-loglevel' 'quiet' '-loglevel_plex' 'error' '-progressurl' 'http://127.0.0.1:32400/video/:/transcode/session/pkik4eykjkz9cowjeqo1iein/2b8042b9-5958-48be-916f-b24336e68ef9/progress'

It appears plex is defaulting to the i965 driver? I had previously done the ssh and remove iHD driver some time back before intel had patched the issue with choppy/artifact filled playback but had no issues ever since.

‘-init_hw_device’ ‘vaapi=vaapi:,driver=i965’ ‘-filter_hw_device’ ‘vaapi’

I am at a complete loss as to what it could possibly be at this point. Have a feeling it’s something to do with dependencies the container was built with.

Attached logs, please let me know if I missed anything.
com.plexapp.system.log (173.0 KB)
Plex Transcoder Statistics.log (8.8 KB)
Plex Media Server.log (1.0 MB)

DSM 7 isn’t going t behave at all like DSM 6 when doing Plex.

Trying to ‘man-handle’ it is really difficult and usually fraught with troubles like this (They changed everything in DSM 7 – including HW access)

For Docker on Syno we have documented how to overplay a docker container on the native Plex app and be interchangeable.

The benefit here is DSM and the container work together to guarantee HW access

HW transcoding and tone mapping work flawlessly.

Here’s what is suggested. Adapt accordingly (so you don’t have to chmod all the time)

Another concern is always Subtitles. The Syno never does well with them.
Now add tone mapping and the CPU load will increase. A quad-core will be fine but a dual-core will struggle.

I have not had Plex installed via DSM native for almost 2 years now and the issues with transcoding had began before upgrading to DSM7. The “PlexMediaServer” user does not exist, only “plex” does from a DSM6 native install of plex before migrating things over into docker.

Always for subtitles has been on for as long as I’ve used Plex and has not caused significant load on the J3455 (4-core). On a single stream I would not exceeded 25% transcoding a 4K HEVC HDR movie → 1080 or 10% transcoding 1080p HEVC SDR 10bit → 1080p H264 8 bit prior to recent updates.

Did some further testing and reverted back to 1.25.1.5286 as it has the most stable performance when transcoding. I currently have a remote user playing 4K HEVC HDR → 1080 with NO subtitles and system is at ~10% CPU. Kicking off another stream of 4K->1080 on my end brings the load up to a little under 20%. Turning ON subtitles spikes the load to a consistent 60%+.

Again, this has played perfectly fine in the past.Something has definitely changed recently, be it the transcoder or the opencl libraries that is affecting transcoding with subtitles on.

Subs OFF

Subs ON

  1. There will be no Local User with the name PlexMediaServer in the DSM 7 native app.
  2. PlexMediaServer exists as a System Internal User (change “Local Users” to “System Internal User”)

Subtitles on a Synology are ALWAYS problematic. The OpenCL / HW does not do anything for subtitles. It has always been the CPU which processes subtitles (burn or convert) never the HW acceleration.

I will ask the obvious because it happened to me.

Have you perhaps curated new media which, because of its content ( HEVC HDR + audio codecs – with all those extra subtitle tracks) that the load is catching up with you? ( The test for this is to use mediainfo to see what’s actually in the file and then evaluate how much, if any, are problematic tracks – like PGS, VOBSUB, or DVDRIP subs). I have noticed that most of the discs I rip are PGS only subtitle tracks now.

Thanks, that turned out to be the case. A large majority of newly curated media was using VOBSUB/PGS while older media had sidecar SRT sub files.

I ran my library through a processor to pull SRTs for everything and no longer run into the load issue when transcoding 4K HDR → 1080 for remote users. I must’ve not noticed because I got an android TV roughly a year or two ago and switched away from Kodi back to the Plex player.

I’m curious though if there’s a way to force the use of the iHD driver over i965 to test out performance?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.