Issues with Plex (danb35) TrueNas 12.0 and 12.2 Release

lupinlicious

Dabbler
Joined
Jan 13, 2020
Messages
25
Dear all,

So decided to upgrade my FreeNAS 11.3 U5 to TrueNas 12.0 and from the iocage fetch I can see the following:

Code:
[0] 11.2-RELEASE (EOL)
[1] 11.3-RELEASE (EOL)
[2] 11.4-RELEASE
[3] 12.0-RELEASE (EOL)
[4] 12.1-RELEASE
[5] 12.2-RELEASE


12.1 is warning me about EOL in a few months so I decided to upgrade to 12.2

From danb35 script I can see "This script only knows how to enable hardware transcode in FreeNAS 11.3 and TrueNAS 12.0"
Do I need 12.0-RELEASE from iocage (EOL) or does this means TrueNAS itself?

In my config-plex I have added the following lines:
Code:
JAIL_IP="192.168.30.6"
DEFAULT_GW_IP="192.168.30.1"
POOL_PATH="/mnt/MEDiA"
USE_HW_TRANSCODE="1"



When running the script it spits out the following
Code:
Netmask not set, defaulting to /24 (255.255.255.0)
Plex metadata path not set, defaulting to /mnt/MEDiA/plex_data
Plex media path not set, please mount media directory manually when done
This script only knows how to enable hardware transcode in FreeNAS 11.3 and TrueNAS 12.0
Not configuring hardware transcode automatically, please do it manually.
Using stable-release plexmediaserver code
Creating jail pms. This may take a minute, please be patient.
Default mac_prefix specified in defaults.json 'ac1f6b' is invalid. Using 'ae1f6b' mac prefix instead.
pms successfully created!
No default gateway found for ipv6.
* Starting pms
  + Started OK
  + Using devfs_ruleset: 1000 (iocage generated default)
  + Configuring VNET OK
  + Using IP options: vnet
  + Starting services OK
  + Executing poststart OK
Successfully added mount to pms's fstab
Successfully added mount to pms's fstab
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/latest, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
[pms] Installing pkg-1.15.10...
[pms] Extracting pkg-1.15.10: 100%
Updating FreeBSD repository catalogue...
[pms] Fetching meta.conf: 100%    163 B   0.2kB/s    00:01
[pms] Fetching packagesite.txz: 100%    6 MiB   1.1MB/s    00:06
Processing entries: 100%
FreeBSD repository update completed. 32848 packages processed.
All repositories are up to date.
Updating database digests format: 100%
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        plexmediaserver: 1.20.5.3600

Number of packages to be installed: 1

The process will require 221 MiB more space.
75 MiB to be downloaded.
[pms] [1/1] Fetching plexmediaserver-1.20.5.3600.txz: 100%   75 MiB   2.6MB/s    00:30
Checking integrity... done (0 conflicting)
[pms] [1/1] Installing plexmediaserver-1.20.5.3600...
===> Creating groups.
Creating group 'plex' with gid '972'.
===> Creating users
Creating user 'plex' with uid '972'.
[pms] [1/1] Extracting plexmediaserver-1.20.5.3600: 100%
=====
Message from plexmediaserver-1.20.5.3600:

--
multimedia/plexmediaserver includes an RC script:
/usr/local/etc/rc.d/plexmediaserver

TO START PLEXMEDIASERVER ON BOOT:
sysrc plexmediaserver_enable=YES

START MANUALLY:
service plexmediaserver start

Once started, visit the following to configure:
http://localhost:32400/web

@@@ INTEL GPU OFFLOAD NOTES @@@

If you have a supported Intel GPU, you can leverage hardware
accelerated encoding/decoding in Plex Media Server on FreeBSD 12.0+.

The requirements are as follows:

* Install multimedia/drm-kmod: e.g., pkg install drm-fbsd12.0-kmod

* Enable loading of kernel module on boot: sysrc kld_list+="i915kms"
** If Plex will run in a jail, you must load the module outside the jail!

* Load the kernel module now (although reboot is advised): kldload i915kms

* Add plex user to the video group: pw groupmod -n video -m plex

* For jails, make a devfs ruleset to expose /dev/dri/* devices.

e.g., /dev/devfs.rules on the host:

[plex_drm=10]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add include $devfsrules_jail
add path 'dri*' unhide
add path 'dri/*' unhide
add path 'drm*' unhide
add path 'drm/*' unhide

* Enable the devfs ruleset for your jail. e.g., devfs_ruleset=10 in your
/etc/jail.conf or for iocage, iocage set devfs_ruleset="10"

Please refer to documentation for all other FreeBSD jail management
utilities.

* Make sure hardware transcoding is enabled in the server settings

@@@ INTEL GPU OFFLOAD NOTES @@@
plexmediaserver_enable:  -> YES
plexmediaserver_support_path:  -> /config
Successfully removed mount from pms's fstab
* Stopping pms
  + Executing prestop OK
  + Stopping services OK
  + Tearing down VNET OK
  + Removing devfs_ruleset: 1000 OK
  + Removing jail process OK
  + Executing poststop OK
Installation Complete!
Mount your media folder into the jail, then start the jail.
Log in and configure your server by browsing to:
http://192.168.30.6:32400/web



BUT...When I look in TrueNAS under Users and Groups I cannot find 'plex', the group 'video' is also not present

I can also see in the danb35 script that it's calling for kldload /boot/modules/i915kms.ko but I cannot find this in System > Tunables or in the Tasks> Init/Shutdown Scripts. Also in the script it says echo '[devfsrules_bpfjail=101] but in my Jail it shows as 4 and not 101?

Another new weird thing is that plex cannot detect new content unless I change the permissions to 755 in my jail where my media content is stored.
In my dataset, TrueNAS is complaining about it "cannot find username 972 for this user ID". So I created the user 'plex' manually and Group 'plex'

If I add new content it shows up as:
-rwx------+ 1 1000 plex 3517454353 Nov 29 13:07 <my-media-file>
This results as a non-visible content in the plex web, but changing to 755 resolves it.
Even if I change the permission: chown -R plex:plex media/ or chmod -R 755 media/ It still showing me -rwx------+ when adding new content

I can see the following lines in the logs but dri and drm is not visible in plex jail.

Code:
Nov 29 12:42:13 freenas kernel: [drm] Got stolen memory base 0x0, size 0x0
Nov 29 12:42:13 freenas kernel: [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
Nov 29 12:42:13 freenas kernel: [drm] Driver supports precise vblank timestamp query.
Nov 29 12:42:13 freenas kernel: [drm] Connector eDP-1: get mode from tunables:
Nov 29 12:42:13 freenas kernel: [drm]   - kern.vt.fb.modes.eDP-1
Nov 29 12:42:13 freenas kernel: [drm]   - kern.vt.fb.default_mode
Nov 29 12:42:13 freenas kernel: [drm] failed to retrieve link info, disabling eDP
Nov 29 12:42:13 freenas kernel: [drm] Initialized i915 1.6.0 20171222 for drmn0 on minor 0
Nov 29 12:42:13 freenas kernel: [drm] Cannot find any crtc or sizes
Nov 29 12:42:13 freenas drmn0: successfully loaded firmware image with name: i915/kbl_dmc_ver1_04.bin
Nov 29 12:42:13 freenas kernel: [drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)


Anyone else with major issues?

Thanks!
 

lupinlicious

Dabbler
Joined
Jan 13, 2020
Messages
25
sudo iocage exec pms ls /dev/dri
It shows me:
card0 renderD128

In the jail of pms and if I type: ls /dev I can se dri and drm
 

lupinlicious

Dabbler
Joined
Jan 13, 2020
Messages
25
Manage to restore the permissions now and Plex can now see new content in the web
 

lupinlicious

Dabbler
Joined
Jan 13, 2020
Messages
25
Now I think I found my problem, allow_mount_devfs seems to have been unticked in the Jail properties.
Hardware acceleration is now working again.
 
Top