Jellyfin Forum
QSV terribly slow on TrueNAS Scale - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: QSV terribly slow on TrueNAS Scale (/t-qsv-terribly-slow-on-truenas-scale)



QSV terribly slow on TrueNAS Scale - Thorshani - 2024-01-29

Hey all!

I cannot seem to figure out why QuickSync decoding is basically not working on my TrueNAS box (running TrueNAS-SCALE-23.10.1.3). My CPU is an i5-8500. I have tried using both QSV and VAAPI, both produce similar results of loading extremely slowly (5+ minutes with QSV to start a movie, around 1 minute for VAAPI) and then freezing after 5 seconds. Turning off HWA is a slight improvement, but still unusable, and also produces a +50% load on the CPU. I have all codecs selected except for AV1. I have tried having both Intel Low-Power encoding options enabled (but shouldn't affect decoding anyway if I understand correctly).

Under Jellyfin (running 10.8.13.1) configuration in TrueNAS, I have tried selecting anything from 0-5 for "Allocate x gpu.intel.com/i915 GPU" under GPU Resource. Doesn't seem to make a difference. Additionally this is all being done remotely by using Tailscale. Both Tailscale and Jellyfin are bound to my remote host network.

The ability to use QSV should be present by checking 'ls /dev/dri' and seeing renderD*
my output:
Code:
by-path  card0  renderD128

Drivers should be working after checking with 'lsmod | grep i915'
my output:
Code:
i915                3051520  1
drm_buddy              20480  1 i915
drm_display_helper    184320  1 i915
cec                    61440  2 drm_display_helper,i915
ttm                    94208  1 i915
drm_kms_helper        204800  2 drm_display_helper,i915
i2c_algo_bit          16384  1 i915
drm                  614400  6 drm_kms_helper,drm_display_helper,drm_buddy,i915,ttm
video                  65536  1 i915

Anything else I can check? I've tried making sense of the logs to no avail. What else to try?
Thanks so much!


RE: QSV terribly slow on TrueNAS Scale - Efficient_Good_5784 - 2024-01-29

You can post the logs here for others to read and make sense of. Just make sure to comment out external IPs and sensitive paths/filenames.

You're only accessing your server through Tailscale? Are you not present in the physical location of your server? Or are you using Tailscale while being right next to the server?
Going off of my experience using Tailscale with Jellyfin (both installed on a Truenas Scale server), it takes a while for episodes to load into the player (with good connections on both sides no less).

It sounds like HWA is working for you. You stated that your CPU load increases with HWA off. With HWA being on, if it doesn't work, your streams would fail to even play.
Also make sure that you're using those commands to check for HWA ability through the container's shell. If you're doing so on Truenas's shell, that's not what the container might see. You have to open up the shell for the container itself, then run that command to see what the container sees.


RE: QSV terribly slow on TrueNAS Scale - TheDreadPirate - 2024-01-29

Are you running jellyfin with docker? Or the True Chart app?


RE: QSV terribly slow on TrueNAS Scale - Thorshani - 2024-01-30

(2024-01-29, 09:09 PM)Efficient_Good_5784 Wrote: You can post the logs here for others to read and make sense of. Just make sure to comment out external IPs and sensitive paths/filenames.

You're only accessing your server through Tailscale? Are you not present in the physical location of your server? Or are you using Tailscale while being right next to the server?
Going off of my experience using Tailscale with Jellyfin (both installed on a Truenas Scale server), it takes a while for episodes to load into the player (with good connections on both sides no less).

It sounds like HWA is working for you. You stated that your CPU load increases with HWA off. With HWA being on, if it doesn't work, your streams would fail to even play.
Also make sure that you're using those commands to check for HWA ability through the container's shell. If you're doing so on Truenas's shell, that's not what the container might see. You have to open up the shell for the container itself, then run that command to see what the container sees.

I am only accessing it through Tailscale, the server is on another continent. But after more digging, I am thinking it could simply be a connection issue on the server side. I ran iperf3 and got an average bandwidth of 10.7 Mbits/sec, which, given the options for stream quality on Jellyfin, choosing anything over like 720p - 8 Mbps would start to be limited, right? Really unfortunate. And this does seem to be confirmed with testing. I know the server is connected directly via ethernet but it's not fiber or anything (yet). I'm not sure what else I could do at this point. I'm going to confirm by having someone use a normal computer to check speedtest results.

If it could still be something else I could post logs or double check what the Jellyfin container sees.

(2024-01-29, 09:16 PM)TheDreadPirate Wrote: Are you running jellyfin with docker?  Or the True Chart app?

I believe it's technically the Charts app, but it's found in the standard "TRUENAS" catalog now, with the url being https://github.com/truenas/charts.git. I believe in the past you had to add a different catalog to get it.


RE: QSV terribly slow on TrueNAS Scale - Efficient_Good_5784 - 2024-01-30

(2024-01-30, 10:27 AM)Thorshani Wrote: I am only accessing it through Tailscale, the server is on another continent.

That would probably explain this. This is no longer an issue about network bandwidth, but also of network latency. You're at the mercy of all the connections providing you access to your server when you're that far apart from your server. Your ping to and from the server might be really high. As in, by the time your server gets notified that your transcode needs to progress, you have been waiting on a buffering screen for some time.

Lets take something like youtube as an example. Youtube has multiple server scattered across the world. The most popular videos are cached on each server, while the more obscure videos are stored on fewer servers. When you request a video on youtube, your redirected to the closest server to your area that will handle giving you the data that you requested. This is to avoid latency issues.

I would check to see if you have the "throttle transcodes" option enabled under your dashboard playback settings. If that's on, your server will stop transcoding until it gets signal that a client is reaching the end of the provided buffer.

I don't know what your situation is with being in another continent than your server (which I assume you own), but I would assume physically moving the server to where you're located would lessen this issue. That or making a new server where you're located, then redownloading your media to it over the internet.

Though as I said with my experience using Tailscale, being in the same location as my server and connecting to it through Tailscale with my mobile phone's 4G network, it takes a while to load anything to view through Jellyfin. Sometimes it takes a few seconds, sometimes it takes like a minute to load the video.

(2024-01-30, 10:27 AM)Thorshani Wrote:
(2024-01-29, 09:16 PM)TheDreadPirate Wrote: Are you running jellyfin with docker?  Or the True Chart app?

I believe it's technically the Charts app, but it's found in the standard "TRUENAS" catalog now, with the url being https://github.com/truenas/charts.git. I believe in the past you had to add a different catalog to get it.
Yeah, the company behind Truenas (IXsystems) has an official Jellyfin app directly from their own repo for Truenas Scale. Truecharts was first to provide a Jellyfin app through their own repo, but they're a 3rd party that also tailor their apps to Truenas Scale too.


RE: QSV terribly slow on TrueNAS Scale - Thorshani - 2024-01-30

(2024-01-30, 03:51 PM)Efficient_Good_5784 Wrote:
(2024-01-30, 10:27 AM)Thorshani Wrote: I am only accessing it through Tailscale, the server is on another continent.

That would probably explain this. This is no longer an issue about network bandwidth, but also of network latency. You're at the mercy of all the connections providing you access to your server when you're that far apart from your server. Your ping to and from the server might be really high. As in, by the time your server gets notified that your transcode needs to progress, you have been waiting on a buffering screen for some time.

Lets take something like youtube as an example. Youtube has multiple server scattered across the world. The most popular videos are cached on each server, while the more obscure videos are stored on fewer servers. When you request a video on youtube, your redirected to the closest server to your area that will handle giving you the data that you requested. This is to avoid latency issues.

I would check to see if you have the "throttle transcodes" option enabled under your dashboard playback settings. If that's on, your server will stop transcoding until it gets signal that a client is reaching the end of the provided buffer.

I don't know what your situation is with being in another continent than your server (which I assume you own), but I would assume physically moving the server to where you're located would lessen this issue. That or making a new server where you're located, then redownloading your media to it over the internet.

Though as I said with my experience using Tailscale, being in the same location as my server and connecting to it through Tailscale with my mobile phone's 4G network, it takes a while to load anything to view through Jellyfin. Sometimes it takes a few seconds, sometimes it takes like a minute to load the video.

I see what you mean. I was hoping my NAS would work as a Jellyfin server no matter where I was in the world. I was already considering creating a second NAS to have at my home, just decided to deploy the remote one first. I did however determine that my pool being encrypted could have a big impact on speed. Unfortunately decided to make the whole pool encrypted rather than individual datasets, so I would need to rebuild the pool and reconfigure everything.

I do not have throttle transcodes enabled.

With your last point, would that mean simply waiting 2 minutes at the start of a 4k movie, or constant buffering for something of that quality?


RE: QSV terribly slow on TrueNAS Scale - Efficient_Good_5784 - 2024-01-30

To explain my last point, it depends entirely on the network between my phone/laptop, Tailscale, and the Jellyfin server.

First, there's almost always some "random" amount of time that I have to wait before any video starts playing. My guess would be that higher bitrate content takes longer to load.

Second, when the video actually starts playing, there are times that it plays fully without stopping. Other times, the video stops and buffers. When it buffers, I wait a few seconds to a minute, then resume play and the video plays again. After this point, the whole video plays fully, or some time later more buffering happens. It appears random to me because most of the variables that affect this are out of my control.


RE: QSV terribly slow on TrueNAS Scale - Thorshani - 2024-01-30

(2024-01-30, 06:16 PM)Efficient_Good_5784 Wrote: To explain my last point, it depends entirely on the network between my phone/laptop, Tailscale, and the Jellyfin server.

First, there's almost always some "random" amount of time that I have to wait before any video starts playing. My guess would be that higher bitrate content takes longer to load.

Second, when the video actually starts playing, there are times that it plays fully without stopping. Other times, the video stops and buffers. When it buffers, I wait a few seconds to a minute, then resume play and the video plays again. After this point, the whole video plays fully, or some time later more buffering happens. It appears random to me because most of the variables that affect this are out of my control.

Alright, well I'm still going to try to come up with a solution as to why I only get 10 Mbps bandwidth. Latency will no doubt still be an issue, but I'm curious what the result would be if I manage to bump that up to 200+ Mbps.

EDIT: On ethernet, I ping my server with an average roundtrip of 179ms. Fairly high, but should that dramatically impact my ability to stream 4k movies?


RE: QSV terribly slow on TrueNAS Scale - TheDreadPirate - 2024-01-30

Do you have a VPN client running?


RE: QSV terribly slow on TrueNAS Scale - Thorshani - 2024-01-30

(2024-01-30, 07:10 PM)TheDreadPirate Wrote: Do you have a VPN client running?

Just Tailscale to connect to my NAS