Kodi Community Forum

Full Version: Amcodec hardware decoding with ambilight addons
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I own an Android TV Box CSM8 based on Amlogic S802 chipset. Kodi runs fine on this box except for one thing in my setup, I would like to use the Hyperion addon to send images to a Raspberry Pi with a Hyperion server and leds strip connected. The led/Hyperion setup is working pretty fine when I play video from the Raspberry itself or over the network with a Windows 7 desktop pc. But it doesn't with my Android box, the leds light on when the video is played on it and they remain always the same colour.

After many hours testing I managed to identify the problem as the amcodec hardware decoding. If i disable it, the leds light normally which means the hyperion addon seems to work fine. I have the same behaviour with Android 4.4 on this box with Kodi official apk and with a custom OpenElec 5.0.3 rom for M8 clones boxes. More information on this issue on the addon github : https://github.com/poljvd/script.service...t-75979017

Looking at the code of the addon I suspect the CRenderCapture python class api to not work when the amcodec hardware decoding is activated but it's just my guess as I'm not very experienced with python / kodi addon development.Obviously I tried to play videos without the amcodec hardware decoding but the experience is very poor, not smooth and many glitches in videos.

So I post here without knowing if it is the right place to post the issue. Maybe I should post as a feature request like this one CRenderCapture implementation for the OMXPlayer . It looks like to me an issue more related to the Kodi amcodec decoding feature than the hyperion addon but excuse me if it was the wrong place to post. And for my english too.

Thanks for your attention. Blush
(2015-02-25, 19:56)curunoir Wrote: [ -> ]So I post here without knowing if it is the right place to post the issue. Maybe I should post as a feature request like this one CRenderCapture implementation for the OMXPlayer . It looks like to me an issue more related to the Kodi amcodec decoding feature than the hyperion addon but excuse me if it was the wrong place to post. And for my english too.
Yeah probably wrong forum, suggest you create new feature request thread in the suggestion forum for "Feature Request - CRenderCapture implementation for Amcodec/Amplayer on Amlogic". Anyway, I think that Kodi/XBMC on Amlogic use either libamcodec or libamplayer, and not OMXPlayer.

Also note that is not the Python API code or the Hyperion script the that needs to be changed to enable render capture for Amlogic, instead you need to change Kodi's C++ code for render capture to enable render capture for Amlogic when using hardware decoding with libamcodec and libamplayer.

I believe that Pivos developers was working on render capture on their Amlogic boxes for a Ambilight kit. Regardless, might be worth requesting this from a company with Amlogic hardware, like Pivos or WeTek. They have commercial incentive to make this happen as they could sell more boxes and kits for them.
Looks like davilla/pivos did some work on this already: https://github.com/davilla/boblight-1

No idea if it actually works for boblight, but if it does it can probably be backported to RenderCapture.

[EDIT] The official Pivos one: https://github.com/Pivosgroup/boblight

[EDIT2] That might actually be a fun project. Does anyone knows about soldering-iron-free led prebuilt packages I could just plug into a PI with Hyperion?
based on pivos/davillas work i did something superior (which requires a current kernel) here:

https://github.com/OpenELEC/OpenELEC.tv/...ient.patch

I also have a rendercapture impl. for this here:

https://github.com/Memphiz/xbmc/commits/amlcapture

But the rendercapture impl. is to late - thats why i prefer the userspace client.

I tried both on wetekplay box running openelec ...

It relies on an aml kernel with enabled videocap support.

edit: for using it in current openelec builds you need to install the boblighd addon (which in this case provides the boblight-aml client which reads its config from the official boblight addon...), the boblight addon and then configure the boblight addon to point it to your server (which can be anywhere in the network or even the local one).
(2015-02-26, 12:25)Koying Wrote: [ -> ]Looks like davilla/pivos did some work on this already: https://github.com/davilla/boblight-1

No idea if it actually works for boblight, but if it does it can probably be backported to RenderCapture.

[EDIT] The official Pivos one: https://github.com/Pivosgroup/boblight

[EDIT2] That might actually be a fun project. Does anyone knows about soldering-iron-free led prebuilt packages I could just plug into a PI with Hyperion?

Yep there are some available packs and some future packs coming from crowdfunding projects such as Ambivision (avoid Zambilight on Indiegogo which looks like a scam). I bought a standard Lightberry pack and it is really plug-and-play on your Raspberry. There is also Lightpack, Adalight...

For the rest I don't understand well all the leads you are pointing but I can test some changes on my device if it is convenient.
(2015-02-26, 14:25)Memphiz Wrote: [ -> ]based on pivos/davillas work i did something superior (which requires a current kernel) here:

https://github.com/OpenELEC/OpenELEC.tv/...ient.patch

I also have a rendercapture impl. for this here:

https://github.com/Memphiz/xbmc/commits/amlcapture

But the rendercapture impl. is to late - thats why i prefer the userspace client.

I tried both on wetekplay box running openelec ...

It relies on an aml kernel with enabled videocap support.

edit: for using it in current openelec builds you need to install the boblighd addon (which in this case provides the boblight-aml client which reads its config from the official boblight addon...), the boblight addon and then configure the boblight addon to point it to your server (which can be anywhere in the network or even the local one).

If I'm correct I can do this from OpenElec menu with enabling boblight service ? Because I have memories trying to use boblight instead of Hyperion and the boblight addon needed to have a libboblight.so file somewhere which I couldn't do manually on OpenElec. On the Android system I had put myself this file and the boblight addon seemed to run fine but at that time I didn't already own the Raspberry and its boblight server running so that was a guess that it was running fine.

edit : The OpenElec ROM I'm using is the 5.0.3 one here http://www.freaktab.com/showthread.php?1...0-MX2-G18) made by... codesnake, so maybe with your kodi amlcapture branch build I could test directly with the hyperion addon ?
Even without my branch you would be able to do so. IIRC hyperion provides a boblight compatible network interface. If so you would need to install the boblighd addon in openelec (which provides the bobligh-aml client aswell) and the boblight addon for configuring the ip adress and port of your hyperion server (because boblight-aml client reads the config from the boblight-addon for beeing more seamless).

But this only works when having a videocap enabled aml kernel (so that /dev/videocap0 is available).
Ok here's what I did :

- flash my M8 box to https://github.com/codesnake/OpenELEC.tv...-5.0.3.tar ROM
- install boblightd service addon
- install "XBMC boblight" addon
- configure "XBMC boblight" addon to use remote boblightd, with boblightd IP of my Pi on port 19333
- run Hyperion server on my Pi with boblight server enabled to port 19333

I ran a video from my NAS with no results.

Here's the kodi.log : http://pastebin.com/naNpGXdD
Here's the boblightd.log from OpenElec M8 box : http://pastebin.com/iGpQvC10

When I ls the /dev/ folder on the OpenElec box I have no /dev/videocap0 and also no /dev/ttyACM0

Maybe I should configure more things on the boblightd on the OpenElec side ?
if you don't have /dev/videocap0 this whole approach won't work ... you need a kernel with enabled CONFIG_AM_VIDEOCAPTURE
So I guess the best call is with codesnake, no chance to have this enabled on Android kernels ?

edit : or compile from source ? http://wiki.openelec.tv/index.php/Compile_from_source

edit : according to this source code https://github.com/codesnake/OpenELEC.tv...x.arm.conf, and from the source zip of the release I used,the CONFIG_AM_VIDEOCAPTURE is already set on the OpenElec I'm using
It also might need adaptions in arch/arm/boot/dts/amlogic/meson8_k200a_2G.dtb ... yes just talk to codesnake - he knows what to do i guess (its working on wetek play with enabled CONFIG_AM_VIDEOCAPTURE and a proper device section in the dts file...)
@Memphiz I am running OE 5.07 on WETEK. I have Lightpack.
Can you please give me instructions on how to put boblight to work?
Currently I have boblightd and xbmc boblight addon installed. The lights pop up on initial movie play...just a few ms then they pop off. If I press STOP they pop up again??!! When boblight is running I have high CPU loads...
The lightpack is working fine with a shuttle ion xs35gt also with OE.
Thanks
(2015-04-02, 14:41)linuxmad Wrote: [ -> ]@Memphiz I am running OE 5.07 on WETEK. I have Lightpack.
Can you please give me instructions on how to put boblight to work?
Currently I have boblightd and xbmc boblight addon installed. The lights pop up on initial movie play...just a few ms then they pop off. If I press STOP they pop up again??!! When boblight is running I have high CPU loads...
The lightpack is working fine with a shuttle ion xs35gt also with OE.
Thanks

I think there is a bug in OpenElec 5.0.7 with amcodec or something else because I have got boblight to work with my Eny M8 on 5.0.5 but when I enable it in the dtd for 5.0.7 like I did for 5.0.5 it doesn't work and only comes on half a second when I play a file and when I stop the file.

Update:
Just compiled OpenElec 5.0.5 with Kodi 14.2 and new Amlogic patches and now and I get the same as OpenElec 5.0.7 so it might be something to do with Kodi or something important has changed in the patches for Amlogic. (I only changes all the Kodi packages and the Amlogic patches so I could build Kodi for my Eny M8).

Update 2: Just got around to building Openelec 5.0.8 and boblightd and everything is working again on my Eny M8.