Solved popcornmix's Leia_pi4 branch on RPi4 build runs but no video when playing
#1
I built the Leia_pi4 fork by @popcornmix  but video play back does not work.  I get either a blank screen (audio plays), or a frozen GUI (no video/no audio).  I verified my hardware (RPi4B 4G) is good by playing the same videos running LE.  I'd like to get this fork running on Arch ARM while Kodi v19 is under development.

Here is the kodi.log when trying to play a video (h264). I was able to hit the "x" key to stop it after 5-10 second.
Here is the kodi.log when trying to play a x265 video. It crashed kodi.

Here is how I built the fork:
(2019-07-19, 13:12)popcornmix Wrote: Ah okay, leia_pi4 is a temporary hack.
You need to do a little surgery to make it build as it needs mmal headers and pc files but not the opengl ones.

I build with:
Code:
PKG_CONFIG_PATH=/home/pi/projects/kodi/vc/lib/pkgconfig cmake ../kodi_mmal -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local -DCORE_PLATFORM_NAME=gbm -DGBM_RENDER_SYSTEM=gles -DENABLE_VAAPI=OFF -DENABLE_VDPAU=OFF

and I've copied to /home/pi/projects/kodi/vc/lib/pkgconfig
bcm_host.pc mmal.pc  vcsm.pc        

1) I copied bcm_host.pc mmal.pc vcsm.pc into /pkgconfig in my build root.
2) I renamed the following directories from the buildroot: /opt/vc/include/{EGL,GLES,GLES2} appending a hyphen to them so the build would not look into them.

With the buildroot prepared, I built the fork with this cmake stanza which completes without error:
Code:
  export PKG_CONFIG_PATH="/pkgconfig"

  cmake -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
    -DCMAKE_BUILD_TYPE=Debug \
    -DVERBOSE=ON \
    -DENABLE_INTERNAL_FFMPEG=ON \
    -DENABLE_INTERNAL_FMT=ON \
    -DENABLE_INTERNAL_CROSSGUID=ON \
    -DENABLE_INTERNAL_FSTRCMP=ON \
    -DENABLE_INTERNAL_FLATBUFFERS=ON \
    -DENABLE_VAAPI=OFF \
    -DENABLE_VDPAU=OFF \
    -Dlibdvdcss_URL="/kodi-libdvdcss-1.4.2-Leia-Beta-5.tar.gz" \
    -Dlibdvdnav_URL="/kodi-libdvdnav-6.0.0-Leia-Alpha-3.tar.gz" \
    -Dlibdvdread_URL="/kodi-libdvdread-6.0.0-Leia-Alpha-3.tar.gz" \
    -DFFMPEG_URL="/kodi-ffmpeg-4.0.3-Leia-18.2.tar.gz" \
    -DFMT_URL="/kodi-fmt-5.1.0.tar.gz" \
    -DCROSSGUID_URL="/kodi-crossguid-8f399e8bd4.tar.gz" \
    -DFSTRCMP_URL="/kodi-fstrcmp-0.7.D001.tar.gz" \
    -DFLATBUFFERS_URL="/kodi-flatbuffers-1.9.0.tar.gz" \
    -DCORE_PLATFORM_NAME=gbm \
    -DGBM_RENDER_SYSTEM=gles \
    ../xbmc-"932b08f071fd6cf8d95d01fe0c9e186821a38983"
  make
  make preinstall

For completeness, here is the cmake build log.
Need help programming a Streamzap remote?
Reply
#2
(2019-07-21, 21:53)graysky Wrote: Here is the kodi.log when trying to play a video (h264). I was able to hit the "x" key to stop it after 5-10 second.
Can't see an obvious error. Does it play if you disable MMAL in video acceleration options?
Reply
#3
Two things I'd suggest trying:

Switch to 1080p60 in system video settings.
I think you are using 2560x1440 which I've seen some reported issues with.

Switch to HDMI (or analogue) Pi Sink (I think you are using alsa).
Reply
#4
(2019-07-22, 12:45)popcornmix Wrote: Can't see an obvious error. Does it play if you disable MMAL in video acceleration options? 

No, I get the same result with or without MMAL acceleration enabled. 
(2019-07-22, 13:39)popcornmix Wrote: Two things I'd suggest trying:

Switch to 1080p60 in system video settings.
I think you are using 2560x1440 which I've seen some reported issues with.

Switch to HDMI (or analogue) Pi Sink (I think you are using alsa).

I switched to 1920x1080 but get the same result. Also, switching audio to Pi Sink does not help. Running it on LE @ 2560x1440 works fine.

...could there be some permissions issues that would keep the kodi user from using acceleration or something like that?

Here is what I have for the user and some udev rules:
Code:
# id kodi
uid=969(kodi) gid=969(kodi) groups=969(kodi),90(network),98(power),5(tty),995(audio),994(disk),993(input),990(optical),988(storage),986(video)
 
Code:
# cat /etc/udev/rules.d/99-kodi.rules
SUBSYSTEM=="bcm2708_vcio",GROUP="video",MODE="0660"
SUBSYSTEM=="vc-sm",GROUP="video",MODE="0660"
SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"
SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0660"
 
Code:
# cat /usr/share/polkit-1/rules.d/10-kodi.rules :(
polkit.addRule(function(action, subject) {
if (subject.user == "kodi") {
polkit.log("action=" + action);
polkit.log("subject=" + subject);
if (action.id.indexOf("org.freedesktop.login1.") == 0) {
return polkit.Result.YES;
}
if (action.id.indexOf("org.freedesktop.udisks.") == 0) {
return polkit.Result.YES;
}
}
});

I created a new kodi profile to just be using defaults. Here is the complete kodi crash log... and below is a key line maybe... "CMMALVideo::Open : Video codec unknown: ad"
Code:
...
2019-07-22 19:30:14.970 T:2534613312 DEBUG: Open - probing detected format [mov,mp4,m4a,3gp,3g2,mj2]
2019-07-22 19:30:14.971 T:2534613312 DEBUG: Open - avformat_find_stream_info starting
2019-07-22 19:30:14.972 T:2534613312 DEBUG: Open - av_find_stream_info finished
2019-07-22 19:30:14.972 T:2534613312 INFO: ffmpeg[97132140]: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mnt/test/BigBuckBunny_2000hevc.mp4':
2019-07-22 19:30:14.972 T:2534613312 INFO: ffmpeg[97132140]: Metadata:
2019-07-22 19:30:14.972 T:2756112704 DEBUG: Loading settings for /mnt/test/BigBuckBunny_2000hevc.mp4
2019-07-22 19:30:14.972 T:2534613312 INFO: ffmpeg[97132140]: major_brand : iso4
2019-07-22 19:30:14.972 T:2534613312 INFO: ffmpeg[97132140]: minor_version : 1
2019-07-22 19:30:14.972 T:2534613312 INFO: ffmpeg[97132140]: compatible_brands: iso4hvc1
2019-07-22 19:30:14.972 T:2534613312 INFO: ffmpeg[97132140]: creation_time : 2014-08-25T21:13:56.000000Z
2019-07-22 19:30:14.972 T:2534613312 INFO: ffmpeg[97132140]: Duration: 00:00:10.00, start: 0.083333, bitrate: 2013 kb/s
2019-07-22 19:30:14.972 T:2534613312 INFO: ffmpeg[97132140]: Stream #0:0(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv), 3840x2160, 2010 kb/s, 24 fps, 24 tbr, 24k tbn, 24 tbc (default)
2019-07-22 19:30:14.973 T:2534613312 INFO: ffmpeg[97132140]: Metadata:
2019-07-22 19:30:14.973 T:2534613312 INFO: ffmpeg[97132140]: creation_time : 2014-08-25T21:13:56.000000Z
2019-07-22 19:30:14.973 T:2534613312 INFO: ffmpeg[97132140]: handler_name : hevc:[email protected]
2019-07-22 19:30:14.973 T:2534613312 DEBUG: CDVDDemuxFFmpeg::AddStream ID: 0
2019-07-22 19:30:14.973 T:2534613312 NOTICE: Opening stream: 0 source: 256
2019-07-22 19:30:14.973 T:2534613312 NOTICE: Creating video codec with codec id: 173
2019-07-22 19:30:14.973 T:2534613312 ERROR: CMMALVideo::Open : Video codec unknown: ad
2019-07-22 19:30:14.973 T:2534613312 NOTICE: CDVDVideoCodecFFmpeg::Open() Using codec: HEVC (High Efficiency Video Coding)
2019-07-22 19:30:14.974 T:2534613312 DEBUG: CDVDVideoCodecFFmpeg - Updated codec: ff-hevc
2019-07-22 19:30:14.974 T:2534613312 DEBUG: CVideoPlayerVideo::OpenStream - open stream with codec id: 173
2019-07-22 19:30:14.975 T:2534613312 DEBUG: CMMALPool::CMMALPool Created pool 0xad130e60 of size 26 x 0 for port vc.ril.video_decode:out:0(I420)
2019-07-22 19:30:14.975 T:2534613312 DEBUG: CMMALPool::~CMMALPool Destroying pool 0x6045660 for port vc.ril.video_decode:out:0(I420)
2019-07-22 19:30:14.975 T:2534613312 NOTICE: Creating video thread
2019-07-22 19:30:14.976 T:2534613312 DEBUG: ReadEditDecisionLists - Checking for edit decision lists (EDL) on local drive or remote share for: /mnt/test/BigBuckBunny_2000hevc.mp4
Need help programming a Streamzap remote?
Reply
#5
If it is failing without MMAL disabled, then focus on that.
Don't try a 4k hevc file which has far more ways of failing.

