Jump to content

Orange Pi Lite and HDMI-CEC


tarwin

Recommended Posts

Hi there

 

I wanted to ask if anybody got HDMI-CEC to work with their Orange Pi Lite. 

The data sheet says its supported, but I can't get it to work with Armbian. 

 

What I tried till now is installing cec-utils with all dependencies and running "cec-client -l", hoping it would work out-of-the-box:

root@orangepilite:~# cec-client -l
Found devices: NONE
Tried different cables and HDMI Ports. CEC is enabled in the TV (Samsung).
After a bit of googling (and trying some stuff applying to the RPi) I am now thinking that maybe the kernel hasn't got CEC support compiled in...? 
root@orangepilite:~# uname -a
Linux orangepilite 3.4.112-sun8i #10 SMP PREEMPT Sun Oct 23 16:06:55 CEST 2016 armv7l GNU/Linux
Has anybody some input to this please? 
 
Link to comment
Share on other sites

CEC driver is missing. jodamm was kind enough to implement it (https://github.com/jodamm/linux/tree/sun8i) based on his own research without any documentation, which means that it might not be 100% reliable. You will have to rebuild kernel, but that it is easy to do once you have the patches. Unfortunatelly, I'm not sure if you can easily take jodamm's patches and apply it to Armbian kernel sources. But don't be afraid, I'm pretty sure not much fixing is needed.

Link to comment
Share on other sites

 

First 2 patches failed and i see they are all disabled. I guess it's not happening for the moment :). I also played a little and tried @jernej cec patch from his repo and it failed too. But i guess it's the same patch. On the other hand @jodamm patch applied fine - [WIP]hdmi cec driver for H3. I don't know if this will work after, because i try to built on Xenial 16.10 and have some compilation errors. Perhaps i have to try on 16.04.

 

Compiled libcec with Sunxi support,

 

Can you give more details about this? You are using patch from here - [WIP]hdmi cec driver for H3 ,or there is something more?

Link to comment
Share on other sites

First 2 patches failed and i see they are all disabled. I guess it's not happening for the moment :). I also played a little and tried @jernej cec patch from his repo and it failed too. But i guess it's the same patch. On the other hand @jodamm patch applied fine - [WIP]hdmi cec driver for H3. I don't know if this will work after, because i try to built on Xenial 16.10 and have some compilation errors. Perhaps i have to try on 16.04.

 

 

Can you give more details about this? You are using patch from here - [WIP]hdmi cec driver for H3 ,or there is something more?

 

 

i cloned his git (https://github.com/jodamm/libcec.git) and compiled with 

cmake -DHAVE_SUNXI_LIB=1 ..

so Libcec now works with Sunxi support, but dunno how to enable kernel module

Link to comment
Share on other sites

so Libcec now works with Sunxi support, but dunno how to enable kernel module

Well, i don't know if i am doing things right. But i compiled new Armbian image with this patch from @jodamm repo -  http://sunxi.das-eckchen.de/h3_hdmi_cec.patch. I copied patch to /lib/patch/kernel/sun8i-default and it applied successful. Now i got hdmi_cec.ko in /lib/modules/3.4.113-sun8i/kernel/drivers/video/sunxi/disp2/hdmi/aw, which can be loaded successful as module (modprobe hdmi_cec). I don't have much experience with cec and don't know if this is enough from kernel part. Now i will try to compile Libcec the way you do and see what happends. Thank you.

Link to comment
Share on other sites

Now i got hdmi_cec.ko in /lib/modules/3.4.113-sun8i/kernel/drivers/video/sunxi/disp2/hdmi/aw, which can be loaded successful as module (modprobe hdmi_cec).

 

If you load this module, it should be enough.

Link to comment
Share on other sites

If you load this module, it should be enough.

I did :). Libcec is compiled too. But i don't have much luck to connect my TV for now, if i do things right. cec-client give the same massages as on my OpiOne with OpenElec (my OpiPC have working CEC with OpenElec):

no serial port given. trying autodetect:
 path:     /dev/sunxi_hdmi_cec
 com port: Sunxi

opening a connection to the CEC adapter...
DEBUG:   [             229]     Broadcast (F): osd name set to 'Broadcast'
ERROR:   [             229]     could not open a connection (try 1)
ERROR:   [             229]     Close: Unable to stop device

ERROR:   [            1229]     could not open a connection (try 2)
ERROR:   [            1230]     Close: Unable to stop device

ERROR:   [            2230]     could not open a connection (try 3)
ERROR:   [            2230]     Close: Unable to stop device

ERROR:   [            3230]     could not open a connection (try 4)
ERROR:   [            3231]     Close: Unable to stop device

ERROR:   [            4231]     could not open a connection (try 5)
ERROR:   [            4231]     Close: Unable to stop device

ERROR:   [            5231]     could not open a connection (try 6)
ERROR:   [            5232]     Close: Unable to stop device

ERROR:   [            6232]     could not open a connection (try 7)
ERROR:   [            6232]     Close: Unable to stop device

ERROR:   [            7232]     could not open a connection (try 8)
ERROR:   [            7232]     Close: Unable to stop device

ERROR:   [            8233]     could not open a connection (try 9)
ERROR:   [            8233]     Close: Unable to stop device

ERROR:   [            9233]     could not open a connection (try 10)
ERROR:   [            9233]     Close: Unable to stop device

unable to open the device on port Sunxi
NOTICE:  [           10234]     connection opened
ERROR:   [           10234]     could not start CEC communications

This is from Orange Pi PC, where CEC is working in OpenElec. Maybe it's hardware problem, i don't know. Or maybe i don't know what to do with this.

 

PS: I am noobie for sure :). It's working! Just need sudo:

