Solved Choppy video playback and high CPU usage on ODROID-C2 (Arch ARM aarch64)
#1
I am running Kodi on Arch ARM on an ODROID-C2.  When playing back 1080p content, the CPU usage is approaching 100% on all 4 cores.  As well, playback becomes choppy.  Here is the debug log.  When I hit "O" while play back is enabled, Kodi is using ff-h264 (SW).  Perhaps I do not have the correct drivers installed for accelerated playback?

The distro package pulled down: odroid-c2-libgl-fb r6p1-3 which has the description of, "ODROID-C2 Mali driver (framebuffer)."
Need help programming a Streamzap remote?
Reply
#2
c:
17:08:37.297 T:547893039120 ERROR: AML: no rw on /dev/amstream*
17:08:37.297 T:547893039120 ERROR: AML: no rw on /sys/class/ppmgr/ppmgr_3d_mode
17:08:37.297 T:547893039120 ERROR: AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
17:08:37.297 T:547893039120 ERROR: AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
17:08:37.297 T:547893039120 ERROR: AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

17:09:04.833 T:546962382464 DEBUG: FactoryCodec - Video: amcodec - Opening
17:09:04.833 T:546962382464 ERROR: AML: no proper permission, please contact the device vendor. Skipping codec...
17:09:04.833 T:546962382464 DEBUG: FactoryCodec - Video: amcodec - Failed

Fix your permissions via udev, rw access to the nodes mentioned in the error is needed.
Friendly advice: stay away from amlogic until they provide a proper, usable, free of crap, non-ancient kernel.
You also need libamcodec dynamically loaded by kodi at runtime which can be obtained from amlogic buildroot.
Reply
#3
Thanks for the quick reply... The permissions look ok, no?
Code:
% ls -lh /dev/amst*
crw-rw-rw- 1 root video 255, 1 Jul  5 15:44 /dev/amstream_abuf
crw-rw-rw- 1 root video 255, 8 Jul  5 15:44 /dev/amstream_hevc
crw-rw-rw- 1 root video 255, 3 Jul  5 15:44 /dev/amstream_mpps
crw-rw-rw- 1 root video 255, 2 Jul  5 15:44 /dev/amstream_mpts
crw-rw-rw- 1 root video 255, 4 Jul  5 15:44 /dev/amstream_rm
crw-rw-rw- 1 root video 255, 5 Jul  5 15:44 /dev/amstream_sub
crw-rw-rw- 1 root video 255, 6 Jul  5 15:44 /dev/amstream_sub_read
crw-rw-rw- 1 root video 255, 7 Jul  5 15:44 /dev/amstream_userdata
crw-rw-rw- 1 root video 255, 0 Jul  5 15:44 /dev/amstream_vbuf

The kodi user is in the right groups I think:
Code:
% id kodi
uid=977(kodi) gid=977(kodi) groups=977(kodi),90(network),98(power),5(tty),995(audio),994(disk),993(input),990(optical),988(storage),986(video)

I do not have /sys/class/ppmgr/ppmgr_3d_mode at all:
Code:
% ls -lh /sys/class/ppmgr/             
total 0
-rw-rw-r-- 1 root root 4.0K Dec 31  1969 angle
-rw-r--r-- 1 root root 4.0K Dec 31  1969 bypass
-rw-r--r-- 1 root root 4.0K Dec 31  1969 disable_prot
-rw-rw-rw- 1 kodi kodi 4.0K Jul  5 15:44 disp
-rw-r--r-- 1 root root 4.0K Dec 31  1969 info
-rw-r--r-- 1 root root 4.0K Dec 31  1969 mirror
-rw-r--r-- 1 root root 4.0K Dec 31  1969 orientation
-rw-r--r-- 1 root root 4.0K Dec 31  1969 platform_type
lrwxrwxrwx 1 root root    0 Dec 31  1969 ppmgr -> ../../devices/virtual/ppmgr/ppmgr
-r--r--r-- 1 root root 4.0K Dec 31  1969 ppmgr_vframe_states
-rw-rw-rw- 1 kodi kodi 4.0K Jul  5 15:44 ppscaler
-rw-rw-rw- 1 kodi kodi 4.0K Jul  5 15:44 ppscaler_rect
-rw-r--r-- 1 root root 4.0K Dec 31  1969 rect
-rw-rw-r-- 1 root root 4.0K Dec 31  1969 vtarget

I do see the problem on the CPU stuff:
Code:
% ls -l /sys/devices/system/cpu/cpu0/cpufreq|grep scal
-r--r--r-- 1 root root 4096 Aug 31 18:31 scaling_available_frequencies
-r--r--r-- 1 root root 4096 Aug 31 18:31 scaling_available_governors
-r--r--r-- 1 root root 4096 Aug 31 18:31 scaling_cur_freq
-rw-r--r-- 1 root root 4096 Aug 31 18:31 scaling_dflt_freq
-r--r--r-- 1 root root 4096 Aug 31 18:31 scaling_driver
-rw-r--r-- 1 root root 4096 Aug 31 18:31 scaling_governor
-rw-r--r-- 1 root root 4096 Aug 31 18:31 scaling_max_freq
-rw-r--r-- 1 root root 4096 Aug 31 18:31 scaling_min_freq
-rw-r--r-- 1 root root 4096 Aug 31 18:31 scaling_setspeed

It seems as though the package provides /etc/tmpfiles.d/kodi_permissions.conf which contains:
Code:
m /sys/class/graphics/fb0/mode 0666 kodi kodi - -
m /sys/class/graphics/fb0/blank 0666 kodi kodi - -
m /sys/class/graphics/fb0/free_scale 0666 kodi kodi - -
m /sys/class/graphics/fb0/free_scale_axis 0666 kodi kodi - -
m /sys/class/graphics/fb0/request2XScale 0666 kodi kodi - -
m /sys/class/graphics/fb0/scale_width 0666 kodi kodi - -
m /sys/class/graphics/fb0/scale_height 0666 kodi kodi - -
m /sys/class/graphics/fb1/blank 0666 kodi kodi - -
m /sys/class/graphics/fb1/scale_width 0666 kodi kodi - -
m /sys/class/graphics/fb1/scale_height 0666 kodi kodi - -
m /sys/class/graphics/fb1/free_scale 0666 kodi kodi - -
m /sys/class/graphics/fb1/scale 0666 kodi kodi - -
m /sys/class/graphics/fb1/scale_axis 0666 kodi kodi - -
m /sys/class/display/mode 0666 kodi kodi - -
m /sys/class/display/axis 0666 kodi kodi - -
m /sys/class/amhdmitx/amhdmitx0/disp_mode 0666 kodi kodi - -
m /sys/class/tsync/pts_pcrscr 0666 kodi kodi - -
m /sys/class/tsync/enable 0666 kodi kodi - -
m /sys/class/video/axis 0666 kodi kodi - -
m /sys/class/video/zoom 0666 kodi kodi - -
m /sys/class/video/contrast 0666 kodi kodi - -
m /sys/class/video/brightness 0666 kodi kodi - -
m /sys/class/video/saturation 0666 kodi kodi - -
m /sys/class/video/blackout_policy 0666 kodi kodi - -
m /sys/class/video/screen_mode 0666 kodi kodi - -
m /sys/class/video/disable_video 0666 kodi kodi - -
m /sys/class/audiodsp/digital_raw 0666 kodi kodi - -
m /sys/class/ppmgr/ppmgr_3d_mode 0666 kodi kodi - -
m /sys/class/ppmgr/ppscaler 0666 kodi kodi - -
m /sys/class/ppmgr/ppscaler_rect 0666 kodi kodi - -
m /sys/class/ppmgr/disp 0666 kodi kodi - -
m /sys/modules/di/parameters/bypass_all 0666 kodi kodi - -
Need help programming a Streamzap remote?
Reply
#4
Honestly I don't remember all the amlogic details as I use my odroid-c2 mostly as paperweight.

pppmgr_3dmode is not critical, if memory serves it's a kernel .config options that needs to be enabled.
cpu scaling is also not critical.

Here is what Kodi does to check the perms https://github.com/xbmc/xbmc/blob/Krypto...ls.cpp#L95

The permissions do look ok ...
Maybe https://forum.odroid.com/viewtopic.php?f...29#p204198
Reply
#5
Thanks for your help.  I agree that the level of stable support in the C2 is disappointing.  If that thread is correct, and that gcc needs to be <7.0, that is just stupid.
Need help programming a Streamzap remote?
Reply
#6
Got it figured out.... I was building from the official xbmc source on github.  Turns out there are needed patches for this hardware to work properly which are contained in https://github.com/Owersun/xbmc
Need help programming a Streamzap remote?
Reply

Logout Mark Read Team Forum Stats Members Help
Choppy video playback and high CPU usage on ODROID-C2 (Arch ARM aarch64)0