Start with a clean .kodi. Disable MMAL. Switch to Pi HDMI sink.
Play an SD video file (that's not hevc).

If that fails provide a log.
Reply
#6
You might want to check this thread where dimitry got a kodi build working from leia_pi4 branch.
Reply
#7
(2019-07-22, 21:53)popcornmix Wrote: If it is failing without MMAL disabled, then focus on that.
Don't try a 4k hevc file which has far more ways of failing.

Start with a clean .kodi. Disable MMAL. Switch to Pi HDMI sink.
Play an SD video file (that's not hevc).

If that fails provide a log.

Good idea.  Clean profile, disabled MMAL, Pi HDMI audio, 1920x1080.  This time playing the 480p big buck bunny.

Result: black screen while video is playing.  Sound is present but no video.  Link to debug log.
Need help programming a Streamzap remote?
Reply
#8
Main difference between your log and mine is you have:
Code:
DEBUG: CRBP::WaitVsync no  vsync 0/1 display:0 delay:0

which suggests CRBP::VSyncCallback is not occurring.

I think this is due to:
[mine]  DEBUG: CRBP::OpenDisplay device:0 m_display:10000030 (0)
[yours] DEBUG: CRBP::OpenDisplay device:0 m_display:0 (0)

which means the call to vc_dispmanx_display_open failed.

First guess is Arch kernel is missing patches. Second guess is some strange timing that Arch kernel has a different effect.

Is there any change in behaviour with "adjust display refresh" enabled/disabled?
How about setting "delay after change of refresh rate" to a few seconds?
Reply
#9
(2019-07-22, 22:44)popcornmix Wrote: Main difference between your log and mine is you have:
Code:
DEBUG: CRBP::WaitVsync no  vsync 0/1 display:0 delay:0

which suggests CRBP::VSyncCallback is not occurring.

I think this is due to:
[mine]  DEBUG: CRBP::OpenDisplay device:0 m_display:10000030 (0)
[yours] DEBUG: CRBP::OpenDisplay device:0 m_display:0 (0)

which means the call to vc_dispmanx_display_open failed.

First guess is Arch kernel is missing patches. Second guess is some strange timing that Arch kernel has a different effect.

Is there any change in behaviour with "adjust display refresh" enabled/disabled?
How about setting "delay after change of refresh rate" to a few seconds?  
  • If I go to Settings/Player > Video and set it to "Adjust display refresh rate = Always" (before it was set to off), no change. Link to debug log.
  • If I switch the "Adjust display refresh rate = off" and then set System/Display>Delay after change of refresh rate = "2.0 sec", no change. Link to debug log.
  • If I have both changes active at the same time, no change. Link to debug log.

About the Arch kernel differences... what distro are you using (is it LE)? I built the Arch kernel using the LE config but found that it would panic on boot. The error was something about not being able to read the root filesystem. Perhaps it is setup for the squashfs that LE uses. I am not expert with kernel configs.

For reference, here is the config Arch ARM uses for RPi4.
Need help programming a Streamzap remote?
Reply
#10
I'm using raspbian kernel. (but LE kernel is also known to work).
Reply
#11
@popcornmix - I built kernel using the LE config with a minor mod: the key was modifying the CONFIG_CMDLINE= to match Arch's.  Booting into it still gave the errors and no video.  Link to debug log.
Need help programming a Streamzap remote?
Reply
#12
Can you try your build on raspbian?
Useful to know if problem is in build or environment (e.g. kernel or perhaps /opt/vc/libs).
Reply
#13
I put my build here: http://repo-ck.com/armv7h/

I'm not totally sure how exactly to do this on Buster.  Arch packages are literally tarballs.  Is it as simple as untarring it and running it on Buster?  How would I handle getting the Raspbian equivalent dependencies? 

Here is the link to the main kodi package I built, would you try it on your Buster: http://repo-ck.com/armv7h/kodi-rbp4-18.3...kg.tar.zst

EDIT:
I installed the Raspbian kodi package thinking it would pull down the needed deps.  Then I untarred my package to /home/pi/local and adjusting the kodi script therein but when I try to run it:
Code:
cd ~/local/usr/bin
./kodi
Error: /usr/lib/kodi/kodi-gbm not found

And:
Code:
cd /home/pi/local/usr/lib/kodi
./kodi-gbm 
./kodi-gbm: error while loading shared libraries: libnfs.so.13: cannot open shared object file: No such file or directory
Need help programming a Streamzap remote?
Reply
#14
Looks like Buster has libnfs.so.12. You could try creating a symlink.
Repeating the build instructions on raspbian may be a more sure way.
Reply
#15
Symlinking worked but there are others I had to symlink including libcdio.so.19, libpcreposix.so.3.13.3, and libtinyxml.so.2.6.2 but I seem to be stuck.
Code:
$~/local/usr/bin/kodi
/home/pi/local/usr/lib/kodi/kodi-gbm: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by /home/pi/local/usr/lib/kodi/kodi-gbm)
/home/pi/local/usr/lib/kodi/kodi-gbm: /usr/lib/arm-linux-gnueabihf/libcdio.so.19: version `CDIO_19' not found (required by /home/pi/local/usr/lib/kodi/kodi-gbm)

EDIT: I even pointed apt-get to the bullseye repos and updated but still no go :/

What can we conclude from me booting Arch ARM with the LE kernel config? Doesn't that rule out a kernel setting as the issue?  There is gave the same message you pointed out:

https://gist.github.com/graysky2/50c6ebb...1-txt-L401
Code:
DEBUG: CRBP::OpenDisplay device:0 m_display:0 (0)
Need help programming a Streamzap remote?
Reply

Logout Mark Read Team Forum Stats Members Help
popcornmix's Leia_pi4 branch on RPi4 build runs but no video when playing0