Activating Plex hardware acceleration

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
It’ll be for remote streaming.

Sure that's the use case. What's the subtitle format, if not PGS/VOBSUB, and not SRT?

To put color to the comment: PGS/VOBSUB require burn-in and thus transcode. All other subtitle formats, which are text-based, do not. Full list here: Adding Local Subtitles to Your Media | Plex Support

That means either you have PGS/VOBSUB subtitles and the known issues with transcoding; or you don't, and you wouldn't transcode in the first place.
 
Last edited:

wootness

Dabbler
Joined
Apr 1, 2021
Messages
15
Sure that's the use case. What's the subtitle format, if not PGS/VOBSUB, and not SRT?
I have SRT subs. Just asking if the issues folks were having is PGS/VOB sub related since I won’t be using those sub format.
I’m mostly transcoding 1080p down to 720p or a lower fidelity 1080p stream. If the iGPU can allow 4K transcode down to 1080p then I would also benefit in the house. Current server I have is atom C2750 based and wouldn’t be able to do the 4K to 1080p transcoding.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
1080p down to 720p hw transcode hasn't been an issue in my testing.

4k is usually HDR, since otherwise why bother. HDR to SDR transcode is either terrible (no tone mapping) or not great (with tone mapping). It's always best to keep 4k and 1080p versions around.

Even for 720p, you can tell Plex to "optimize" ahead of time and avoid the transcode entirely.
 

wootness

Dabbler
Joined
Apr 1, 2021
Messages
15
1080p down to 720p hw transcode hasn't been an issue in my testing.

4k is usually HDR, since otherwise why bother. HDR to SDR transcode is either terrible (no tone mapping) or not great (with tone mapping). It's always best to keep 4k and 1080p versions around.

Even for 720p, you can tell Plex to "optimize" ahead of time and avoid the transcode entirely.

Thanks for the info on this.
I'm debating if I should build a system with more CPU performance vs TDP (AMD based) and eventually add a GPU down the road when TrueNAS SCALE goes into RC vs going with the E3-1225v6. Trying to future proof a bit on my second server. If I go down the no iGPU route, I would transcode via software until I can use the GPU with SCALE, but since I would have a more powerful CPU I wouldn't have an issue software transcoding vs the C2750 I currently have. Budget-wise ~$1200 before adding HDD is preferred but not a hard limit. Just want a quiet NAS that is future proofed for SCALE.
Your thoughts on this?
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
I'd go for an X470D4U build with AMD Ryzen, likely, and then decide whether adding a GPU down the road is even worth it.
 

ARRRRGGGGHHH

Dabbler
Joined
Mar 25, 2020
Messages
32
So I am still having ongoing issues with HW transcoding in TrueNAS.

Running TrueNAS-12.0-U4 and the Plex plugin and any hw transcoding causes the jail to lockup.

Plex doesn't work. Can't stop the jail. Only option to get it working again is to restart the entire server...

Running an i5 7400 and it has worked previously but this issues always crops up eventually for reasons unknown to me.

In the past i have just blown away the entire server, cleared the entire jails out completely etc all just to get it working again.

And i know i am not the only one who has had this problem.

Is there any idea yet why it just craps out???

Ready to move on away from TrueNAS but really don't want to because when it works it is very good having everything running on the one server.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Is there any idea yet why it just craps out?

Software gremlins: The way Plex interacts with Intel drivers on FreeBSD, and a low enough priority for Plex that this does not get fixed.

TrueNAS SCALE is a possible solution. Plex does make sure this stuff works on Linux. Scale may go into beta as soon as the 22nd - Monday in a week.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Sure. A relatively recent version of Linux, such as Ubuntu 20.04, supports ZFS and Plex. You’ll be doing a lot of manual work.

TrueNAS is not so much an OS as it is middleware: A management layer, with a graphical interface. SCALE is based on Debian Linux, just like Ubuntu. Core is based on FreeBSD.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
I translate that as you being in a bit of a hurry to have this feature work. In that case, you’d need to think carefully. SCALE is just about to go into beta. There will be wrinkles.

Your call as to whether a plain Ubuntu is the better bet, or going with a beta version of SCALE, or sticking with Core without hw transcode for now.
 

hertzsae

Contributor
Joined
Sep 23, 2014
Messages
118
Is there some other OS i can use other than TrueNAS?
FreeBSD is a second class citizen in the eyes of most application developers (like Plex). Their users (and therefore their priority) are primarily on Windows and Linux. You'll have a much easier time with application support in those operating systems. I don't need GPU transcoding, so I haven't looked into it. However, I've heard it works well in Windows and is very easy to configure. Not sure about linux. TrueNAS uses the same ZFS that many linux users have now, so maybe choose linux if ZFS is important to you.
Seems it's 6+ months behind schedule...
If you're just doing plex, the beta will may work for you, otherwise you could probably ask for a refund...
 

Mlovelace

Guru
Joined
Aug 19, 2014
Messages
1,111
So I am still having ongoing issues with HW transcoding in TrueNAS.

Running TrueNAS-12.0-U4 and the Plex plugin and any hw transcoding causes the jail to lockup.

Plex doesn't work. Can't stop the jail. Only option to get it working again is to restart the entire server...

Running an i5 7400 and it has worked previously but this issues always crops up eventually for reasons unknown to me.

In the past i have just blown away the entire server, cleared the entire jails out completely etc all just to get it working again.

And i know i am not the only one who has had this problem.

Is there any idea yet why it just craps out???

Ready to move on away from TrueNAS but really don't want to because when it works it is very good having everything running on the one server.
I believe the problem with running the plugin vs building the jail manually is when the plugin version updates it removes the plex user from the video group, which will break the HW transcoding. I've been running plex-pass with HW transcoding in a non-plugin jail for years without issue, and use the PMS_Updater script on a cron job so its patched from Plex automagically.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
All good stuff; I can still “break Plex” at will. All depends on what I am transcoding. Subtitles seem to be poison for my particular setup.

It’s happily no big deal: Not transcoding at all remains the best way to play stuff via Plex.
 

FrankNAS

Contributor
Joined
Dec 3, 2017
Messages
111
another issue with the "transcoder" is that it is just a custom compile of what appears to be a very old ffmpeg:

Code:
root@plex:/usr/local/share/plexmediaserver-plexpass # ./Plex\ Transcoder -version
ffmpeg version 1.6-73e06c81b3-0 Copyright (c) 2000-2019 the FFmpeg developers
built with Plex clang version 8.0.1 (revision: 102) (based on LLVM 8.0.1)
configuration: --disable-static --enable-shared --disable-libx264 --disable-hwaccels --disable-protocol=concat --external-decoder=h264 --enable-debug --enable-muxers --fatal-warnings --disable-gmp --disable-avdevice --disable-bzlib --disable-sdl2 --disable-decoders --disable-devices --disable-encoders --disable-ffprobe --disable-ffplay --disable-doc --disable-iconv --disable-lzma --disable-schannel --disable-linux-perf --disable-mediacodec --enable-eae --disable-protocol='udp,udplite' --enable-libxml2 --arch=x86_64 --target-os=freebsd --strip=strip --cc=clang --pkg-config=/data/jenkins/conan_build/1154880442/conan/.conan/data/plexconantool/5-95/plex/stable/package/8ee2ae97c586ebc8f4a3840f35e3db49f7353d39/plex-pkg-config --pkg-config-flags=--static --enable-cuda-llvm --enable-libdrm --enable-opencl --extra-ldflags='-Wl,-rpath='libavutil      56. 26.100 / 56. 26.100
libavcodec     58. 52.100 / 58. 52.100
libavformat    58. 27.104 / 58. 27.104
libavfilter     7. 49.100 /  7. 49.100
libswscale      5.  4.100 /  5.  4.100
libswresample   3.  4.100 /  3.  4.100

root@plex:/usr/local/share/plexmediaserver-plexpass # file Plex\ Transcoder
Plex Transcoder: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 11.2, FreeBSD-style, stripped


4.4 should look something like: (this one was built from source and statically linked)
Code:
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100
 

wootness

Dabbler
Joined
Apr 1, 2021
Messages
15
This is why I skipped Intel and instead got the AMD Ryzen 7 3700x paired with AsRock Rack X470D4U. Super happy with the setup. No issues with software transcoding on Plex since the CPU can handle it.
 

ThreeDee

Guru
Joined
Jun 13, 2013
Messages
700
This is why I skipped Intel and instead got the AMD Ryzen 7 3700x paired with AsRock Rack X470D4U. Super happy with the setup. No issues with software transcoding on Plex since the CPU can handle it.
Pfffft! ..copy cat :cool:
 
Joined
Jan 27, 2020
Messages
577
Re-cap. I have been following this Guide and bought hardware that 'worked' for HW transcode and installed Truenas 12.0 on system 1 (as per signature). I have used @danb35 script to setup the Plex jail with hardware transcode being setup manually as per the guide. As per message 311, igpu is visable in the jail with relevant output folders. So I thought I was good to go.

I had some networking issues which I raised in this thread which @Redcoat helped to initially solve. And then odd instability behaviour with Plex / all jails in this thread with starting and stopping jails which @HolyK solved with many hours of troubleshooting and TENACITY which I am most grateful for.

Now back to HW transcode:

-With HW transcode not enabled in plex, software transcode of videos worked and jail could be stopped and started
-With HW transcode enabled in plex, after a single short video (30 secs) transcoded, no other video can be transcoded or played - it just crashes. The jail wont stop (not even with force flag)
-- Errors from console

Code:
root@truenas[~]# iocage stop pms
* Stopping pms
  + Executing prestop OK
  + Stopping services FAILED
ERROR:

Please use --force flag to force stop jail
root@truenas[~]# iocage stop pms --force
* Stopping pms
  + Tearing down VNET OK
  + Removing devfs_ruleset: 1000 OK
  + Removing jail process FAILED:
umount: unmount of /mnt/tank/iocage/jails/pms/root/dev failed: Device busy
jail: ioc-pms: /sbin/

root@truenas[~]# lsof /mnt/tank/iocage/jails/pms/root/dev
lsof: WARNING: compiled for FreeBSD release 12.0-RELEASE; this is 12.2-RELEASE-p3.
lsof: no pwd entry for UID 972
lsof: no pwd entry for UID 972
lsof: no pwd entry for UID 972
lsof: no pwd entry for UID 972
lsof: no pwd entry for UID 972
lsof: no pwd entry for UID 972
lsof: no pwd entry for UID 972
lsof: no pwd entry for UID 972
COMMAND    PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
lsof: no pwd entry for UID 972
Plex\x20M 6031      972    0u  VCHR   0,49      0t0   49 /mnt/tank/iocage/jails/pms/root/dev (devfs) (like character special /dev/null)
lsof: no pwd entry for UID 972
Plex\x20M 6031      972    1u  VCHR   0,49      0t0   49 /mnt/tank/iocage/jails/pms/root/dev (devfs) (like character special /dev/null)
lsof: no pwd entry for UID 972
Plex\x20M 6031      972    2u  VCHR   0,49      0t0   49 /mnt/tank/iocage/jails/pms/root/dev (devfs) (like character special /dev/null)
lsof: no pwd entry for UID 972
Plex\x20M 6031      972    3r  VCHR    0,5      0t0    5 /mnt/tank/iocage/jails/pms/root/dev (devfs) (like character special /dev/fd/2)
lsof: no pwd entry for UID 972
Plex\x20T 6085      972    0u  VCHR   0,49      0t0   49 /mnt/tank/iocage/jails/pms/root/dev (devfs) (like character special /dev/null)
lsof: no pwd entry for UID 972
Plex\x20T 6085      972    1u  VCHR   0,49      0t0   49 /mnt/tank/iocage/jails/pms/root/dev (devfs) (like character special /dev/null)
lsof: no pwd entry for UID 972
Plex\x20T 6085      972    2u  VCHR   0,49      0t0   49 /mnt/tank/iocage/jails/pms/root/dev (devfs) (like character special /dev/null)
lsof: no pwd entry for UID 972
Plex\x20T 6085      972    3r  VCHR    0,5      0t0    5 /mnt/tank/iocage/jails/pms/root/dev (devfs) (like character special /dev/fd/2)
root@truenas[~]#


Really hope I get support to solve this having come so far. Thanks in advance
Any news on the intel driver issue?

Plex doesn't work. Can't stop the jail. Only option to get it working again is to restart the entire server...
This has to be a FreeBSD driver problem. It's quite surprising that a rock-solid system like TrueNAS gets irritated by a devfs-ruleset running in one jail. Lesson learned I guess. SCALE is getting warmer and warmer to me. Especially if pool migration is working flawless. Translating jails into containers is gonna take some effort, but stuff like this plex issue is pushing people to SCALE, which is good I guess..
 
Last edited:

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
People who really want hw transcode have a good reason to go to SCALE, and people who want stable VMs have another reason. The issue with VMs not rebooting successfully was finally closed as "wontfix" - it's upstream in bhyve and iX doesn't have the cycles to fix bhyve. Fair enough.
 

neotoxic

Cadet
Joined
Aug 7, 2021
Messages
3
Hello everyone, new TrueNAS user here.

I have some problems activating hardware encoding with my i3-10105, here's what I did :

- Installed and enabled drm kernel module in the host
- Installed Intel drivers in the plex jail (libva-intel-media-driver)
- Added plex user to the video group in the plex jail
- Created the devfs rule making script and enabled it post start
- Enabled the correct rule in the plex jail settings
- Activated the settings for HW in Plex

Did not work (no dri folder showing, but I read here it's not always necessary), so :

- I tried adding the kernel loading in /etc/rc.conf

It added a LOT a folders in /dev/ ... I removed the loading setting but the folders are still here and I can't even do a backup to see if I can go back to the previous /dev folder state :
root@truenas[~]# ls /dev
acpi dtrace pci
ada0 dumpdev pf
ada0p1 efi ptmx
ada0p2 enc@n3061686369656d30 pts
ada1 fd random
ada1p1 fido reroot
ada1p2 full ses0
ada2 geom.ctl snp
ada2p1 gptid stderr
ada2p2 hpet0 stdin
ada3 input stdout
ada3p1 io sysmouse
ada3p2 iscsi tcp_log
apm kbd0 ttyu0
apmctl kbd1 ttyu0.init
atkbd0 kbdmux0 ttyu0.lock
audit klog ttyv0
auditpipe kmem ttyv1
aux led ttyv2
bpf mdctl ttyv3
bpf0 mem ttyv4
cam mirror ttyv5
console mlx5ctl ttyv6
consolectl netdump ttyv7
cpuctl0 nfslock ttyv8
cpuctl1 null ttyv9
cpuctl2 nvd0 ttyva
cpuctl3 nvd0p1 ttyvb
cpuctl4 nvd1 ufssuspend
cpuctl5 nvd1p1 ugen0.1
cpuctl6 nvd1p2 ugen0.2
cpuctl7 nvd1p3 ugen0.3
crypto nvme0 ugen0.4
ctty nvme0ns1 uhid0
cuau0 nvme1 uinput
cuau0.init nvme1ns1 urandom
cuau0.lock pass0 usb
da0 pass1 usbctl
devctl pass2 xpt0
devctl2 pass3 zero
devstat pass4 zfs
drm pass5


Since then uninstalled the Intel drivers in the plex jail, still nothing.

Just so I'm sure it's ok for my iGPU :
root@truenas[~]# lspci -q
00:00.0 Host bridge: Intel Corporation 10th Gen Core Processor Host Bridge/DRAMRegisters (rev 03)
00:02.0 VGA compatible controller: Intel Corporation CometLake-S GT2 [UHD Graphics 630] (rev 03)
00:14.0 USB controller: Intel Corporation Comet Lake PCH-V USB Controller
00:14.2 Signal processing controller: Intel Corporation Comet Lake PCH-V Thermal Subsystem
00:16.0 Communication controller: Intel Corporation Device a3ba
00:17.0 SATA controller: Intel Corporation 400 Series Chipset Family SATA AHCI Controller
00:1b.0 PCI bridge: Intel Corporation Device a3eb (rev f0)
00:1d.0 PCI bridge: Intel Corporation Device a398 (rev f0)
00:1f.0 ISA bridge: Intel Corporation Device a3c8
00:1f.2 Memory controller: Intel Corporation Memory controller
00:1f.3 Audio device: Intel Corporation Device a3f0
00:1f.4 SMBus: Intel Corporation Comet Lake PCH-V SMBus Host Controller
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (12) I219-V
01:00.0 Non-Volatile memory controller: Kingston Technology Company, Inc. A2000NVMe SSD (rev 03)
02:00.0 Non-Volatile memory controller: Device 1d79:2263 (rev 03)

Can someone explain me if my /dev folder can be returned back to normal or if it is normal like this and maybe tell me something I didn't tried to make it work ?
 
Top