[odroid-c2] running video player inside linux container

Post Reply
sang0627
Posts: 9
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 0
Been thanked: 1 time
Contact:

[odroid-c2] running video player inside linux container

Unread post by sang0627 » Fri Mar 15, 2019 4:49 pm

I'm testing video player on odroid-c2 using ubuntu-18.04-mate image.
It works fine on my odroid-c2.
both of kodi and mplayer display my videos excellently.

I launched a linux container using lxd and tested video player inside the container. (i.e. lxc launch ubuntu:bionic my-test)
Any x11-app runs good in the container including xclock, glxgears, etc.
If I run kodi and mplayer inside the container,
both of them display my videos successfully but it looks like a little bit slow.
I guess it's because HW acceleration is not reflected to them.

After installing mali-x11 inside the container and upgrading kodi from bionic package to odroid package,
both video players fail to display my videos.
Please see the below two statements in the attached log files.
- "double free or corruption" from kodi log file
- "X11 error: BadAccess (attempt to access private resource denied)" from mplayer log file)

I suspect mali-x11 in the container cannot access some kind of direct memory region,
therefore two video players cannot get video frames.
I have tried to add many device nodes in host's /dev/xxx to the container,
but it does not resolve this problem.
what files does mali-x11(or mali driver) access to provide HW acceleration in odroid-c2?

I appreciate any comments.
Attachments
mplayer-log.txt
(11.98 KiB) Downloaded 9 times
kodi_crashlog-20190315_162418.log
(13.11 KiB) Downloaded 11 times

User avatar
tobetter
Posts: 3700
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 28 times
Been thanked: 117 times
Contact:

Re: [odroid-c2] running video player inside linux container

Unread post by tobetter » Fri Mar 15, 2019 5:27 pm

Have you mapped the full /dev of the host to the container?

sang0627
Posts: 9
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: [odroid-c2] running video player inside linux container

Unread post by sang0627 » Fri Mar 15, 2019 5:29 pm

@tobetter, well not the full /dev/ but many of device files I choose.
for example, /dev/am*, /dev/mali, /dev/ump, /dev/video*, etc

User avatar
tobetter
Posts: 3700
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 28 times
Been thanked: 117 times
Contact:

Re: [odroid-c2] running video player inside linux container

Unread post by tobetter » Fri Mar 15, 2019 5:35 pm

sang0627 wrote:
Fri Mar 15, 2019 5:29 pm
@tobetter, well not the full /dev/ but many of device files I choose.
for example, /dev/am*, /dev/mali, /dev/ump, /dev/video*, etc
IMO it's worth to try to map whole if the video player instance in the container can play well like the host.

sang0627
Posts: 9
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: [odroid-c2] running video player inside linux container

Unread post by sang0627 » Fri Mar 22, 2019 12:35 pm

