Compiling Kodi to make it have hardware decoding

alpe
Posts: 67
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by alpe » Wed Oct 16, 2019 8:54 am

I'm only getting SW decoding. With both h264 and hevc.
Installed with apt-get install kodi aml-libs.
Ubuntu minimal.
Do I have to do something else?
As posted above, I had to run:

Code: Select all

sudo usermod -a -G cdrom,audio,video,plugdev,users,dialout,dip,input,netdev kodi
Maybe there's some group missing to allow HW?

User avatar
odroid
Site Admin
Posts: 32552
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 189 times
Been thanked: 352 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by odroid » Wed Oct 16, 2019 9:15 am

Do you use ubuntu-18.04.3-4.9-minimal-odroid-n2-20190806.img.xz?
What happens if you login as a root?

alpe
Posts: 67
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by alpe » Wed Oct 16, 2019 9:51 am

odroid wrote:
Wed Oct 16, 2019 9:15 am
Do you use ubuntu-18.04.3-4.9-minimal-odroid-n2-20190806.img.xz?
What happens if you login as a root?
Yes.
Changing the systemd service to run as root works, so it's probably some group that I have to add the 'kodi' user to or some permission I have to change somewhere.
Any idea? I really don't want to keep kodi running as root.
Thanks.
Last edited by alpe on Wed Oct 16, 2019 9:55 am, edited 1 time in total.

User avatar
odroid
Site Admin
Posts: 32552
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 189 times
Been thanked: 352 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by odroid » Wed Oct 16, 2019 9:54 am

I have no idea.
I hope other experts can help you.

User avatar
rooted
Posts: 6779
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 224 times
Been thanked: 42 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by rooted » Wed Oct 16, 2019 8:26 pm

I think it's the video group.

gerulrich
Posts: 8
Joined: Tue Jun 18, 2019 10:00 pm
languages_spoken: english,spanish
ODROIDs: N2
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by gerulrich » Wed Oct 16, 2019 8:37 pm

Check te kodi log for missing permissions:

cat /home/kodi/.kodi/temp/kodi.log | grep ERROR | grep AML

Enviado desde mi Redmi Note 4 mediante Tapatalk

These users thanked the author gerulrich for the post:
alpe (Wed Oct 16, 2019 9:34 pm)

alpe
Posts: 67
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by alpe » Wed Oct 16, 2019 9:19 pm

rooted wrote:
Wed Oct 16, 2019 8:26 pm
I think it's the video group.
Thanks, but it's already on that group. :/
gerulrich wrote:
Wed Oct 16, 2019 8:37 pm
Check te kodi log for missing permissions:

cat /home/kodi/.kodi/temp/kodi.log | grep ERROR | grep AML

Enviado desde mi Redmi Note 4 mediante Tapatalk

Code: Select all

2019-10-16 00:48:19.788 T:548116812960   ERROR: AML: no rw on /sys/class/video/axis
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/class/video/screen_mode
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/class/video/disable_video
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/class/tsync/pts_pcrscr
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/module/ionvideo/parameters/freerun_mode
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/class/video/freerun_mode
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/class/audiodsp/digital_raw
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/class/amhdmitx/amhdmitx0/config
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/class/vfm/map
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/class/tsync/enable
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/class/amhdmitx/amhdmitx0/frac_rate_policy
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/module/di/parameters/bypass_prog
2019-10-16 00:48:19.789 T:548116812960   ERROR: AML: no rw on /sys/class/display/mode
Running this before starting kodi fixed it:

Code: Select all

sudo chown kodi /sys/class/video/axis /sys/class/video/screen_mode /sys/class/video/disable_video /sys/class/tsync/pts_pcrscr /sys/module/ionvideo/parameters/freerun_mode /sys/class/video/freerun_mode /sys/class/audiodsp/digital_raw /sys/class/amhdmitx/amhdmitx0/config /sys/class/vfm/map /sys/class/tsync/enable /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor /sys/class/amhdmitx/amhdmitx0/frac_rate_policy /sys/module/di/parameters/bypass_prog /sys/class/display/mode
I added it to rc.local and it worked.
Thanks.
These users thanked the author alpe for the post:
tobetter (Wed Oct 16, 2019 9:21 pm)

alpe
Posts: 67
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by alpe » Wed Oct 16, 2019 9:33 pm

Another question.
After some time with the tv off, after I turn it back on again the screen is black.
It's not the kodi screen saver.
I press various buttons on the keyboard and it stays black. Even restarting kodi doesn't bring it back up again.
This happens when running as root as well.
Tried disabling HPD, but same.

User avatar
mad_ady
Posts: 6796
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 216 times
Been thanked: 166 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by mad_ady » Wed Oct 16, 2019 9:35 pm

It's consoleblanking. There is a boot option to turn that off.
These users thanked the author mad_ady for the post:
alpe (Wed Oct 16, 2019 9:40 pm)

alpe
Posts: 67
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by alpe » Wed Oct 16, 2019 9:41 pm

mad_ady wrote:
Wed Oct 16, 2019 9:35 pm
It's consoleblanking. There is a boot option to turn that off.
Disabled it as instructed in viewtopic.php?t=18819
Will update in a while with results.
Edit: It works. Thanks.

alpe
Posts: 67
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by alpe » Thu Oct 17, 2019 2:51 am

Another issue. Don't worry, I already solved this one. :lol:

Problem:
If I start the board (kodi starts automatically at boot) with the tv off, and later turn on the tv, there's no image and the Kodi cpu usage is quite high. Restarting kodi with the tv on works.
Looking at the log there was a "WARNING: UpdateResolutions: ProbeResolutions failed.".
Disabling display_autodetect on boot.ini didn't solve it.

Solution, in case someone encounters this issue in the future:
Simply go to Settings -> Display -> Display mode, and change it to Windowed. But by doing this the resolution, at least here, was very small.
So, I also created the file /home/kodi/.kodi/userdata/advancedsettings.xml with this inside:

Code: Select all

<advancedsettings version="1.0">
    <window>
        <width>1920</width>
        <height>1080</height>
    </window>
</advancedsettings>
I didn't notice any downsides to doing this. HW decoding works and CPU usage seems the same...

User avatar
memeka
Posts: 4370
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 1 time
Been thanked: 39 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by memeka » Thu Oct 17, 2019 4:01 am

Try setting an edid in boot.ini with desired resolution

alpe
Posts: 67
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by alpe » Thu Oct 17, 2019 5:11 am

memeka wrote:
Thu Oct 17, 2019 4:01 am
Try setting an edid in boot.ini with desired resolution
How?
Tried:

Code: Select all

setenv hdmimode "custombuilt"
setenv modeline "1920,1080,148500,67500,60,1920,2008,2052,2200,1080,1084,1088,1125,0,1,1"
Oh, and is there a way to bring the console up again when the service running kodi stop?

alpe
Posts: 67
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by alpe » Sat Oct 19, 2019 6:54 am

Is it possible to get Netflix working on Kodi? (like this: viewtopic.php?f=98&t=34076)
Or not yet?
Thanks.

User avatar
odroid
Site Admin
Posts: 32552
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 189 times
Been thanked: 352 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by odroid » Sat Oct 19, 2019 1:05 pm

Netflix add-on should work in 1080p resolution.

alpe
Posts: 67
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by alpe » Sat Oct 19, 2019 8:32 pm

odroid wrote:
Sat Oct 19, 2019 1:05 pm
Netflix add-on should work in 1080p resolution.
"Widevine CDM is currently not available natively on ARM64. Please switch to a 32-bit userspace for Widevice CDM support."
So I guess I would have to use Kodi:armhf, right?
Is kodi:armhf available and updated on the N2 repository?

Update: Just checked and kodi:armhf insn't provided by http://deb.odroid.in/n2. If using armhf is the only way to run Netflix, please consider adding it (and possibly other required packages) to the repository in addition to aarch64.

Nuems
Posts: 131
Joined: Thu Sep 19, 2013 3:50 am
languages_spoken: english, german
ODROIDs: xu, c1
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by Nuems » Sun Oct 20, 2019 4:50 pm

As far as I know, Widevine CDM isn't officially available for 32-bit Linux either, however, it is part of ChromeOS (both 32 and 64bit). The library can be extracted from ChromeOS recovery images. There are kodi addons outside of the official repsoitory that automate this process and also take care of updating Widevine CDM when necessary (about once a month or so). One of those is the "Joyn" addon from this repo: https://github.com/kodinerds/repo/raw/m ... inerds.zip
[Joyn is an streaming platform for (mostly) German live TV and the channels' media libraries.]

alpe
Posts: 67
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by alpe » Sun Oct 20, 2019 10:16 pm

Nuems wrote:
Sun Oct 20, 2019 4:50 pm
As far as I know, Widevine CDM isn't officially available for 32-bit Linux either, however, it is part of ChromeOS (both 32 and 64bit). The library can be extracted from ChromeOS recovery images. There are kodi addons outside of the official repsoitory that automate this process and also take care of updating Widevine CDM when necessary (about once a month or so). One of those is the "Joyn" addon from this repo: https://github.com/kodinerds/repo/raw/m ... inerds.zip
[Joyn is an streaming platform for (mostly) German live TV and the channels' media libraries.]
Thanks.
I got that error while using one of these methods. It download the ChromeOS image, but on installation gave that error. :/

desiqx
Posts: 1
Joined: Sat Oct 05, 2019 5:58 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by desiqx » Mon Oct 21, 2019 5:30 am

alpe wrote:
odroid wrote:
Sat Oct 19, 2019 1:05 pm
Netflix add-on should work in 1080p resolution.
"Widevine CDM is currently not available natively on ARM64. Please switch to a 32-bit userspace for Widevice CDM support."
So I guess I would have to use Kodi:armhf, right?
Is kodi:armhf available and updated on the N2 repository?

Update: Just checked and kodi:armhf insn't provided by http://deb.odroid.in/n2. If using armhf is the only way to run Netflix, please consider adding it (and possibly other required packages) to the repository in addition to aarch64.
I had the same problem recently. We need to use Kodi with 32bit userspace and still having 64 bit kernel and everything else. So In perfect world the easiest will be :

apt get install kodi:armhf

But in reality it's not that easy. I need to have fully functional Kodi, like in Coreelec in Ubuntu. I was fighting for some time and in final I'm using Coreelec until will find some easy way to do that.

For example for official odroid n2 repo has kodi 18.3 RC and I couldn't easy install pvr iptv simple addon and inputstream adaptive for Netflix unfortunately.

Maybe there is another better solution to get 32bit Kodi from coreelec in our latest Ubuntu image? Do you have any ideas guys? Is compiling Kodi and addons working without problems with hardware acceleration?


User avatar
odroid
Site Admin
Posts: 32552
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 189 times
Been thanked: 352 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by odroid » Mon Oct 21, 2019 9:52 am

We tried to build the Kodi for armhf but there were too many errors we couldn't fix. :(

User avatar
mad_ady
Posts: 6796
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 216 times
Been thanked: 166 times
Contact:

Re: Compiling Kodi to make it have hardware decoding

Unread post by mad_ady » Mon Oct 21, 2019 2:11 pm

Not sure how well kodi is dockerized, but if it has direct access to /dev and /sys, a docker version of kodi might work and bypass dependency issues...

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 9 guests