Server Version#: 1.19.3.2764
Player Version#: Multiple (Latest Web & iOS)
After getting things setup on FreeBSD, I’m now having trouble getting HW Transcoding to work.
I’ve followed all the steps in the post-install message and nuked the jail once. Before my problem was that /dev/drm wasn’t getting exposed, but after fixing that by loading the correct module (i915kms didn’t work, I had to use /boot/modules/i915kms.ko despite having a Haswell processor [i3 4330]), I’m now having the problem that the driver bundled with Plex isn’t running properly.
Here’s my vainfo output:
root@plex:~ # vainfo
error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.7.1)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Desktop - 2.4.0
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
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
And here’s the relevant log message when Plex is attempting to use the hardware transcoder, but FFMPEG is failing to load the driver:
May 22, 2020 23:02:31.110 [0x80c388f00] DEBUG - TPU: hardware transcoding: enabled, but no hardware decode accelerator found
May 22, 2020 23:02:31.110 [0x80c388f00] INFO - CodecManager: obtaining decoder 'aac'
...
May 22, 2020 23:04:18.774 [0x80acfde00] DEBUG - Codecs: testing h264_vaapi (encoder)
May 22, 2020 23:04:18.774 [0x80acfde00] DEBUG - Codecs: hardware transcoding: testing API vaapi
May 22, 2020 23:04:18.780 [0x80acfde00] ERROR - [FFMPEG] - libva: /usr/local/share/plexmediaserver-plexpass/lib/dri/iHD_drv_video.so init failed
May 22, 2020 23:04:18.780 [0x80acfde00] ERROR - [FFMPEG] - Failed to initialise VAAPI connection: 1 (operation failed).
May 22, 2020 23:04:18.781 [0x80acfde00] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
May 22, 2020 23:04:18.781 [0x80acfde00] DEBUG - Codecs: testing h264 (decoder) with hwdevice vaapi
May 22, 2020 23:04:18.785 [0x80acfde00] DEBUG - Codecs: hardware transcoding: testing API vaapi
May 22, 2020 23:04:18.785 [0x80acfde00] ERROR - [FFMPEG] - libva: /usr/local/share/plexmediaserver-plexpass/lib/dri/iHD_drv_video.so init failed
May 22, 2020 23:04:18.785 [0x80acfde00] ERROR - [FFMPEG] - Failed to initialise VAAPI connection: 1 (operation failed).
May 22, 2020 23:04:18.798 [0x80acfde00] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
May 22, 2020 23:04:18.798 [0x80acfde00] DEBUG - Scaled up video bitrate to 2619Kbps based on 1.500000x fudge factor.
May 22, 2020 23:04:18.798 [0x80acfde00] DEBUG - MDE: Selected protocol dash; container: mp4
Since I noticed vainfo used the i965 driver rather than the iHD driver, I tried to backup the plex bundled driver and copy the libva-intel-driver version into the relevant directory, but it couldn’t find the __vaDriverInit_1_0 function (I tried this before I nuked the jail, but I assume that the same result will occur)
The packages I’ve installed inside the jail are drm-fbsd12.0-kmod, libva-intel-driver and libva-utils.
The output of ls -l /dev/dri is:
root@plex:~ # ls -l /dev/dri
total 0
lrwxr-xr-x 1 root wheel 8 May 22 22:51 card0 -> ../drm/0
lrwxr-xr-x 1 root wheel 10 May 22 22:51 renderD128 -> ../drm/128
The output of uname -a is FreeBSD plex 12.1-RELEASE-p5 FreeBSD 12.1-RELEASE-p5 GENERIC amd64.
The plex user is added to the video group.