tobetter wrote:
Fri Mar 15, 2019 5:35 pm
sang0627 wrote:
Fri Mar 15, 2019 5:29 pm
@tobetter, well not the full /dev/ but many of device files I choose.
for example, /dev/am*, /dev/mali, /dev/ump, /dev/video*, etc
IMO it's worth to try to map whole if the video player instance in the container can play well like the host.
I added all devices in /dev of host to /dev of container, but no luck. :(
I tried to install odroid-c2 minimal image(ubuntu 18.04) and kodi-fbdev to narrow down the problematic scope.
Even though I added all devices in /dev of host to /dev of container, kodi shows different behaviors between on host and on container.

If I run kodi on host, it runs ok and decodes video am-h264(HW) which I verified by pushing 'o' key in kodi.
If I run kodi on container, it runs ok but decodes video ff-h264(SW) which I verified by pushing 'o' key in kodi.

In summay, kodi on container does not utilize HW acceleration of AMLogic but decodes video with ffmpeg even though I added all devices in /dev of host to /dev of container.
I guess some initialization logic of kodi fails to activate aml-libs.

I appreciate any comment.

User avatar
tobetter
Posts: 3700
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 28 times
Been thanked: 117 times
Contact:

Re: [odroid-c2] running video player inside linux container

Unread post by tobetter » Fri Mar 22, 2019 12:46 pm

sang0627 wrote:
tobetter wrote:
Fri Mar 15, 2019 5:35 pm
sang0627 wrote:
Fri Mar 15, 2019 5:29 pm
@tobetter, well not the full /dev/ but many of device files I choose.
for example, /dev/am*, /dev/mali, /dev/ump, /dev/video*, etc
IMO it's worth to try to map whole if the video player instance in the container can play well like the host.
I added all devices in /dev of host to /dev of container, but no luck. :(
I tried to install odroid-c2 minimal image(ubuntu 18.04) and kodi-fbdev to narrow down the problematic scope.
Even though I added all devices in /dev of host to /dev of container, kodi shows different behaviors between on host and on container.

If I run kodi on host, it runs ok and decodes video am-h264(HW) which I verified by pushing 'o' key in kodi.
If I run kodi on container, it runs ok but decodes video ff-h264(SW) which I verified by pushing 'o' key in kodi.

In summay, kodi on container does not utilize HW acceleration of AMLogic but decodes video with ffmpeg even though I added all devices in /dev of host to /dev of container.
I guess some initialization logic of kodi fails to activate aml-libs.

I appreciate any comment.
I am not sure if Kodi manages /sys entries, I guess it's worth to try explict /sys to the container same as /dev. I wonder how the behaviour of Kodi in the container is different.

Tapatalk wishes you to have fun with ODROID.


sang0627
Posts: 9
Joined: Fri Mar 15, 2019 4:02 pm
languages_spoken: english
ODROIDs: odroid-c2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: [odroid-c2] running video player inside linux container

Unread post by sang0627 » Fri Mar 22, 2019 5:10 pm

tobetter wrote:
Fri Mar 22, 2019 12:46 pm
sang0627 wrote:
tobetter wrote:
Fri Mar 15, 2019 5:35 pm
sang0627 wrote:
Fri Mar 15, 2019 5:29 pm
@tobetter, well not the full /dev/ but many of device files I choose.
for example, /dev/am*, /dev/mali, /dev/ump, /dev/video*, etc
IMO it's worth to try to map whole if the video player instance in the container can play well like the host.
I added all devices in /dev of host to /dev of container, but no luck. :(
I tried to install odroid-c2 minimal image(ubuntu 18.04) and kodi-fbdev to narrow down the problematic scope.
Even though I added all devices in /dev of host to /dev of container, kodi shows different behaviors between on host and on container.

If I run kodi on host, it runs ok and decodes video am-h264(HW) which I verified by pushing 'o' key in kodi.
If I run kodi on container, it runs ok but decodes video ff-h264(SW) which I verified by pushing 'o' key in kodi.

In summay, kodi on container does not utilize HW acceleration of AMLogic but decodes video with ffmpeg even though I added all devices in /dev of host to /dev of container.
I guess some initialization logic of kodi fails to activate aml-libs.

I appreciate any comment.
I am not sure if Kodi manages /sys entries, I guess it's worth to try explict /sys to the container same as /dev. I wonder how the behaviour of Kodi in the container is different.

Tapatalk wishes you to have fun with ODROID.
thank you so much, tobetter
as your suggestion, I tried to remount /sys with rw permission and kodi runs ok with HW acceleration.
I need to check any security violation regarding this walk-around.

User avatar
tobetter
Posts: 3700
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 28 times
Been thanked: 117 times
Contact:

Re: [odroid-c2] running video player inside linux container

Unread post by tobetter » Fri Mar 22, 2019 5:38 pm

sang0627 wrote:
Fri Mar 22, 2019 5:10 pm
tobetter wrote:
Fri Mar 22, 2019 12:46 pm
sang0627 wrote:
tobetter wrote:
Fri Mar 15, 2019 5:35 pm
sang0627 wrote:
Fri Mar 15, 2019 5:29 pm
@tobetter, well not the full /dev/ but many of device files I choose.
for example, /dev/am*, /dev/mali, /dev/ump, /dev/video*, etc
IMO it's worth to try to map whole if the video player instance in the container can play well like the host.
I added all devices in /dev of host to /dev of container, but no luck. :(
I tried to install odroid-c2 minimal image(ubuntu 18.04) and kodi-fbdev to narrow down the problematic scope.
Even though I added all devices in /dev of host to /dev of container, kodi shows different behaviors between on host and on container.

If I run kodi on host, it runs ok and decodes video am-h264(HW) which I verified by pushing 'o' key in kodi.
If I run kodi on container, it runs ok but decodes video ff-h264(SW) which I verified by pushing 'o' key in kodi.

In summay, kodi on container does not utilize HW acceleration of AMLogic but decodes video with ffmpeg even though I added all devices in /dev of host to /dev of container.
I guess some initialization logic of kodi fails to activate aml-libs.

I appreciate any comment.
I am not sure if Kodi manages /sys entries, I guess it's worth to try explict /sys to the container same as /dev. I wonder how the behaviour of Kodi in the container is different.

Tapatalk wishes you to have fun with ODROID.
thank you so much, tobetter
as your suggestion, I tried to remount /sys with rw permission and kodi runs ok with HW acceleration.
I need to check any security violation regarding this walk-around.
Glad to hear it works. :)

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

Re: [odroid-c2] running video player inside linux container

Unread post by mad_ady » Fri Mar 22, 2019 5:44 pm

There are some mali/amlogic nodes that kodi tries to access. You can see them if you run kodi with strace and see which files it tries yo open.

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 3 guests