sudo cec-client

I don't know why i have almost the same above massages in OpenElec with OpiONE? SSH with root:openelec don't need sudo right, or does it?

Link to comment
Share on other sites

No, openelec is single user system, where everything is run as root, so there is no sudo available or needed. Generally, no matter the board, cec should behave the same. I guess it all depends on which version of libcec you are using. I think that jodamm is not the latest and OE version is one of the previous versions + some patches. You should check if the newest available + sunxi patch works better...

Link to comment
Share on other sites

Well, i don't know if i am doing things right. But i compiled new Armbian image with this patch from @jodamm repo -  http://sunxi.das-eckchen.de/h3_hdmi_cec.patch. I copied patch to /lib/patch/kernel/sun8i-default and it applied successful. Now i got hdmi_cec.ko in /lib/modules/3.4.113-sun8i/kernel/drivers/video/sunxi/disp2/hdmi/aw, which can be loaded successful as module (modprobe hdmi_cec). I don't have much experience with cec and don't know if this is enough from kernel part. Now i will try to compile Libcec the way you do and see what happends. Thank you.

can you please post hdmi_cec.ko file somewhere? I have even less experience with compiling kernel.

 

thanks

Link to comment
Share on other sites

No, openelec is single user system, where everything is run as root, so there is no sudo available or needed. Generally, no matter the board, cec should behave the same. I guess it all depends on which version of libcec you are using. I think that jodamm is not the latest and OE version is one of the previous versions + some patches. You should check if the newest available + sunxi patch works better...

Look's like jodamm version is newer than this in OpenElec. This is from Armbian when is working:

NOTICE:  [             887]     CEC client registered: libCEC version = 3.1.0, client version = 3.1.0, firmware version = 0, logical address(es) = Recorder 1 (1) , base device: TV (0), HDMI port number: 1, physical address: 1.0.0.0, git revision: libcec-3.1.0+8-31c7e93, compiled on Thu Feb  9 20:29:30 UTC 2017 by tsanko@localhost on Linux 3.4.113-sun8i (armv7l), features: P8_USB, DRM, P8_detect, randr, Sunxi
DEBUG:   [             887]     << Recorder 1 (1) -> TV (0): OSD name 'CECTester'

And this is from OpenElec on my OpiONE:

OpenELEC-ONE:~ # cec-client
No device type given. Using 'recording device'
CEC Parser created - libCEC version 3.0.1
no serial port given. trying autodetect:
 path:     /dev/sunxi_hdmi_cec
 com port: Sunxi

opening a connection to the CEC adapter...
DEBUG:   [             232]     Broadcast (F): osd name set to 'Broadcast'
ERROR:   [             232]     could not open a connection (try 1)
ERROR:   [             233]     Close: Unable to stop device

ERROR:   [            1233]     could not open a connection (try 2)
ERROR:   [            1233]     Close: Unable to stop device

ERROR:   [            2233]     could not open a connection (try 3)
ERROR:   [            2233]     Close: Unable to stop device

ERROR:   [            3233]     could not open a connection (try 4)
ERROR:   [            3234]     Close: Unable to stop device

ERROR:   [            4234]     could not open a connection (try 5)
ERROR:   [            4234]     Close: Unable to stop device

ERROR:   [            5234]     could not open a connection (try 6)
ERROR:   [            5234]     Close: Unable to stop device

ERROR:   [            6235]     could not open a connection (try 7)
ERROR:   [            6235]     Close: Unable to stop device

ERROR:   [            7235]     could not open a connection (try 8)
ERROR:   [            7235]     Close: Unable to stop device

ERROR:   [            8235]     could not open a connection (try 9)
ERROR:   [            8236]     Close: Unable to stop device

ERROR:   [            9236]     could not open a connection (try 10)
ERROR:   [            9236]     Close: Unable to stop device

unable to open the device on port Sunxi
NOTICE:  [           10236]     connection opened
ERROR:   [           10236]     could not start CEC communications

But this is offtopic here, sorry about this.

 

can you please post hdmi_cec.ko file somewhere? I have even less experience with compiling kernel.

 

thanks

I build image for OrangePi ONE now and i can share it somewhere. It kind of the same as Opi Lite, but i don't know about wireless driver and if there are some specific tweaks. You have to avoid updates to keep it working, or at least kernel update. But Armbian build system is intuitive and user friendly, as inexperienced people like me can handle it. Why don't you try it? Just copy patch in /lib/patch/kernel/sun8i-default .

Link to comment
Share on other sites

Look's like jodamm version is newer than this in OpenElec.

 

OE uses 3.0.1 + patches. But I have no intention to update anything.

 

 

I build image for OrangePi ONE now and i can share it somewhere.

 

Alternatively, you could share kernel .deb package...

Link to comment
Share on other sites

On 12.04.2017 г. at 0:43 AM, john0815 said:

Are this deb files aldo possible for opipcplus?

I am not so familiar with differences, but it's not a good idea. They are for opilite and should work for opione too. Lastly i made image for opiplus2e with CEC module. If i haven't delete the source, maybe i will find debs files for it. But it is quite different than opiplus too. Except from peripherals, i think there where something about RAM modules.

Better make your own image from Armbian git and copy the patch for CEC in /lib/patch/kernel/sun8i-default, as is described above. But i have to note, that for me CEC is working only for Orange Pi PC and not working (even if showing some signs of work) for Opi One and Plus2e. I doubt my other too boards are damaged, so maybe something have to be tweaked for some boards, but i may be wrong, of course.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines