ophub / amlogic-s9xxx-armbian

Support for Armbian in Amlogic, Rockchip and Allwinner boxes. Support a311d, s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, s905l, rk3588, rk3568, rk3399, rk3328, h6, etc.
GNU General Public License v2.0
5.45k stars 1.74k forks source link

S922x安装jellyfin解码4K压力大 #326

Closed stevenliuit closed 2 years ago

stevenliuit commented 2 years ago

你好 我用jellyfin 解码4K视频 Cpu有一个飙升很高 其他平稳 但是在看视频的时候 4k会很费力 安卓系统的时候看不卡顿 ffmpeg也是最新的 是不是mali的开源驱动解码有问题啊?

ophub commented 2 years ago

cpu占用多少

stevenliuit commented 2 years ago

setcode codepath htop htop2 htop3 上面是gpu访问的/dev/dri/renderD128解码 和jellyfin配置

ophub commented 2 years ago

2大核4小核都齐心协力地工作,不是一个干活其他围观,说明系统调度正常。

你是什么设备?dtb文件是不是有超频版本,你可以试试超频后的工作效率。

我不熟悉jellyfin解码需要什么软件包或者内核模块来配合,你可以搜下相关资料,看看是不是可以在内核里启用什么模块来增加解码效率。可以对照 /boot/config-* 文件查看下 cat /boot/config-* | grep xxx 是否启用,如果没有启用你可以自定义编译内核,启用相关模块。

我看你图片显示内存3.26G,没有正确识别,你可以尝试更换其他系列的内核。比如5.10、5.17

stevenliuit commented 2 years ago

应该是对的 我的是gtking 就直接选的你那个gtking的内核 cpu是s922x wifi5版本的

stevenliuit commented 2 years ago

Linux armbian 5.15.36-flippy-72+o #112 SMP PREEMPT Wed Apr 27 21:29:33 CST 2022 aarch64 aarch64 aarch64 GNU/Linux

stevenliuit commented 2 years ago

cat /boot/config-* | grep xxx 这个命令没有查到 xxx的东西

ophub commented 2 years ago

xxx这个是要换成你要查找的模块

你换成5.17的内核试试,在5.15内核下你的内存识别的少了

stevenliuit commented 2 years ago
# CONFIG_I2C_NVIDIA_GPU is not set
CONFIG_VGA_ARB_MAX_GPUS=16
# CONFIG_DRM_AMDGPU is not set
CONFIG_DRM_VIRTIO_GPU=m

gpu的查看到了这几项

stevenliuit commented 2 years ago

xxx这个是要换成你要查找的模块

你换成5.17的内核试试,在5.15内核下你的内存识别的少了

我试试5.17的内核 thx

stevenliuit commented 2 years ago

下载列表里只有 Armbian_22.05.0-trunk_Odroidn2_jammy_edge_5.17.5.img.gz 这个是5.17的 我的那个型号的没有啊 只有5.15和5.10

ophub commented 2 years ago

armbian-update 5.17.9

各系列的内核都可以直接更新切换,不用重新刷固件。

stevenliuit commented 2 years ago

armbian-update 5.17.9

各系列的内核都可以直接更新切换,不用重新刷固件。

嗯嗯 我试试

ophub commented 2 years ago

我搜了半天Beelink GT King Pro的评测文章和视频,都是一顿夸奖4K流畅播放的,但是没找到他们评测跑4K时的CPU占有率。你可以找找这方面的文章,看看你的CPU占有率是否符合情况。

stevenliuit commented 2 years ago

我怀疑是gpu在linux里的表现不行 好像是gpu开源的不如闭源的给力 我找找文献

stevenliuit commented 2 years ago

网站找到了一个说驱动的

--

本人安装了Armbian_19.11.3_Aml-g12_stretch_legacy_5.3.0_20191126的系统后 装OMV ,折腾jellyfin后想硬件转码,不过没有折腾出来查下相关资料

linux内核 5.4
https://git.kernel.org/pub/scm/l ... son/vdec?h=v5.4 这部分硬解的代码还是staging中 核心中代码也只是mpeg1,2的 没有264 265的,通过amlogic官网的 找到这里关于硬解的介绍

What about multimedia support ? Here is current status on Multimedia support :

GPU : Is supported on S905, S905X/W/L, S905D, S805X and S912 with Lima and Panfrost Linux drivers upstream since v5.2 Mesa support in master : https://gitlab.freedesktop.org/mesa/mesa Closed Source mali driver using https://github.com/superna9999/meson_gx_mali_450 driver and https://github.com/superna9999/amlogic-meson-mali binaires (The ARM provided HiKey binaries are also functional) HDMI Output up to 4k is working on S905, S905X/W/L, S905D, S912, S805X, S905X2, S905Y2, S905D2, S922X, A311D, S905X3, S905D3, S905Y3 (Will need WiP patches for 4k420 support) Video Decoding is being finalized, initial V4L2 driver for MPEG2 decoding has been pushed and is ready to be merged when the firmwares (https://github.com/LibreELEC/meson-firmware) licence is figured out. All of this is being integrated in a specific LibreELEC branch at : https://github.com/LibreELEC/LibreELEC.tv/tree/amlogic and https://github.com/chewitt/LibreELEC.tv/tree/amlogic

地址:https://www.right.com.cn/forum/forum.php?mod=viewthread&tid=1723601&mobile=no

ophub commented 2 years ago

我问问f大吧,对内核的配置我不熟悉,我问问他有什么模块可以给硬解码提供服务。

stevenliuit commented 2 years ago

用命令升级了armbian-update 5.17.5 升级完 开机黑屏了

ophub commented 2 years ago

拔电重插

stevenliuit commented 2 years ago

ip获取不到 hdmi没显示 感觉是废了 电拔了重插的 也没跑码了

ophub commented 2 years ago

5.17.9,不是5,你刚才输入显示下载安装成功了?

stevenliuit commented 2 years ago

说错了 是这个 root@armbian:~# armbian-update 5.17.9 Ready to update, please wait... custom_kernel_name: 5.17.9-flippy-73+ K510 [ 1 ] Unpack [ 5.17.9-flippy-73+ ] related files ... 02.01 Unpack [ boot-5.17.9-flippy-73+.tar.gz ] complete. 02.02 Unpack [ dtb-amlogic-5.17.9-flippy-73+.tar.gz ] complete. 02.03 Unpack [ modules-5.17.9-flippy-73+.tar.gz ] complete.

gzip: stdin: unexpected end of file tar: Child returned status 1 tar: Error is not recoverable: exiting now 02.04 Unpack [ header-5.17.9-flippy-73+.tar.gz ] complete. The u-boot-gtkingpro-rev-a.bin file copy is complete. Successfully updated, automatic restarting...

ophub commented 2 years ago

我的神,这都报错了,没安装成功

stevenliuit commented 2 years ago

5.17.9,不是5,你刚才输入显示下载安装成功了?

是5.17.9 邪门了 不过我看了 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/staging/media/meson/vdec?h=v5.18 5.10到5.18 直邮h264解码 没有h265好像

stevenliuit commented 2 years ago

Error is not recoverable: exiting now

发现了 哈哈 Error is not recoverable: exiting now 这句话 我滴神 我重新刷系统吧

ophub commented 2 years ago

Snip20220523_3

我刚在线更新了5.17.9,内核包是完整的,你本地没有安装解压缩软件包?

ophub commented 2 years ago

sudo apt-get install -y tar

ophub commented 2 years ago

看来我得升级一下更新内核的这个脚本,先检查本地是否安装了解压缩软件包。

stevenliuit commented 2 years ago

刚才我试了 能升级 有一个升级成功了 默认升级到了5.15.41是成功的 指定后反而失败了 我先按你的试试 我先刷机 镜像下载好了 这就刷

stevenliuit commented 2 years ago

看来我得升级一下更新内核的这个脚本,先检查本地是否安装了解压缩软件包。

应该是在线包下载报错导致的 第一次执行报错了

stevenliuit commented 2 years ago

第一次执行报错这个了 root@armbian:~# armbian-update 5.17.9 Ready to update, please wait... Kernel version: 5.17.9 Start downloading kernel to [ /root ]... 01.01 The boot file download complete. 01.02 The dtb file download complete. 01.03 The modules file download complete. [Error] 01.04 The header file failed to download. 然后我就又执行了一次 就废了

ophub commented 2 years ago

脚本不够严谨,得多做几个判断,以后加个md5值比较,以免出现你这样文件下载不完整还继续安装造成的损失。国内访问github有时会很慢。

正经事没办完,先给更新挂了,罪过罪过

stevenliuit commented 2 years ago

哈哈 没事 生命在于折腾 meson-g12b-gsking-x.dtb和meson-g12b-gtking-oc.dtb 这个oc和x有啥区别啊

ophub commented 2 years ago

oc就是超频的意思,你选择这个试试,超频性能更强一些

stevenliuit commented 2 years ago

ok 我试试 改完这就尝试 不成功则成仁 哈哈

ophub commented 2 years ago

稍等。我看了一下gtk pro没有超频版dtb文件,只有meson-g12b-gtking-pro.dtb

你是蓝色的pro版本吧?你发的那个是黑色外壳用的

stevenliuit commented 2 years ago

稍等。我看了一下gtk pro没有超频版dtb文件,只有meson-g12b-gtking-pro.dtb

你是蓝色的pro版本吧?你发的那个是黑色外壳用的

我的就是gtking 不是pro

stevenliuit commented 2 years ago

image 这几个我应该下载哪个啊 我上次下载的忘了 我看有reva 我记得不是这个就是jammy

ophub commented 2 years ago

你在usb里面改/boot/uEnv.txt,改那个dtb名称,改完重启可以正常使用再写入

stevenliuit commented 2 years ago

你在usb里面改/boot/uEnv.txt,改那个dtb名称,改完重启可以正常使用再写入

嗯嗯 我试试

ophub commented 2 years ago

Armbian_22.05.0_Aml_s922x_jammy_5.10.117_server_2022.05.21.img.gz

stevenliuit commented 2 years ago

Armbian_22.05.0_Aml_s922x_jammy_5.10.117_server_2022.05.21.img.gz

嗯嗯 我试试 先吃饭 吃完了继续鼓捣

ophub commented 2 years ago

我问了一下f大,他说硬解模块是 meson_vdec, 可用modprobe meson_vdec装载,但还是需要应用软件支持才行。你看看jellyfin是否支持

stevenliuit commented 2 years ago

我问了一下f大,他说硬解模块是 meson_vdec, 可用modprobe meson_vdec装载,但还是需要应用软件支持才行。你看看jellyfin是否支持

jellyfin支持的硬解有这几个 涉及到我知识盲区了 AMD AMF Intel Quick Sync MediaCodec Android OpenMAX OMX Nvidia NVENC Video Acceleration API (VAAPI) Exynos V4L2 MFC Video ToolBox 这几项

其中网上用的最多的是 Video Acceleration API (VAAPI) 我看咱们这个固件有 /dev/dri/renderD128 大多数是调用这个硬解的 其他的还真不了解 我装完了 用modprobe meson_vdec试试

stevenliuit commented 2 years ago

找到了一篇 大概意思是没支持 https://forum.odroid.com/viewtopic.php?p=343973

stevenliuit commented 2 years ago

image 我查看jellyfin-ffmpeg里面有meson的一个是https://github.com/jellyfin/jellyfin-ffmpeg)/cross-arm64.meson 好像是有关联 不知道行不行

stevenliuit commented 2 years ago

内核升级到了5.17.9 root@armbian:/opt# uname -a Linux armbian 5.17.9-flippy-73+ #47 SMP PREEMPT Wed May 18 17:31:09 CST 2022 aarch64 aarch64 aarch64 GNU/Linux

ffmpeg升级到了5.0.1最新版 root@armbian:/opt# /usr/lib/jellyfin-ffmpeg/ffmpeg -version ffmpeg version 5.0.1-Jellyfin Copyright (c) 2000-2022 the FFmpeg developers built with gcc 11 (Ubuntu 11.2.0-17ubuntu1) configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-shared --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-static --enable-gmp --enable-gnutls --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --toolchain=hardened --enable-cross-compile --arch=arm64 --cross-prefix=/usr/bin/aarch64-linux-gnu- libavutil 57. 17.100 / 57. 17.100 libavcodec 59. 18.100 / 59. 18.100 libavformat 59. 16.100 / 59. 16.100 libavdevice 59. 4.100 / 59. 4.100 libavfilter 8. 24.100 / 8. 24.100 libswscale 6. 4.100 / 6. 4.100 libswresample 4. 3.100 / 4. 3.100 libpostproc 56. 3.100 / 56. 3.100

尝试安装OpenCV不成功 测试解码 cpu还是标高 用的OC的dtb文件 image

stevenliuit commented 2 years ago

image 尝试用最低的360p分辨率播放都不行 没思路了

JFLim1 commented 2 years ago

I see that your picture shows that the memory is 3.26G, which is not correctly identified.

Hi @ophub

I have highlighted before that when your kernel-5.15.y-flippy-xx+o is being booted without using u-boot.ext the RAM indicated is always 3.26GB instead of 3.70GB on GT King Pro.

If you boot 5.15.y-flippy using u-boot.ext htop will indicate RAM is 3.70GB.

ophub commented 2 years ago

I have highlighted before that when your kernel-5.15.y-flippy-xx+o is being booted without using u-boot.ext the RAM indicated is always 3.26GB instead of 3.70GB on GT King Pro.

If you boot 5.15.y-flippy using u-boot.ext htop will indicate RAM is 3.70GB.

我更新了内核仓库和更新脚本,加入了sha256sum检查和必要了依赖包检查,可以保障全部文件都下载完整才安装。你可以使用下面的命令更新本地的固件:

wget https://raw.githubusercontent.com/ophub/amlogic-s9xxx-armbian/main/build-armbian/common-files/rootfs/usr/sbin/armbian-update -O /usr/sbin/armbian-update

ophub commented 2 years ago

I see that your picture shows that the memory is 3.26G, which is not correctly identified.

Hi @ophub

I have highlighted before that when your kernel-5.15.y-flippy-xx+o is being booted without using u-boot.ext the RAM indicated is always 3.26GB instead of 3.70GB on GT King Pro.

If you boot 5.15.y-flippy using u-boot.ext htop will indicate RAM is 3.70GB.

There are differences according to different devices. I didn't add it when I used it, and the memory recognition is normal.

Snip20220524_6