[SOLVED] Kodi on RPi4 aarch64: video decoding is not working

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

[SOLVED] Kodi on RPi4 aarch64: video decoding is not working

Postby doragasu1 » Sat Apr 10, 2021 7:24 pm

I had a running 32-bit setup on a RPi4, but I decided to move to 64-bits (mainly to avoid some problems with oom_killer) and I migrated all the setup to aarch64. So far I have everything working flawlessly, excepting Kodi.

Kodi starts OK, but first the UI moves very slowly. And worse, when I try playing a video, it seems to start but the video does not play. Image stays on the menus, the play overlay bar on the bottom on the screen pops and depending on the media sometimes I get sound, but the video does never appear.

I suspect that maybe this is the expected behavior on aarch64 and there is no hardware decoding support. Reading here that´s what it seems to me. But if I go here, it seems that you should be able to play media files...

I am using kodi-rpi (also tried with kodi-rpi-git with same result). My /boot/config.txt has only 2 lines:
$this->bbcode_second_pass_code('', 'enable_uart=1
include kodi.config.txt')

And when I play a file, this is what appears in the logs:

$this->bbcode_second_pass_code('', '2021-04-10 21:08:15.455 T:983 INFO <general>: Creating InputStream
2021-04-10 21:08:15.467 T:983 INFO <general>: Creating Demuxer
2021-04-10 21:08:15.641 T:983 INFO <general>: Opening stream: 0 source: 256
2021-04-10 21:08:15.641 T:983 INFO <general>: Creating video codec with codec id: 27
2021-04-10 21:08:15.641 T:983 INFO <general>: CDVDVideoCodecDRMPRIME::Open - using decoder V4L2 mem2mem H.264 decoder wrapper
2021-04-10 21:08:15.642 T:983 INFO <general>: CDVDVideoCodecDRMPRIME::Open - unable to open codec
2021-04-10 21:08:15.642 T:983 INFO <general>: CDVDVideoCodecDRMPRIME::Open - using decoder H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
2021-04-10 21:08:15.642 T:983 INFO <general>: Creating video thread
2021-04-10 21:08:15.643 T:989 INFO <general>: running thread: video_thread
2021-04-10 21:08:15.643 T:983 INFO <general>: Opening stream: 1 source: 256
2021-04-10 21:08:15.643 T:983 INFO <general>: Finding audio codec for: 86019
2021-04-10 21:08:15.643 T:983 INFO <general>: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder ac3
2021-04-10 21:08:15.643 T:983 INFO <general>: Creating audio thread
2021-04-10 21:08:15.644 T:990 INFO <general>: running thread: CVideoPlayerAudio::Process()
2021-04-10 21:08:15.644 T:983 INFO <general>: Opening stream: 3 source: 256
2021-04-10 21:08:15.649 T:989 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Invalid data found when processing input (-1094995529)
2021-04-10 21:08:15.660 T:990 INFO <general>: Skipped 9 duplicate messages..
2021-04-10 21:08:15.660 T:990 INFO <general>: Creating audio stream (codec id: 86019, channels: 6, sample rate: 48000, no pass-through)
2021-04-10 21:08:15.660 T:842 INFO <general>: CActiveAESink::OpenSink - initialize sink
2021-04-10 21:08:15.660 T:842 INFO <general>: CAESinkALSA::Initialize - Attempting to open device "@:CARD=vc4hdmi1,DEV=0"
2021-04-10 21:08:15.664 T:989 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Invalid data found when processing input (-1094995529)
2021-04-10 21:08:15.665 T:842 INFO <general>: Skipped 9 duplicate messages..
2021-04-10 21:08:15.665 T:842 INFO <general>: CAESinkALSA - Unable to open device "sysdefault:CARD=vc4hdmi1" for playback
2021-04-10 21:08:15.666 T:989 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Invalid data found when processing input (-1094995529)
2021-04-10 21:08:15.669 T:842 INFO <general>: Skipped 35 duplicate messages..
2021-04-10 21:08:15.669 T:842 INFO <general>: CAESinkALSA - Unable to open device "default:CARD=vc4hdmi1" for playback
2021-04-10 21:08:15.669 T:989 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Invalid data found when processing input (-1094995529)
2021-04-10 21:08:15.670 T:842 INFO <general>: Skipped 8 duplicate messages..
2021-04-10 21:08:15.670 T:842 INFO <general>: CAESinkALSA::Initialize - Opened device "front:CARD=vc4hdmi1,DEV=0"
2021-04-10 21:08:15.671 T:842 INFO <general>: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
2021-04-10 21:08:15.671 T:989 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Invalid data found when processing input (-1094995529)
2021-04-10 21:08:15.671 T:842 ERROR <general>: CAESinkALSA::InitializeHW - Unable to find a suitable output format
2021-04-10 21:08:15.671 T:842 INFO <general>: CAESinkALSA::Initialize - Attempting to open device "sysdefault:CARD=ALSA"
2021-04-10 21:08:15.672 T:989 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Invalid data found when processing input (-1094995529)
2021-04-10 21:08:15.677 T:842 INFO <general>: Skipped 5 duplicate messages..
2021-04-10 21:08:15.677 T:842 INFO <general>: CAESinkALSA::Initialize - Opened device "sysdefault:CARD=ALSA"
2021-04-10 21:08:15.678 T:842 INFO <general>: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
2021-04-10 21:08:15.678 T:842 INFO <general>: CAESinkALSA::InitializeHW - Using data format AE_FMT_S16NE
2021-04-10 21:08:15.678 T:989 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Invalid data found when processing input (-1094995529)
2021-04-10 21:08:16.213 T:989 ERROR <general>: Skipped 135 duplicate messages..
2021-04-10 21:08:16.213 T:989 ERROR <general>: CDVDVideoCodecDRMPRIME::Drain - send packet failed: Invalid data found when processing input (-1094995529)
2021-04-10 21:08:16.213 T:989 ERROR <general>: CDVDVideoCodecDRMPRIME::GetPicture - receive frame failed: Invalid data found when processing input (-1094995529)
2021-04-10 21:08:16.290 T:989 ERROR <general>: Skipped 1 duplicate messages..
2021-04-10 21:08:16.290 T:989 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: End of file (-541478725)
2021-04-10 21:08:23.734 T:835 INFO <general>: Skipped 177 duplicate messages..
2021-04-10 21:08:23.734 T:835 INFO <general>: CVideoPlayer::CloseFile()
2021-04-10 21:08:23.734 T:835 INFO <general>: VideoPlayer: waiting for threads to exit
2021-04-10 21:08:23.737 T:983 INFO <general>: CVideoPlayer::OnExit()
2021-04-10 21:08:23.737 T:983 INFO <general>: Closing stream player 1
2021-04-10 21:08:23.737 T:983 INFO <general>: Waiting for audio thread to exit
2021-04-10 21:08:23.737 T:990 INFO <general>: thread end: CVideoPlayerAudio::OnExit()
2021-04-10 21:08:23.737 T:983 INFO <general>: Closing audio device
2021-04-10 21:08:23.787 T:983 INFO <general>: Deleting audio codec
2021-04-10 21:08:23.787 T:842 INFO <general>: CActiveAESink::OpenSink - initialize sink
2021-04-10 21:08:23.787 T:983 INFO <general>: Closing stream player 2
2021-04-10 21:08:23.787 T:983 INFO <general>: waiting for video thread to exit
2021-04-10 21:08:23.787 T:989 ERROR <general>: Got MSGQ_ABORT or MSGO_IS_ERROR return true
2021-04-10 21:08:23.787 T:989 INFO <general>: thread end: video_thread
2021-04-10 21:08:23.787 T:983 INFO <general>: deleting video codec
2021-04-10 21:08:23.789 T:983 INFO <general>: Closing stream player 3
2021-04-10 21:08:23.789 T:835 INFO <general>: VideoPlayer: finished waiting
2021-04-10 21:08:23.789 T:835 INFO <general>: CVideoPlayer::CloseFile()
2021-04-10 21:08:23.789 T:835 INFO <general>: VideoPlayer: waiting for threads to exit
2021-04-10 21:08:23.789 T:835 INFO <general>: VideoPlayer: finished waiting')

I see several errors, but I have no idea what they mean.

So is hardware decoding supported? Is there anything I can do to make Kodi work?
Last edited by doragasu1 on Sun Apr 11, 2021 8:53 am, edited 1 time in total.
doragasu1
 
Posts: 100
Joined: Sun Jun 03, 2012 3:52 pm

Re: Kodi on RPi4 aarch64: video decoding is not working

Postby graysky » Sat Apr 10, 2021 7:41 pm

Yes, HW decoding is supported under all packages/aarch64 and armv7h. Not sure if it matters but /boot/config.txt:
$this->bbcode_second_pass_code('', '
[all]
include kodi.config.txt')

Reboot after modifying that. Try a test clip: https://www.jell.yfish.us/media/jellyfi ... d-hevc.mkv

Post the entire kodi.log with debug enabled.
graysky
Developer
 
Posts: 1727
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Kodi on RPi4 aarch64: video decoding is not working

Postby doragasu1 » Sat Apr 10, 2021 8:31 pm

Thanks for help. Now my /boot/config.txt is:
$this->bbcode_second_pass_code('', 'enable_uart=1

[all]
include kodi.config.txt')

If I remove the enable_uart=1, the machine does not boot, BTW.

Test file did not play, same behavior. The full log with debug info is located here: https://pastebin.com/dkLyuHsY

I think the most relevant parts are:
$this->bbcode_second_pass_code('', '2021-04-10 22:21:22.216 T:1099 ERROR <general>: ffmpeg[(nil)X]: [hevc] Failed setup for format drm_prime: hwaccel initialisation returned error.
2021-04-10 22:21:22.218 T:1099 ERROR <general>: ffmpeg[(nil)X]: [hevc] get_buffer() failed
2021-04-10 22:21:22.218 T:1099 ERROR <general>: ffmpeg[(nil)X]: [hevc] thread_get_buffer() failed
2021-04-10 22:21:22.218 T:1099 DEBUG <general>: ffmpeg[(nil)X]: [hevc] Error parsing NAL unit #1.
2021-04-10 22:21:22.225 T:1045 DEBUG <general>: CLibInputPointer::ProcessMotion - event.type: 3, event.motion.x: 988, event.motion.y: 925
2021-04-10 22:21:22.226 T:1100 ERROR <general>: ffmpeg[(nil)X]: [hevc] get_buffer() failed
2021-04-10 22:21:22.226 T:1100 ERROR <general>: ffmpeg[(nil)X]: [hevc] thread_get_buffer() failed
2021-04-10 22:21:22.226 T:1100 DEBUG <general>: ffmpeg[(nil)X]: [hevc] Error parsing NAL unit #0.
2021-04-10 22:21:22.258 T:1101 ERROR <general>: ffmpeg[(nil)X]: [hevc] get_buffer() failed
2021-04-10 22:21:22.258 T:1101 ERROR <general>: ffmpeg[(nil)X]: [hevc] thread_get_buffer() failed
2021-04-10 22:21:22.258 T:1101 DEBUG <general>: ffmpeg[(nil)X]: [hevc] Error parsing NAL unit #0.
2021-04-10 22:21:22.259 T:1103 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Cannot allocate memory (-12)
2021-04-10 22:21:22.261 T:1102 ERROR <general>: ffmpeg[(nil)X]: [hevc] get_buffer() failed
2021-04-10 22:21:22.262 T:1102 ERROR <general>: ffmpeg[(nil)X]: [hevc] thread_get_buffer() failed
2021-04-10 22:21:22.262 T:1102 DEBUG <general>: ffmpeg[(nil)X]: [hevc] Error parsing NAL unit #0.')

And these errors keep repeating until I shut Kodi down.
doragasu1
 
Posts: 100
Joined: Sun Jun 03, 2012 3:52 pm

Re: Kodi on RPi4 aarch64: video decoding is not working

Postby graysky » Sat Apr 10, 2021 9:36 pm

Are you using linux-aarch64 or linux-raspberrypi4? Guessing aarch64. You need HW decoding in the linux-raspberrypi4 kernel for it to work/mainline kernel doesn't provide them.
graysky
Developer
 
Posts: 1727
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Kodi on RPi4 aarch64: video decoding is not working

Postby doragasu1 » Sun Apr 11, 2021 8:53 am

Wohow, that was the missing piece in the puzzle, playback works flawlessly now. Thanks a lot!

I followed the installation guide here, and maybe it needs to be updated, because unless I screwed something during the process, it installs the aarch64 kernel, but the guide states "This installation has near full support for the device, including the VC4 graphics". Also when I installed the linux-raspberrypi4 kernel, they system panicked on boot because it could not mount the root filesystem. I had to grab the SD and edit /etc/fstab to change mmcblk1p1 to mmclbk0p1, as with the armv7 install.

(now I have to guess why kodi it is not mounting external USB devices as with my previous install, maybe I installed something I forgot)
doragasu1
 
Posts: 100
Joined: Sun Jun 03, 2012 3:52 pm

Re: [SOLVED] Kodi on RPi4 aarch64: video decoding is not wor

Postby graysky » Sun Apr 11, 2021 11:12 am

I added the rpi kernel to the optdepends array to avoid confusion. As to automounting USB, I couldn't get it working with v19. See here which has gone unanswered.
graysky
Developer
 
Posts: 1727
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: [SOLVED] Kodi on RPi4 aarch64: video decoding is not wor

Postby doragasu1 » Sun Apr 11, 2021 11:45 am

Weird because it worked perfect for me with v19 on the 32-bit install. And it was not udisks2 or any other daemon as far as I recall, because drives were mounted in /var/run/kodi/whatever.
doragasu1
 
Posts: 100
Joined: Sun Jun 03, 2012 3:52 pm


Return to ARMv8

Who is online

Users browsing this forum: No registered users and 8 guests