Very slow with 4k

Hi, I just plugged my 4k TV into my rasp 4 and video frame rate became abysmal. Kind of like a silent movie. However, It was ok on my computer monitor, which is 2556x1440, no so too low either.
What could be wrong?
Also, my tv remote isn’t recognized … but that’s something else…

I do not have any 4K monitors or TV to hook to but you need to give your /boot/config.txt to see how it is configured for the 4k monitor at least.

Depending on if you are using KMS or FKMS there are 2 different packages for libcec to choose from. Then when the right one is installed go into your TV and configure it’s CEC to connect to the pi. The only time I have seen the remote work is using kodi but you gave no info on if you are using that either or steps you took to install kodi.

community/libcec-rpi 6.0.2-4
    Pulse-Eight's libcec for the Pulse-Eight USB-CEC adapter (Raspberry Pi using kms)
community/libcec-rpi-fkms 6.0.2-4
    Pulse-Eight's libcec for the Pulse-Eight USB-CEC adapter (Raspberry Pi using fkms)

Hi, my configuration should be untouched…

$~> sudo cat /boot/cmdline.txt 
root=PARTUUID=6dcc5a3c-02 rw rootwait console=serial0,115200 console=tty3 selinux=0 quiet splash plymouth.ignore-serial-consoles smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=serial0,115200 usbhid.mousepoll=8 audit=0
$~> sudo cat /boot/config.txt 
# See /boot/overlays/README for all available options

#gpu_mem=64
initramfs initramfs-linux.img followkernel
kernel=kernel8.img
arm_64bit=1
disable_overscan=1

#enable sound
dtparam=audio=on
#hdmi_drive=2

#enable vc4
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
disable_splash=1

I installed kodi using the kodi aur package and start it directly using the desktop manager.

Thanks for your tips concerning libcec, I’ll look into that (but that’s not what’s troubling me…)!

Wrong kodi. Wrong config for 4K60. There is no GPU HW decoding at all what you have. The kodi-rpi package in the repo is what you want and it is designed to not run under a DE to use HW decoding. It will boot straight into kodi.

It will take me a while to type up things to get you changed over.

First uninstall everything kodi you installed.

Then install everything needed from the repo after doing a pacman -Syy:

sudo pacman -S kodi-rpi kodi-rpi-dev kodi-rpi-eventclients kodi-rpi-tools-texturepacker libcec-rpi linux-rpi4 xf86-video-fbdev libcec-rpi

Disable your existing display manager. Mine is lightdm:

sudo systemctl disable lightdm.service

Enable kodi.service:

sudo systemctl enable kodi.service

Your config.txt for kodi-rpi:

#gpu_mem=64
initramfs initramfs-linux.img followkernel
kernel=kernel8.img
arm_64bit=1
disable_overscan=1
arm_boost=1

#enable sound
dtparam=audio=on
#hdmi_drive=2

#enable vc4
#dtoverlay=vc4-fkms-v3d
dtoverlay=vc4-fkms-v3d,cma-512
#max_framebuffers=2
dtoverlay=rpivid-v4l2
disable_fw_kms_setup=1

# Video
hdmi_enable_4kp60=1
#force_turbo=1  # Enable if video breaks with hdmi_enable_4kp60=1

disable_splash=1

Reboot and it will go straight into kodi. the right libcec should be installed now but you may have to connect to the rpi in the tv’s Settings.

Reverse config.txt settings and disable kodi.service and enable your display manager to go back to your DE.

Some notes:

The default user will be kodi.
kodi home directory will be /var/lib/kodi.
So put test video in /var/lib/kodi/Videos so you can get to it after setting up the video directory in kodi.

1 Like

Thank you for all that valuable information!
In the past, I did not install the kodi-rpi package, because I wanted to be able to login as a different user with a desktop environment. You don’t think that’s possible with a less ‘walled garden’ setup?

This kodi was made for the rpi by a RPi Foundation member because of limitations with in a DE and gets more complicated with the gpu with a 64bit OS.

I switch back and forth all of the time by disabling and enabling a few lines in the config.txt and disabling and enabling the lightdm.service and kodi.service. It is no problem; only takes a few seconds and rebooting.

You will be amazed how much better kodi performs.

Cool, I will try that, thanks a lot!

Here is the Specs playing a NASA UHD 60 FPS stream off a satellite using GPU HW decoding. This will not play at all from with in a DE using kodi. Notice the cpu usage.

nasa

I had no time to apply these changes, but just for the sake of correctness, I am not starting kodi from a DE. I start kodi directly as a (kind of) DE directly from the DM.

I think it would be better if someone from the community help you in documenting these on Manjaro Wiki, As I see you have to type these again and again for users to go through.

It would be better to call for community members to volunteer in helping you write a wiki page for rpi4 and document all these fine details.

You’re doing a great job for the manjaro community.

@strit has the instructions in every branch update. I just mostly copy and paste.

This still does not change anything even with kodi-rpi. You are still launching kodi from with in a graphical environment which it will sense. You will still loose h264/h265 GPU HW decoding. You need to launch kodi-rpi from with in a terminal where it does not see a graphical environment.

Another option if you want to log in to kodi as your user and have mp4/hevc HW decoding is:

Uninstall and install the packages mentioned above.
Make the changes in config.txt stated above.
Do not switch out your Display Manager or enable kodi.service.
Boot to the Display Manager or go ahead and login to the DE.
Exit the Graphical mode and switch to a terminal with CTRL-ALT-F2.
Log in as your user at the login prompt.
Start kodi with the command: kodi-standalone.

After you are through with kodi to go back to Graphical mode exit kodi and it will return you back to the terminal. Note: Hit the enter key to return to the terminal prompt. Then do a:

CTRL-ALT-F7

You can switch back to run kodi at any time while in Graphical mode with CTRL-ALT-F2

Another note is Plasma had issues in the past with switching back and forth and I had to set some variable for it to work right. That was a long time ago and I do not know if that situation still exists or not. That was a long time ago when I was testing with Plasma.