Skip to content

Commit 37f0919

Browse files
fix(jellyfin): expose MPP/RGA, setup permissions, rectify purge script (#661)
* fix(hwacc): use correct flag for RKMPP detection The prior flag `"${LINUXFAMILY}" == "rockchip64"` was returning `false` as the actual value was set to `rk35xx` (tested on ROCK 5T, Noble 25.8.1 Minimal), resulting in no access to hardware acceleration from within the container. Wasn't affecting direct playback, but using any kind of transcoding were resulting in playback error in the Jellyfin clients, and `ffmpeg` error 187 in the container logs. * fix(hwacc): add udev rules for RKMPP In addition to activating the RK35XX conditional block to expose the VPU/MPP hardware, we also need to add the correct `udev` rules (to fix up the group permissions) so that the `jellyfin` container (rather, `jellyfin-ffmpeg` within the container) can access the host's HWA features (MPP and RGA). * chore(formatting): remove stray indentation spaces, use EOT instead of EOF * fix(purge): use correct app installation path for purging * fix(purge): only delete the config, to avoid deleting user media by accident * Fix EOT definitions and style - add tabs * Drop udev rules upon app removal --------- Co-authored-by: Igor Pecovnik <[email protected]>
1 parent 52c6c08 commit 37f0919

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

tools/modules/software/module_jellyfin.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,19 @@ function module_jellyfin () {
2424

2525
# Hardware acceleration
2626
unset hwacc
27-
if [[ "${LINUXFAMILY}" == "rockchip64" && "${BOOT_SOC}" == "rk3588" ]]; then
27+
if [[ "${LINUXFAMILY}" == "rk35xx" && "${BOOT_SOC}" == "rk3588" ]]; then
28+
# Add udev rules according to Jellyfin's recommendations for RKMPP
29+
cat > "/etc/udev/rules.d/50-rk3588-mpp.rules" <<- EOT
30+
KERNEL=="mpp_service", MODE="0660", GROUP="video"
31+
KERNEL=="rga", MODE="0660", GROUP="video"
32+
KERNEL=="system", MODE="0666", GROUP="video"
33+
KERNEL=="system-dma32", MODE="0666", GROUP="video"
34+
KERNEL=="system-uncached", MODE="0666", GROUP="video"
35+
KERNEL=="system-uncached-dma32", MODE="0666", GROUP="video" RUN+="/usr/bin/chmod a+rw /dev/dma_heap"
36+
EOT
37+
udevadm control --reload-rules && udevadm trigger
38+
39+
# Pack `hwacc` to expose MPP/VPU hardware to the container
2840
for dev in dri dma_heap mali0 rga mpp_service \
2941
iep mpp-service vpu_service vpu-service \
3042
hevc_service hevc-service rkvdec rkvenc vepu h265e ; do \
@@ -76,10 +88,13 @@ function module_jellyfin () {
7688
"${commands[1]}")
7789
if [[ "${container}" ]]; then docker container rm -f "$container" >/dev/null; fi
7890
if [[ "${image}" ]]; then docker image rm "$image" >/dev/null; fi
91+
# Drop udev rules upon app removal
92+
rm -f "/etc/udev/rules.d/50-rk3588-mpp.rules"
93+
udevadm control --reload-rules && udevadm trigger
7994
;;
8095
"${commands[2]}")
8196
${module_options["module_jellyfin,feature"]} ${commands[1]}
82-
if [[ -n "${NAVIDROME_BASE}" && "${NAVIDROME_BASE}" != "/" ]]; then rm -rf "${NAVIDROME_BASE}"; fi
97+
if [[ -n "${JELLYFIN_BASE}" && "${JELLYFIN_BASE}" != "/" ]]; then rm -rf "${JELLYFIN_BASE}/config"; fi
8398
;;
8499
"${commands[3]}")
85100
if [[ "${container}" && "${image}" ]]; then

0 commit comments

Comments
 (0)