Jump to content

Recommended Posts

Posted (edited)

I want to install jellyfin as a docker container on my Orange pi 5. How can I enable hardware acceleration for it? On the container page (https://hub.docker.com/r/linuxserver/jellyfin) there are instructions for various options, but orange pi 5 is not there of course. I have enabled 3D acceleration as mentioned on the armbian page for orange pi 5.

Edited by Netnax
Posted

Just a guess but I assume it won't work anyways. It would need at least a modified ffmpeg version that supports rockchip vpu which I guess isn't default in these pre-made containers. Could be wrong though.

Posted

I use the 3d accelerated driver and this docker compose code:

version: '3.5'
services:
  jellyfin:
    image: jellyfin/jellyfin
    container_name: jellyfin
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    network_mode: 'host'
    devices:
      - '/dev/dri/card0:/dev/dri/card0' #define what gpu device is being used
      - '/dev/dri/card1:/dev/dri/card1'
      - '/dev/dri/renderD128:/dev/dri/renderD128'
      - '/dev/dri/renderD129:/dev/dri/renderD129'
    volumes:
      - /yourpath:/lib #library where you have jellyfin-ffmpeg6 located
      - /your_path:/config
      - /your_path:/data/tvseries
      - /your_path:/data/movies
    restart: 'unless-stopped'

 

this code you can edit to your convenience, it seems to work for me. I have used VAAPI for transcoding, and it appears to work fine with minimum load in CPU; but i do mention that it appears that av1 doesn't run that well for now. This problem with av1 might improve in the future, I have asked the Jellyfin team to make a transcoding option for the rk3588 we just need enough votes for that dream to become a reality.

Posted

the new jellyfin docker image had released by nyanmisaka. thanks nyanmisaka
https://github.com/jellyfin/jellyfin/pull/10748

docker run -d \
 --name jellyfin \
 --privileged \
 --net=host \
 --restart=unless-stopped \
 --volume /path/to/config:/config \
 --volume /path/to/cache:/cache \
 --volume /path/to/media:/media \
 `for dev in dri dma_heap mali0 rga mpp_service \
    iep mpp-service vpu_service vpu-service \
    hevc_service hevc-service rkvdec rkvenc vepu h265e ; do \
   [ -e "/dev/$dev" ] && echo " --device /dev/$dev"; \
  done` \
 nyanmisaka/jellyfin:latest-rockchip

 

Posted
1 hour ago, LoneExile said:

6.5.0-rc5-edge-rockchip-rk3588

never heard of that version. Current mainline is 6.7-rc

 

Anyway the stuff mentioned on the download page works with legacy 5.10.y kernel only.

Posted (edited)

@LoneExile

This is my process

  • I used 5.10.x kernel, which was already there when I installed the system
  • as @nyanmisaka he said,download the OpenCL,then use 
    sudo apt install ./libmali-valhall-g610-g13p0-x11-wayland-gbm_1.9-1_arm64.deb

     

  • docker run -d \
     --name jellyfin \
     --privileged \
     --net=host \
     --restart=unless-stopped \
     --volume /path/to/config:/config \
     --volume /path/to/cache:/cache \
     --volume /path/to/media:/media \
     --device /dev:/dev \
     nyanmisaka/jellyfin:latest-rockchip

     

  • maybe need  chmod 777 -R /dev (i'm not sure to run it yes or no


image.png.f30ba52be6962e7229a7fff09802a393.png

image.thumb.png.4cb48399e0b83e266cf9bb39c1ad9fb8.png
image.thumb.png.6eaa49a1eadc232e5cfa483716cc1546.png

 

Edited by leeson
code not show
Posted

Thanks, @Werner, I'm not sure about the build. I created the image 2 months ago. However, after rebuilding the image recently, I've obtained the modules I need.
Also, thank you, @leeson, for the guidance and solution. I've got it running on my Kubernetes cluster now. And Happy New Year, guys! 🎉

image.png.c905c2dad706ea3d10e7fd3bca20990a.png

Posted

does this version of jellyfin able to play h265 smoothly? @leeson because jjm2473/jellyfin-mpp build is having hard time to play h265. and also what transcoding method you use image.png.3841c2c80de6803af2ed046837f9fc1a.png

Posted

First of all, thank you @leeson for pointing out that jellyfin image, transcoding seems to work.
However, I also want home decoding in client app, since this board sometimes is connected to  Armbian from orangepi website, hwaccel was "enabled" from their instructions, but mpv was not using it/neither did jellyfin client.
When I tried to compile modified ffmpeg from nyanmisaka github the screen goes blank, and gnome session fails to start. There were error messages in journalctl about mpp, and something along these lines recently:

Jan 09 22:04:01 orangepi5 gnome-shell[34647]: Running GNOME Shell (using mutter 42.9) as a Wayland display server
Jan 09 22:04:01 orangepi5 gnome-shell[34647]: Added device '/dev/dri/card0' (rockchip) using atomic mode setting.
Jan 09 22:04:01 orangepi5 gnome-shell[34647]: g_hash_table_destroy: assertion 'hash_table != NULL' failed
Jan 09 22:04:01 orangepi5 gnome-shell[34647]: Failed to open gpu '/dev/dri/card1': No suitable mode setting backend found
Jan 09 22:04:01 orangepi5 gnome-shell[34647]: g_str_has_prefix: assertion 'str != NULL' failed
Jan 09 22:04:01 orangepi5 gnome-shell[34647]: g_str_has_prefix: assertion 'str != NULL' failed
Jan 09 22:04:01 orangepi5 gnome-shell[34647]: g_str_has_prefix: assertion 'str != NULL' failed
Jan 09 22:04:01 orangepi5 gnome-shell[34647]: Failed to get string: No error has been recorded.
Jan 09 22:04:01 orangepi5 systemd[7299]: org.gnome.Shell@wayland.service: Main process exited, code=killed, status=11/SEGV
Jan 09 22:04:01 orangepi5 systemd[7299]: org.gnome.Shell@wayland.service: Failed with result 'signal'.
Jan 09 22:04:01 orangepi5 systemd[7299]: Failed to start GNOME Shell on Wayland.

For the reference I was running Armbian 23.11.1 Jammy with Linux 5.10.160-legacy-rk35xx

downloaded from the website not so long ago, not sure if this version involves all required kernel patches or not.

What would be the general direction to troubleshoot? Reinstall everything gpu related, then try compiling ffmpeg again?

Posted

so we use jellyfin server from github, and jellyfin desktop client from docker right? @leeson i will try when my setup complete. currently waiting for custom desk.

Posted (edited)

@StarboardOtter i had tryed with debian12,you need download the jellyfin client app, then add your server's ip or domain ,chose the quality as low, like this,it workedimage.thumb.png.1752b0217063160204cf90319ff94d03.png

here is the link for jellyfin client app https://github.com/jellyfin/jellyfin-media-player/releases .

In general, the Jellyfin client app works by utilizing your client device's GPU for transcoding when your client device's GPU is supported (direct play).

Otherwise, it uses your server device for transcoding.

Sorry, my English is not very good. I hope this helps.

Edited by leeson
Posted (edited)

So with a little bit more of troubleshooting and fresh install from image:
the server side with nyanmisaka image works just fine, transcodes FHD HEVC 10bit into something browsers can play easily.
However, when I try to play the same file in mpv on the host machine rkmpp goes green screen, can play it without hardware decoding though.

Issues begin when I install jellyfin-media-player client from flathub. Please correct me if I am wrong, but flatpaks are similar to containers in a way that they probably have their own mpv without hw acceleration and that's why results are poor?
Did anyone successfully compiled a client? Github instructions seem a little outdated (python vs python3 package, it's a stupid roadblock and so far I haven't figured out how to bypass it).

 

Second edit: I realized that leeson is selecting different quality in the client, forcing the transcode probably on the server side.

Edited by StarboardOtter
Posted

@leeson

 

just have time to try now. but on web browser and jellyfin media client the play method is direct playing. not transcode. is it allright? from what i feel. now i can play HEVC video on web browser. on my old jellyfin this won't happen.image.png.d280a27a95fbc622b19ef017d9ae55d3.png

Posted

@Arif Setiadi  the browser supports h264 direct playing at default,you can try 4k hevc ,it will  transcode from high vedio bitrate to low vedio bitrate when you chose low vedio bitrate ,and transcode from hevc vedio codec to h264 vedio codec

Posted

@Anderson Castro i try. with docker container. but you need to change a little bit. since the docker run cli command on official use net=host I cannot access the jellyfin. so I just delete that line and add this line and work fine for me: 

 

 -e JELLYFIN_PublishedServerUrl=192.168.0.55 `#optional` \
 -p 8096:8096 \
 -p 8920:8920 `#optional` \
 -p 7359:7359/udp `#optional` \
 -p 1900:1900/udp `#optional` \

Posted (edited)

Dont forget that you can now use the vendor 6.1.x kernel now for hardware acceleration using MPP -

 

acas@t6:~$ ls -l /dev/rga
crw-rw---- 1 root video 10, 121 Aug 17 15:12 /dev/rga
acas@t6:~$ ls -l /dev/mpp_service 
crw-rw---- 1 root video 241, 0 Aug 17 15:12 /dev/mpp_service
acas@t6:~$ uname -a
Linux t6 6.1.75-vendor-rk35xx #1 SMP Thu Aug  8 17:42:28 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
acas@t6:~$ hostnamectl
 Static hostname: t6
       Icon name: computer
      Machine ID: 8a38793a5b9543f2a8467803940786e8
         Boot ID: 0840de02a4a249e884141dee335ede77
Operating System: Armbian-unofficial 24.8.0-trunk noble
          Kernel: Linux 6.1.75-vendor-rk35xx
    Architecture: arm64

dont need to be stuck on 5.10 for MPP support. Works fine with rkmppenc just as for kernel 5.10 series.

 

The only quirk is that for Ubuntu 24.04 you have to hack/build rkmppenc from source at the moment.

 

Edited by ozacas
Posted

Using the latest

 

6.1.75-vendor-rk35xx

ls -l /dev | grep -E "mpp|rga|dri|dma_heap"
drwxr-xr-x 2 root root          80 Dec 31  1969 dma_heap
drwxr-xr-x 3 root root         140 Nov  7 09:38 dri
crw------- 1 root root    241,   0 Nov  7 09:38 mpp_service
crw------- 1 root root     10, 122 Nov  7 09:38 rga

 

I am having some issues, very similar to https://forum.radxa.com/t/opencl-fails-with-failed-creating-base-context-during-opening-of-kernel-driver-on-reboots-for-rockchip-rk3558-orange-pi-5-plus/21558

 

That is when I install the OpenCL extensions, it seems to work fine, but upon reboot the system is non responsive.

 

I am following instructions for that that libmali https://github.com/tsukumijima/libmali-rockchip/releases/download/v1.9-1-2d267b0/libmali-valhall-g610-g13p0-gbm_1.9-1_arm64.deb 

 

For the 6.1 LTS kernel on Ubuntu-Rockchip & Armbian and the legacy 5.10 LTS kernel, install v1.9-1-2d267b0.

For the 6.1 LTS kernel on other SBC vendor-made distros, install v1.9-1-55611b0.

 

ocker exec -it jellyfin /usr/lib/jellyfin-ffmpeg/ffmpeg -v debug -init_hw_device rkmpp=rk -init_hw_device opencl=ocl@rk
ffmpeg version 7.0.2-Jellyfin Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto=auto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libharfbuzz --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=arm64 --cross-prefix=/usr/bin/aarch64-linux-gnu- --toolchain=hardened --enable-cross-compile --enable-rkmpp --enable-rkrga
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-init_hw_device' ... matched as option 'init_hw_device' (initialise hardware device) with argument 'rkmpp=rk'.
Reading option '-init_hw_device' ... matched as option 'init_hw_device' (initialise hardware device) with argument 'opencl=ocl@rk'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Applying option init_hw_device (initialise hardware device) with argument rkmpp=rk.
Applying option init_hw_device (initialise hardware device) with argument opencl=ocl@rk.
arm_release_ver: g13p0-01eac0, rk_so_ver: 10
Failed creating base context during opening of kernel driver.
Kernel module may not have been loaded
[AVHWDeviceContext @ 0xaaab04dcb0d0] 1 OpenCL platforms found.
[AVHWDeviceContext @ 0xaaab04dcb0d0] 1 OpenCL devices found on platform "ARM Platform".
arm_release_ver: g13p0-01eac0, rk_so_ver: 10
Failed creating base context during opening of kernel driver.
Kernel module may not have been loaded
[AVHWDeviceContext @ 0xaaab04dcb0d0] 0.0: ARM Platform / Unknown Device

 

Any idea what's up?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines