Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Pi4: poor video performance (kodi, youtube)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
Lebkoungcity
Apprentice
Apprentice


Joined: 16 Nov 2008
Posts: 212
Location: near Lebkoungcity (='Gingerbreadcity' =Nuremberg)

PostPosted: Sat Feb 19, 2022 12:42 pm    Post subject: Pi4: poor video performance (kodi, youtube) Reply with quote

Howdy mates!
(To quote a colleague :lol: )

I have a annoying problem with video performance on my Pi4. It was about one year ago I emerged almost all I needed and then didn't touch it because of a rather troublesome time... But now I managed to have it up-to-date again and began to use it as it was intended: attached to the TV via HDMI to watch stuff with kodi and sometimes fire up xfce4 to watch stuff on youtube (because the add-on for youtube within kodi requires an API-key which I refuse to accquire). Unfortunatly there are framedrops/tearing/or such when watching youtube in epiphany to a degree that makes it quite unusable, no matter which quality-setting is used (I tried to give firefox or chromium a chance but both fail to emerge...). It's almost all the same amount of framedrops/tearing. (144 and 240 don't play at all - strange!) Kodi works fine most of the time but some videos stutter (audio is fluent). I tend to say it's mostly HD - h265 or such material.
The Pi4 is a 8GB and because it should play netflix (we want video performance to be OK before we get a netflix account and pay for it) it's 32bit userland with 64bit kernel. (For some ebuilds I have to boot the 32bit kernel to emerge successfully - is this to be expected? I think so but I don't know how to get around that. But that would be another question.)

I tried some stuff I found here and in other places but without much success. Is this the best one could get? Or did I something wrong?

I'd be happy to provide any information that's needed and because I don't know where to start, here are '/boot/config.txt', '/var/lib/portage/world' and 'emerge --info'.

Thanks a lot for looking into it!
Andy


Code:
thalia /home/pandora # cat /boot/config.txt
#######
# 64-bit-Kernel:
arm_64bit=1
#######


dtparam=audio=on


########
# Video-Modi:
#
# works more or less:
dtoverlay=vc4-fkms-v3d
#
# wiki.gentoo.org:
#dtoverlay=vc4-kms-v3d
#
# forums.gentoo.org:
#dtoverlay=vc4-kms-v3d-pi4.dtbo
########

gpu_mem=256


disable_overscan=1


###########
# forums.gentoo.org:
#enables ffmpeg hardware accellerated video transcoding
dtoverlay=rpivid-v4l2
##########


Code:
thalia /home/pandora # cat /var/lib/portage/world
app-admin/logrotate
app-admin/syslog-ng
app-benchmarks/sysbench
app-editors/mousepad
app-misc/screen
app-portage/cpuid2cpuflags
app-portage/genlop
app-portage/gentoolkit
app-text/wgetpaste
dev-util/ccache
dev-util/strace
media-libs/raspberrypi-userland
media-plugins/alsa-plugins
media-plugins/gst-plugins-meta
media-plugins/kodi-inputstream-adaptive
media-sound/alsa-utils
media-sound/pavucontrol
media-tv/kodi
media-video/vlc
net-misc/ntp
net-misc/yt-dlp
net-wireless/iw
sys-apps/hdparm
sys-apps/hwinfo
sys-apps/i2c-tools
sys-apps/lshw
sys-apps/portage
sys-apps/rng-tools
sys-apps/smartmontools
sys-apps/usbutils
sys-boot/raspberrypi-firmware
sys-devel/distcc
sys-fs/dosfstools
sys-kernel/linux-firmware
sys-kernel/raspberrypi-image
sys-power/cpupower
sys-process/cronie
sys-process/htop
sys-process/iotop
www-client/epiphany
x11-apps/mesa-progs
x11-misc/lightdm
xfce-base/xfce4-meta
xfce-extra/thunar-archive-plugin
xfce-extra/xfce4-clipman-plugin


Code:
thalia /home/pandora # emerge --info
Portage 3.0.30 (python 3.9.9-final-0, default/linux/arm/17.0/armv7a/desktop, gcc-11.2.0, glibc-2.33-r7, 5.10.63-v8+ aarch64)
=================================================================
System uname: Linux-5.10.63-v8+-aarch64-with-glibc2.33
KiB Mem:     7816556 total,   7412640 free
KiB Swap:    5860348 total,   5860348 free
Timestamp of repository gentoo: Sat, 19 Feb 2022 09:30:01 +0000
Head commit of repository gentoo: 2537143c1b566d794b6c6969be399920c92f64b5
sh bash 5.1_p16
ld GNU ld (Gentoo 2.37_p1 p2) 2.37
distcc 3.4 armv7a-unknown-linux-gnueabihf [enabled]
ccache version 4.5.1 [enabled]
app-misc/pax-utils:        1.3.3::gentoo
app-shells/bash:           5.1_p16::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.34.0-r6::gentoo
dev-lang/python:           3.8.12_p1-r1::gentoo, 3.9.9-r1::gentoo, 3.10.0_p1-r1::gentoo
dev-lang/rust-bin:         1.58.1::gentoo
dev-util/ccache:           4.5.1::gentoo
dev-util/cmake:            3.22.2::gentoo
dev-util/meson:            0.60.3::gentoo
sys-apps/baselayout:       2.7-r3::gentoo
sys-apps/openrc:           0.44.10::gentoo
sys-apps/sandbox:          2.25::gentoo
sys-devel/autoconf:        2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.16.4::gentoo
sys-devel/binutils:        2.37_p1-r2::gentoo
sys-devel/binutils-config: 5.4::gentoo
sys-devel/clang:           13.0.0::gentoo
sys-devel/gcc:             11.2.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.6-r6::gentoo
sys-devel/lld:             13.0.0::gentoo
sys-devel/llvm:            13.0.0::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.33-r7::gentoo
Repositories:

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts:
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes

ACCEPT_KEYWORDS="arm"
ACCEPT_LICENSE="@FREE"
CBUILD="armv7a-unknown-linux-gnueabihf"
CFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
CHOST="armv7a-unknown-linux-gnueabihf"
CONFIG_PROTECT="/boot/cmdline.txt /boot/config.txt /etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live ccache config-protect-if-modified distcc distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
GENTOO_MIRRORS="https://104.23.128.5/gentoo/ https://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ https://ftp.fau.de/gentoo http://ftp.halifax.rwth-aachen.de/gentoo/ ftp://mirror.netcologne.de/gentoo/"
LANG="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de_1901 de_DE de en"
MAKEOPTS="-j11 -l4"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac acl alsa arm bluetooth branding bzip2 cairo cec cli crypt dbus dri dts egl elogind encode exif fdk ffmpeg flac fortran gdbm gif gles1 gles2 gpm gtk gui hwaccel iconv ipv6 jpeg lcms libglvnd libnotify mad mng mp3 mp4 mpeg ncurses nls nptl ogg opengl openmp opus pam pango pcre pdf png policykit pulseaudio qrcode qt5 raspberry-pi raspi readline sdl seccomp spell split-usr ssl startup-notification svg system-av1 system-cairo system-ffmpeg system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-png system-sqlite system-webp theora tiff truetype udev udisks unicode upower usb v4l v4l2 vorbis vpx webp widevine wxwidgets x264 x265 xattr xcb xml xv xvid zlib" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_ARM="edsp neon thumb vfp vfpv3 vfpv4 vfp-d32 v4 v5 v6 v7 thumb2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="de-1901 de en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="fbdev v3d vc4" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

_________________
"The most dangerous world view is the world view of the ones who haven't viewed the world."
Alexander von Humboldt (1769-1859)
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Sat Feb 19, 2022 6:43 pm    Post subject: Reply with quote

Hi
Quote:

Unfortunatly there are framedrops/tearing/or such when watching youtube in epiphany to a degree that makes it quite unusable, no matter which quality-setting is used (I tried to give firefox or chromium a chance but both fail to emerge...). It's almost all the same amount of framedrops/tearing. (144 and 240 don't play at all - strange!) Kodi works fine most of the time but some videos stutter (audio is fluent). I tend to say it's mostly HD - h265 or such material.

I had similar problem.
I somehow solved it by
1.Emerging
Code:

sys-apps/rng-tools

2. making sure in /etc/pulse/default.pa you have
Code:

load-module module-udev-detect tsched=0  ###not really necessary but it fixed a kind of audio murmur that accompanied the stuttering.

3.Maje sure your mesa looks like
Code:

[ebuild   R    ] media-libs/mesa-21.3.5::gentoo  USE="X classic egl gallium gbm gles1 gles2 zstd (-d3d9) -debug -llvm -lm-sensors (-opencl) -osmesa (-selinux) -test -unwind -vaapi (-valgrind) (-vdpau) -vulkan -vulkan-overlay -wayland -xa -xvmc -zink" VIDEO_CARDS="v3d vc4 (-crocus) -freedreno (-i915) (-i965) (-intel) (-iris) -lima -nouveau -panfrost (-r100) (-r200) (-r300) (-r600) (-radeon) (-radeonsi) -virgl -vivante (-vmware)"

4.My sample /boot/config.txt
Code:

arm_64bit=1
kernel=kernel8.img
initramfs initramfs-5.10.76-v8+.img

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

### uncomment to set display to 1024x768
#overscan_left=0
#overscan_right=0
#overscan_top=0
#overscan_bottom=0

#framebuffer_width=1024
#framebuffer_height=768
#framebuffer_depth=16

#hdmi_group=2
#hdmi_mode=16

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

# camera
#start_x=1
gpu_mem=128

# uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# additional overlays and parameters are documented /boot/overlays/README

# enable audio (loads snd_bcm2835)
dtparam=audio=on

# enable uart
enable_uart=0

# Disable wifi and bluetooth
#dtoverlay=disable-wifi
#dtoverlay=disable-bt

# Remove test rainbow
disable_splash=1

[pi4]
# enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
#dtoverlay=vc4-kms-v3d
#dtoverlay=vc4-kms-v3d-pi4
max_framebuffers=2

[all]
#over_voltage=6
#arm_freq=2147
#gpu_freq=750

over_voltage=6
arm_freq=2000


Maybe increase gpu_mem to 256.
_________________
:)
Back to top
View user's profile Send private message
Lebkoungcity
Apprentice
Apprentice


Joined: 16 Nov 2008
Posts: 212
Location: near Lebkoungcity (='Gingerbreadcity' =Nuremberg)

PostPosted: Sun Feb 20, 2022 12:23 pm    Post subject: Reply with quote

alamahant,

I checked the points you mentioned so nicely in a list:


1. sys-apps/rng-tools was already there:
Code:
thalia /home/pandora # emerge -pv sys-apps/rng-tools

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-apps/rng-tools-6.14-r2::gentoo  USE="-jitterentropy -nistbeacon -pkcs11 -rtlsdr (-selinux)" 0 KiB


2. When I began to use kodi there was an audio stuttering I was able to solve by adding tsched=0 to default.pa already:
Code:
thalia /home/pandora # cat /etc/pulse/default.pa | grep tsched
load-module module-udev-detect tsched=0


3. mesa looks almost the same as yours - except for USE=llvm - I doubt it would give such an impact but I will try it with USE=-llvm. I will report back when it's emerged.
Code:
thalia /home/pandora # emerge -pv mesa

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] media-libs/mesa-21.3.5::gentoo  USE="X classic egl gallium gbm gles1 gles2 llvm zstd (-d3d9) -debug (-lm-sensors) (-opencl) -osmesa (-selinux) -test -unwind (-vaapi) -valgrind (-vdpau) -vulkan (-vulkan-overlay) -wayland -xa -xvmc -zink" VIDEO_CARDS="v3d vc4 (-crocus) -freedreno (-i915) (-i965) (-intel) (-iris) -lima (-nouveau) -panfrost (-r100) (-r200) (-r300) (-r600) (-radeon) (-radeonsi) -virgl -vivante (-vmware)" 0 KiB


4. In your /boot/config.txt I see you're overclocking your Pi4. Do you think this may be the solution? I thought the Pi4 should have enough power to do HD without overclocking - if it was able to do it at all...
gpu_mem was already set to 256:
Code:
gpu_mem=256

Other differences I see are minor in my eyes (disabling the rainbow test, limiting the max framebuffers to 2 and telling explicitly the kernel's name). But one thing I added after going through your config.txt was:
Code:
enable_uart=0

I had to look up what UART means and while reading about it I stumbled upon one thing I didn't have in my /boot/cmdline.txt: "cgroup_enable=memory" I added it and know it looks like this:
Code:
thalia /home/pandora # cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=PARTUUID=97dd873b-4432-46f5-812e-005e23587d31 rootfstype=ext4 cgroup_enable=memory elevator=deadline rootwait

I rebooted and I can't tell if the h265-video I tried in kodi played more fluent or not. Maybe it does or maybe it doesn't - it's hard to tell. But it still feels like if there were frames missing. (Is there a proper way to find out if kodi drops frames? I have to investigate on this.) In epiphany youtube still does not behave well: 144 and 240 do not play at all (it's this circle going round without end and higher resolutions drop frames constantly so it looks like watching a flip book being used :?

Anyway thank you for your input! At least now I know I'm on the right path :)


--------------------

edit:

OK, that was a quick one, mesa finished rather quickly :D
I rebooted (just to be really sure) and checked both epiphany & youtube and kodi - no difference. Still missing frames, still more missing frames in youtube, no matter which resolution and kodi does drop frames definitely. No doubt about that when keeping an eye on it.
_________________
"The most dangerous world view is the world view of the ones who haven't viewed the world."
Alexander von Humboldt (1769-1859)
Back to top
View user's profile Send private message
Lebkoungcity
Apprentice
Apprentice


Joined: 16 Nov 2008
Posts: 212
Location: near Lebkoungcity (='Gingerbreadcity' =Nuremberg)

PostPosted: Sat Mar 05, 2022 11:16 pm    Post subject: Reply with quote

Hello,

it's been a while for there are far more important things than me and the RP4. But nevertheless yesterday I took a screenshot within kodi which shows that there is no hardware decoding in use. It's all the same no matter what kind of video. But those with lower resolutions than 1080p play fine - the CPU seems to be powerful enough to master this task. When playing 1080p or more it's stuttering more and more. See also the CPU load in the picture.

Quote:
Video-Decoder: ff-h264 (SW)
(...)
Videostream: 1,920x1,088 px, 1,78 AR, 50,000 FPS
(...)
System CPU-Auslastung: #0: 70% #1: 100% #2: 75% #3: 72%


see: https://ibb.co/Q9Dx1py

And in addition this:
Code:

pandora@thalia ~ $ glxinfo -B
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Broadcom (0x14e4)
    Device: V3D 4.2 (0xffffffff)
    Version: 21.3.5
    Accelerated: yes
    Video memory: 7633MB
    Unified memory: yes
    Preferred profile: compat (0x2)
    Max core profile version: 0.0
    Max compat profile version: 2.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: Broadcom
OpenGL renderer string: V3D 4.2
OpenGL version string: 2.1 Mesa 21.3.5
OpenGL shading language version string: 1.20

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 21.3.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10



I followed https://wiki.gentoo.org/wiki/Raspberry_Pi_VC4:

sys-boot/raspberrypi-firmware is present - in the past I also tried -9999 without success:
Code:
pandora@thalia ~ $ qlist -Iv sys-boot/raspberrypi-firmware
sys-boot/raspberrypi-firmware-1.20211118
pandora@thalia ~ $ genlop -t sys-boot/raspberrypi-firmware
 * sys-boot/raspberrypi-firmware

     Wed Mar  3 20:30:31 2021 >>> sys-boot/raspberrypi-firmware-1.20210108
       merge time: 2 minutes and 5 seconds.

     Thu Jan 27 00:06:40 2022 >>> sys-boot/raspberrypi-firmware-1.20211118
       merge time: 2 minutes and 14 seconds.

     Sun Feb 20 18:28:29 2022 >>> sys-boot/raspberrypi-firmware-9999
       merge time: 1 minute and 57 seconds.

     Sun Feb 20 19:30:46 2022 >>> sys-boot/raspberrypi-firmware-1.20211118
       merge time: 35 seconds.


VC4 is in make.conf:
Code:
pandora@thalia ~ $ cat /etc/portage/make.conf | grep vc4
VIDEO_CARDS="fbdev v3d vc4"


egl gles1 gles2 are set as global USE flags
Code:
pandora@thalia ~ $ cat /etc/portage/make.conf | grep egl
egl -emboss
pandora@thalia ~ $ cat /etc/portage/make.conf | grep gles
gbm -geolocation gles1 gles2


The module is enabled in /boot/config.txt (I tried all those in the past):
Code:
pandora@thalia ~ $ cat /boot/config.txt | grep vc4
dtoverlay=vc4-fkms-v3d
#dtoverlay=vc4-kms-v3d
#dtoverlay=vc4-kms-v3d-pi4.dtbo


And gpu_mem ist set to (I played with all of these):
Code:
pandora@thalia ~ $ cat /boot/config.txt | grep gpu
#gpu_mem=320
#gpu_mem=256
gpu_mem=128


Verify if /dev/dri/card0 is there:
Code:
pandora@thalia ~ $ ls -lh /dev/dri/card*
crw-rw----+ 1 root video 226, 0  4. Mär 18:53 /dev/dri/card0
crw-rw----+ 1 root video 226, 1  4. Mär 18:53 /dev/dri/card1


Verify if the module is loaded:
Code:
pandora@thalia ~ $ lsmod | grep v3d
v3d                    81920  3
gpu_sched              40960  1 v3d
drm                   557056  10 gpu_sched,drm_kms_helper,v3d,vc4
pandora@thalia ~ $ lsmod | grep vc4
vc4                   286720  5
cec                    53248  1 vc4
drm_kms_helper        245760  3 vc4
drm                   557056  10 gpu_sched,drm_kms_helper,v3d,vc4
snd_soc_core          241664  1 vc4


And now the final test if VC4 is used (no it isn't...):
Code:
pandora@thalia ~ $ glxgears -info
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
GL_RENDERER   = V3D 4.2
GL_VERSION    = 2.1 Mesa 21.3.5
GL_VENDOR     = Broadcom



Strange thing:
Sometimes /dev/rpivid-h264mem /dev/rpivid-hevcmem /dev/rpivid-intcmem /dev/rpivid-vp9mem are present other times they're not:
Code:
thalia /home/pandora # ls /dev/rpivid-*
ls: Zugriff auf '/dev/rpivid-*' nicht möglich: Datei oder Verzeichnis nicht gefunden

I haven't found a pattern to be able to reproduce it in one way or the other...


What is wrong with my setup?

Thanks,
Andy
_________________
"The most dangerous world view is the world view of the ones who haven't viewed the world."
Alexander von Humboldt (1769-1859)
Back to top
View user's profile Send private message
antonlacon
Apprentice
Apprentice


Joined: 27 Jun 2004
Posts: 257

PostPosted: Thu Mar 10, 2022 7:09 am    Post subject: Reply with quote

Gentoo Wiki's RPi VC4 article is out of date. A VC4 64-bit driver has been available for a couple of years now (RPi even has a 64-bit distro...) As an aside, I'm pretty sure the fkms device tree isn't as well maintained as the regular kms one at this point.

I'm not sure why you're expecting mesa to report VC4. RPi4 has a videocore VI gpu. This uses the mesa v3d driver to run it. VC4 is for videocore 4 (earlier RPi's).

Having said that, hardware video decoding on the RPi4 is done using V4L2-mem2mem. This is under development at the kernel and ffmpeg level. Your setup isn't wrong; the work you need just isn't upstream (and hence available in Gentoo proper).

If this is just a machine you plug into your TV, I would look at LibreElec if you have a spare sd-card laying around to try as it is one of the environments the necessary work is tested in. You can try the Tubed kodi addon for youtube, which I don't believe requires an api key setup.

If you need more general purpose, Raspberry Pi OS (formerly raspbian) should have the necessary work too. I don't know about other distros.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum