HW Transcoding not working anymore (Synology Diskstation)

Server Version#: 1.18.2.2058
Player Version#: 4.8.4
DSM Version: 6.2.2-24922 Update 4

So far HW transcoding on Synology Diskstation DS916+ worked just fine. I do not exactly when it broke because there have been many updates recently. Now it fails and video are transcoded by software. This can be seen by high CPU load and stop-and-go video playback.

The server log shows:

Nov 23, 2019 15:15:11.477 [0x7fc76534e700] INFO - Plex Media Server v1.18.2.2058-e67a4e892 - Synology DS916+ x86_64 - build: linux-x86_64 synology - GMT 01:00
Nov 23, 2019 15:15:11.477 [0x7fc76534e700] INFO - Linux version: DSM 6.2.2.24922-4, language: en-US
Nov 23, 2019 15:15:11.477 [0x7fc76534e700] INFO - Processor       Intel(R) Pentium(R) CPU  N3710  @ 1.60GHz
Nov 23, 2019 15:17:33.301 [0x7fc737159700] DEBUG - Codecs: testing h264_vaapi (encoder)
Nov 23, 2019 15:17:33.302 [0x7fc737159700] DEBUG - Codecs: hardware transcoding: testing API vaapi
Nov 23, 2019 15:17:33.306 [0x7fc737159700] ERROR - [FFMPEG] - libva: /volume1/@appstore/Plex Media Server/lib/dri/iHD_drv_video.so init failed
Nov 23, 2019 15:17:33.306 [0x7fc737159700] ERROR - [FFMPEG] - Failed to initialise VAAPI connection: 1 (operation failed).
Nov 23, 2019 15:17:33.313 [0x7fc737159700] DEBUG - Codecs: testing hevc (decoder) with hwdevice vaapi
Nov 23, 2019 15:17:33.313 [0x7fc737159700] DEBUG - Codecs: hardware transcoding: testing API vaapi
Nov 23, 2019 15:17:33.313 [0x7fc737159700] ERROR - [FFMPEG] - libva: /volume1/@appstore/Plex Media Server/lib/dri/iHD_drv_video.so init failed
Nov 23, 2019 15:17:33.313 [0x7fc737159700] ERROR - [FFMPEG] - Failed to initialise VAAPI connection: 1 (operation failed).
Nov 23, 2019 15:17:33.316 [0x7fc737159700] DEBUG - [FFMPEG] - Format vaapi_vld chosen by get_format().
Nov 23, 2019 15:17:33.316 [0x7fc737159700] DEBUG - [FFMPEG] - Format vaapi_vld requires hwaccel initialisation.
Nov 23, 2019 15:17:33.316 [0x7fc737159700] ERROR - [FFMPEG] - Failed setup for format vaapi_vld: hwaccel initialisation returned error.
Nov 23, 2019 15:17:33.316 [0x7fc737159700] DEBUG - [FFMPEG] - Format vaapi_vld not usable, retrying get_format() without it.
Nov 23, 2019 15:17:33.316 [0x7fc737159700] DEBUG - [FFMPEG] - Format yuv420p10le chosen by get_format().
Nov 23, 2019 15:17:33.317 [0x7fc737159700] DEBUG - [FFMPEG] - Decoded frame with POC 0.
Nov 23, 2019 15:17:33.317 [0x7fc737159700] DEBUG - Codecs: 10-bit HEVC test returned software frame
Nov 23, 2019 15:17:33.318 [0x7fc737159700] WARN - Codecs: avcodec_open2 returned -95 for decoder 'hevc'
Nov 23, 2019 15:17:33.318 [0x7fc737159700] DEBUG - Codecs: testing hevc (decoder) with hwdevice nvdec
Nov 23, 2019 15:17:33.319 [0x7fc737159700] DEBUG - Codecs: hardware transcoding: testing API nvdec
Nov 23, 2019 15:17:33.319 [0x7fc737159700] ERROR - [FFMPEG] - Cannot load libcuda.so.1
Nov 23, 2019 15:17:33.319 [0x7fc737159700] ERROR - [FFMPEG] - Could not dynamically load CUDA
Nov 23, 2019 15:17:33.319 [0x7fc737159700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Unknown error occurred

Restarting the system does not help.

Could this please be fixed? :pray:

Have the same issues

Feels good being not alone. :smiley_cat:
Sadly, the problem persists. :frowning:

Does hardware acceleration work with 8-bit H.264 video?

It look like you were transcoding 10-bit HEVC video. If the GPU does not support that video type the system will decode in software.

Edit: The DS916+ has a Pentium N3710 processor. According to the Intel datasheet, it does not support decoding of HEVC video on Linux based systems.

N3710 at ark.intel.com

N3710 datasheet: PDF

From N3710 datasheet, Section 8.4 Video Encode/Decode

1 Like

There is a known problem with the Intel iHD_drv_video.so file on Intel ApolloLake CPUs.

The temporary work around (while we fix it ourselves) is to delete it.

Anyone wishing to delete from the Synology command line can:

  1. Sign in
  2. sudo sh
  3. rm "/var/packages/Plex Media Server/target/lib/dri/iHD_drv_video.so"
  4. Restart Plex

A one-time ā€œtask schedulerā€ job can also be setup to do the same.

Adapt the procedure below & substitute the rm command above for the shown script contents.

The alternative is to SSH into the Synology and delete
/var/packages/Plex Media Server/lib/dri/iHD_drv_video.so
and restart PMS.

4 Likes

Hi,

I have a synology diskstation 1016+ and hardware transcoding has been broken for some time for me. I posted my solution (install FFMpeg package and use post-processing script after DVR recording here:

Let me know if you find this useful. I have updated the script to generate h.265 (HEVC) files and I can share that one if you like.

1 Like

Thanks for checking the specs of the DS916+ processor. Yes, it is a N3710 according to /proc/cpu. The table is correct: The processor does not support encoding H.265.

I get the error message above (see 1st post) while transcoding a video from H.265 to (I guess) H.264. And according to the table the N3710 supports *decoding H.265 and encoding H.264. So what I wanted to do should work. And I am very sure it actually worked before.

EDIT: Right, the table says that the processor does not support decoding of H.265 on Linux. But it does on Win8.1. So I guess the table talks about driver support some time ago and about HW capabilities.

When transcoding a 8-bit H.264 video (download in lower quality) I get the same [FFMPEG] - libva: /volume1/@appstore/Plex Media Server/lib/dri/iHD_drv_video.so init failed error.

In summary I am very sure that it is a Plex problem and not a missing feature of the N3710 processor.

Does hardware supported transcoding work after deleting the iHD_drv_video.so driver?

Or does this simply silence the error messages in the console?

Removing the iHD_drv_video allows the original i965 driver to be used exclusively on ApolloLake CPUs – IF-- the CPU is capable of it.

The N3710 does not have HEVC HW QSV (Quick Sync Video) support.
It will support H.264 in hardware.

The first processors to support HEVC in hardware are the J-series, aka ApolloLake (J3455) which are the SoC versions of KabyLake in the -7xxx ā€œIntel Coreā€ desktop processors.

1 Like

After deleting /volume1/@appstore/Plex Media Server/lib/dri/iHD_drv_video.so as proposed by @ChuckPa (and rebooting) the error message [FFMPEG] - libva: /volume1/@appstore/Plex Media Server/lib/dri/iHD_drv_video.so init failed is gone from the log. None the less, the error message [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error). is still there and transcoding from/to H.264 is still running on the CPU.

I then installed the ffmpeg 4.1-11 package as hinted by @arfung. Next I replaced /volume1/@appstore/Plex Media Server/lib/dri/i965_drv_video.so with /volume1/@appstore/ffmpeg/lib/dri/i965_drv_video.so. Again, a reboot. But the [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error). is still there while transcoding and it still loads the CPU.

May I please see the media info / XML ?
May I also see the complete ZIP log files from Settings - Server - Troubleshooting - Download Logs ?

a. Verify DEBUG logging on; VERBOSE logging off
b. Start Playback
c. Wait 20 seconds
d. Stop Playback
e. Wait 30 seconds for logs to quiesce
f. Download ZIP file from PMS.

  1. If subtitles are being used, the CPU will load and peg
  2. The logs will tell me precisely why PMS is doing what it is

Using which iHD_drv_video.so and i965_drv_video.so?

I would like to see the logs, using the normal system, without ffmpeg’s i965 being hacked in, transcoding normal H.264 video (about 30 seconds worth) followed by 30 seconds worth of attempting H.265 (which the N3710 is not capable of performing in hardware).

I have the logs. How do I send them to you without sharing with the rest of the world?

Without the intention of going on your nerves: I still believe that the DS916+ can do H.265 HW decoding. This is what the official Synology data sheet says:

Hardware transcoding engine:
Supported codecs: H.264 (AVC), H.265 (HEVC), MPEG-2 and VC-1; maximum resolution: 4K (4096 x 2160); maximum frame rate per second (FPS): 30

Source: https://global.download.synology.com/download/Document/Hardware/DataSheet/DiskStation/16-year/DS916+/enu/Synology_DS916_Plus_Data_Sheet_enu.pdf

Additionally, ffmpeg says that Braswell (N3710) can do H.265 decode. See Hardware/QuickSync – FFmpeg

Finally, Intel says that N3710 is part of the Braswell family: Intel Pentium Processor N3710 2M Cache up to 2.56 GHz Product Specifications

Braswell does not have HEVC capability.

SkyLake family is the first to decode HEVC SDR (8 bit)
KabyLake family is the first to decode HEVC HDR (10 bit) aka. UHD.

That info does not apply to Plex.

Synology has their own video transcoder chip and they do not allow Plex, or any other non-Synology app, to use it.

Plex uses the GPU/ASIC built into the CPU for hardware transcoding.

Look at the datasheet for the CPU.

Synology has proprietary Hybrid hardware which we cannot access.
For this reason, we must rely solely on Intel’s Quick Sync Video.

It has always been this way as all attempts to obtain access to their solution have not born fruit. They reserved the right to maintain the technology for their Video Station product.

i agree

before one of the last updates the ds said in the dashboard that it transcodes h265 to h264 (hw). that indicates to me, that it worked before.

1 Like

This statement tells me:

  1. H.265 software decode - which is expected given there is no hardware H265 support in the chip.
  2. H.264 (hw) is telling you the encoding is done in hardware.

If it were hardware → hardware it would be HEVC (hw) -> H.264 (hw)

Each part (Decode & Encode) identify if hardare is in use.