[GUIDE] Getting libcec to work with ODROID's

Post Reply
mdrjr
Site Admin
Posts: 11782
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Has thanked: 1 time
Been thanked: 35 times
Contact:

[GUIDE] Getting libcec to work with ODROID's

Post by mdrjr »

First, to get CEC working you'll need a kernel that was updated at least on 2013-12-12.

On your Ubuntu install:

Dependencies:

Code: Select all

sudo apt-get update 
sudo apt-get install build-essential libudev-dev automake libtool pkg-config liblockdev1 liblockdev1-dev checkinstall
Sources

Code: Select all

git clone https://github.com/mdrjr/libcec.git
cd libcec
./bootstrap
./configure --enable-exynos
make -j5
sudo checkinstall
Fill the checkinstall requirements.
Or leave as it is and you'll have a .deb package for libcec! :)
install it by typing:

Code: Select all

sudo dpkg -i libcec_2.1.0-1_armhf.deb
Test

Code: Select all

sudo cec-client
Now, your TV should be able to send CEC commands and you'll see them on the console if everything goes fine.

Note: Make sure that you haven't the libcec from Ubuntu installed.

AreaScout
Posts: 1637
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: german, english
ODROIDs: X2, U3, XU3, C2, HiFi Shield, XU4, XU4Q,
N1, Go, VU5A, Show2, CloudShell2,
H2, N2, VU7A, VuShell, Go2, C4
Has thanked: 100 times
Been thanked: 279 times
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by AreaScout »

Thanks mdrjr, this is really cool :)

RG

Joshua
Posts: 28
Joined: Sun Oct 27, 2013 11:35 pm
languages_spoken: english, german
ODROIDs: U2, XU
Has thanked: 0
Been thanked: 0
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by Joshua »

I'm running Debian Jessie on an Odroid U2. After building and installation, when I run cec-client, I get the following error:

No device type given. Using 'recording device'
libcec.so.2: cannot open shared object file: No such file or directory
Cannot load libcec.so

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

Re: [GUIDE] Getting libcec to work with ODROID's

Post by memeka »

Run "ldconfig" and then try again

Joshua
Posts: 28
Joined: Sun Oct 27, 2013 11:35 pm
languages_spoken: english, german
ODROIDs: U2, XU
Has thanked: 0
Been thanked: 0
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by Joshua »

Thanks, it seems to work now. I get some errors, but I think the reason is I don't have a CEC device (yet). :)

Code: Select all

$ cec-client 
No device type given. Using 'recording device'
CEC Parser created - libCEC version 2.1.3
no serial port given. trying autodetect: 
 path:     /dev/CEC
 com port: Exynos

opening a connection to the CEC adapter...
DEBUG:   [              92]     unregistering all CEC clients
DEBUG:   [              92]     Broadcast (F): osd name set to 'Broadcast'
Can't open /dev/CEC!
ERROR:   [              93]     could not open a connection (try 1)
Can't open /dev/CEC!
ERROR:   [            1093]     could not open a connection (try 2)
Can't open /dev/CEC!
ERROR:   [            2093]     could not open a connection (try 3)
Can't open /dev/CEC!
ERROR:   [            3093]     could not open a connection (try 4)
Can't open /dev/CEC!
ERROR:   [            4093]     could not open a connection (try 5)
Can't open /dev/CEC!
ERROR:   [            5094]     could not open a connection (try 6)
Can't open /dev/CEC!
ERROR:   [            6094]     could not open a connection (try 7)
Can't open /dev/CEC!
ERROR:   [            7094]     could not open a connection (try 8)
Can't open /dev/CEC!
ERROR:   [            8094]     could not open a connection (try 9)
Can't open /dev/CEC!
ERROR:   [            9095]     could not open a connection (try 10)
NOTICE:  [           10095]     connection opened
ERROR:   [           10095]     could not start CEC communications
unable to open the device on port Exynos

Punky
Posts: 103
Joined: Tue Apr 02, 2013 11:47 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by Punky »

I keep getting a warning

2:1:0" is not a
*** Warning: debian policy compliant one. Please specify an alternate one

If i ignore the warning it fails building the deb file. if i change to 2:0:0 it works, but i don't know what the consequence is.

mdrjr
Site Admin
Posts: 11782
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Has thanked: 1 time
Been thanked: 35 times
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by mdrjr »

None.. just type the correct version of the package.. 2.1.3

Punky
Posts: 103
Joined: Tue Apr 02, 2013 11:47 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by Punky »

works great! thanks.

User avatar
codewalker
Posts: 1164
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 50 times
Been thanked: 82 times
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by codewalker »

Hi, I try CEC test with my LG TV.
but noting happened.
How can I know CEC event?

Here is cec-client log.

Code: Select all

odroid@odroid-desktop:~/project/libcec/src/testclient$ ./cec-client 
No device type given. Using 'recording device'
CEC Parser created - libCEC version 2.1.3
no serial port given. trying autodetect: 
 path:     /dev/CEC
 com port: Exynos

opening a connection to the CEC adapter...
DEBUG:   [              95]	unregistering all CEC clients
DEBUG:   [              95]	Broadcast (F): osd name set to 'Broadcast'
NOTICE:  [              96]	connection opened
DEBUG:   [              96]	<< Broadcast (F) -> TV (0): POLL
DEBUG:   [              96]	processor thread started
TRAFFIC: [              96]	<< f0
DEBUG:   [             152]	>> POLL sent
DEBUG:   [             152]	TV (0): device status changed into 'present'
DEBUG:   [             152]	<< requesting vendor ID of 'TV' (0)
TRAFFIC: [             152]	<< f0:8c
TRAFFIC: [             552]	>> 0f:87:00:e0:91
DEBUG:   [             553]	>> TV (0) -> Broadcast (F): device vendor id (87)
DEBUG:   [             553]	TV (0): vendor = LG (00e091)
DEBUG:   [             553]	expected response received (87: device vendor id)
DEBUG:   [             553]	replacing the command handler for device 'TV' (0)
DEBUG:   [             553]	TV (0): CEC version 1.3a
DEBUG:   [             553]	TV (0): menu language set to 'eng'
NOTICE:  [             553]	registering new CEC client - v2.1.3
DEBUG:   [             553]	detecting logical address for type 'recording device'
DEBUG:   [             553]	trying logical address 'Recorder 1'
DEBUG:   [             553]	<< Recorder 1 (1) -> Recorder 1 (1): POLL
TRAFFIC: [             553]	<< 11
ERROR:   [             796]	Write: write failed !
TRAFFIC: [             796]	<< 11
ERROR:   [            1040]	Write: write failed !
DEBUG:   [            1040]	>> POLL not sent
DEBUG:   [            1040]	using logical address 'Recorder 1'
DEBUG:   [            1040]	Recorder 1 (1): device status changed into 'handled by libCEC'
DEBUG:   [            1040]	Recorder 1 (1): power status changed from 'unknown' to 'on'
DEBUG:   [            1040]	Recorder 1 (1): CEC version 1.4
DEBUG:   [            1040]	AllocateLogicalAddresses - device '0', type 'recording device', LA '1'
DEBUG:   [            1040]	Recorder 1 (1): osd name set to 'CECTester'
DEBUG:   [            1040]	Recorder 1 (1): menu language set to 'eng'
DEBUG:   [            1040]	AutodetectPhysicalAddress - autodetected physical address '1000'
DEBUG:   [            1040]	Recorder 1 (1): physical address changed from ffff to 1000
DEBUG:   [            1040]	<< Recorder 1 (1) -> broadcast (F): physical adddress 1000
TRAFFIC: [            1040]	<< 1f:84:10:00:01
TRAFFIC: [            1177]	>> 1f:84:10:00:01
DEBUG:   [            1177]	>> Recorder 1 (1) -> Broadcast (F): report physical address (84)
DEBUG:   [            1177]	ignore physical address report for device Recorder 1 (1) because it's marked as handled by libCEC
NOTICE:  [            1177]	CEC client registered: libCEC version = 2.1.3, client version = 2.1.3, firmware version = 0, logical address(es) = Recorder 1 (1) , physical address: 1.0.0.0, host: armv7l-unknown-linux-gnueabihf, features: 'P8 USB' 'P8 USB detect' 'EXYNOS', git revision: 281941a, compiled on: Mon Dec 16 11:30:39 UTC 2013 by odroid@odroid-desktop on Linux 3.8.13.13 (armv7l)
DEBUG:   [            1177]	Recorder 1 (1): vendor = LG (00e091)
DEBUG:   [            1177]	replacing the command handler for device 'Recorder 1' (1)
DEBUG:   [            1177]	Recorder 1 (1): CEC version 1.3a
DEBUG:   [            1177]	Recorder 1 (1): power status changed from 'on' to 'in transition from standby to on'
DEBUG:   [            1177]	<< Recorder 1 (1) -> TV (0): in transition from standby to on
TRAFFIC: [            1177]	<< 10:90:02
DEBUG:   [            1266]	<< Recorder 1 (1) -> Broadcast (F): vendor id LG (e091)
TRAFFIC: [            1266]	<< 1f:87:00:e0:91
TRAFFIC: [            1403]	>> 1f:87:00:e0:91
DEBUG:   [            1403]	>> Recorder 1 (1) -> Broadcast (F): device vendor id (87)
DEBUG:   [            1403]	<< Recorder 1 (1) -> TV (0): OSD name 'CECTester'
TRAFFIC: [            1403]	<< 10:47:43:45:43:54:65:73:74:65:72
DEBUG:   [            1684]	<< requesting power status of 'TV' (0)
TRAFFIC: [            1684]	<< 10:8f
TRAFFIC: [            1876]	>> 0f:8c
DEBUG:   [            1876]	>> TV (0) -> Broadcast (F): give device vendor id (8C)
DEBUG:   [            2749]	expected response not received (90: report power status)
TRAFFIC: [            2749]	<< 10:8f
TRAFFIC: [            3092]	>> 0f:87:00:e0:91
DEBUG:   [            3092]	>> TV (0) -> Broadcast (F): device vendor id (87)
TRAFFIC: [            3092]	<< 10:00
TRAFFIC: [            3224]	>> 01:8c
DEBUG:   [            3224]	>> TV (0) -> Recorder 1 (1): give device vendor id (8C)
DEBUG:   [            3224]	<< Recorder 1 (1) -> TV (0): vendor id LG (e091)
TRAFFIC: [            3224]	<< 1f:87:00:e0:91
TRAFFIC: [            3361]	>> 1f:87:00:e0:91
DEBUG:   [            3361]	>> Recorder 1 (1) -> Broadcast (F): device vendor id (87)
TRAFFIC: [            3452]	>> 01:89:01
DEBUG:   [            3452]	>> TV (0) -> Recorder 1 (1): vendor command (89)
TRAFFIC: [            3452]	<< 10:89:02:05
NOTICE:  [            3565]	SL initialised
TRAFFIC: [            3656]	>> 01:90:00
DEBUG:   [            3656]	>> TV (0) -> Recorder 1 (1): report power status (90)
DEBUG:   [            3656]	TV (0): power status changed from 'unknown' to 'on'
DEBUG:   [            3656]	expected response received (90: report power status)
waiting for input
TRAFFIC: [            3808]	>> 01:90:00
DEBUG:   [            3808]	>> TV (0) -> Recorder 1 (1): report power status (90)
TRAFFIC: [            3937]	>> 01:89:01
DEBUG:   [            3937]	>> TV (0) -> Recorder 1 (1): vendor command (89)
TRAFFIC: [            3937]	<< 10:89:02:05
NOTICE:  [            4050]	SL initialised
TRAFFIC: [            4165]	>> 01:89:04:00
DEBUG:   [            4165]	>> TV (0) -> Recorder 1 (1): vendor command (89)
NOTICE:  [            4165]	SL initialised
TRAFFIC: [            4165]	<< 10:89:05:01
TRAFFIC: [            4368]	>> 01:1a:01
DEBUG:   [            4369]	>> TV (0) -> Recorder 1 (1): give deck status (1A)
DEBUG:   [            4369]	>> Recorder 1 (1): deck status changed from 'stop' to 'LG other'
DEBUG:   [            4369]	<< Recorder 1 (1) -> TV (0): deck status 'LG other'
TRAFFIC: [            4369]	<< 10:1b:20
TRAFFIC: [            4524]	>> 01:8f
DEBUG:   [            4524]	>> TV (0) -> Recorder 1 (1): give device power status (8F)
DEBUG:   [            4524]	<< Recorder 1 (1) -> TV (0): in transition from standby to on
TRAFFIC: [            4524]	<< 10:90:02
DEBUG:   [            4613]	Recorder 1 (1): power status changed from 'in transition from standby to on' to 'on'
TRAFFIC: [           15008]	>> 0f:87:00:e0:91
DEBUG:   [           15009]	>> TV (0) -> Broadcast (F): device vendor id (87)
TRAFFIC: [           15053]	>> 01
DEBUG:   [           15053]	<< POLL: TV (0) -> Recorder 1 (1)


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

Re: [GUIDE] Getting libcec to work with ODROID's

Post by memeka »

Seems to be working.
You can press "h" to see a list of commands. You can try the suspend commands, one will turn your TV off, one will turn your TV on :)
You can also press buttons on your remote, and see them in the log there, like switching HDMI source etc.

User avatar
codewalker
Posts: 1164
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 50 times
Been thanked: 82 times
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by codewalker »

Thanks. Must connect to HDMI connector #1. It works well.
I tryed on the #2.. :cry:

Code: Select all

DEBUG:   [          161058]	>> TV (0) -> Recorder 1 (1): user control release (45)
DEBUG:   [          161058]	key released: right (4)
TRAFFIC: [          165438]	>> 01:44:04
DEBUG:   [          165438]	>> TV (0) -> Recorder 1 (1): user control pressed (44)
DEBUG:   [          165438]	key pressed: right (4)
TRAFFIC: [          165507]	>> 01:45
DEBUG:   [          165507]	>> TV (0) -> Recorder 1 (1): user control release (45)
DEBUG:   [          165507]	key released: right (4)
TRAFFIC: [          166166]	>> 01:44:03
DEBUG:   [          166167]	>> TV (0) -> Recorder 1 (1): user control pressed (44)
DEBUG:   [          166167]	key pressed: left (3)
TRAFFIC: [          166236]	>> 01:45
DEBUG:   [          166236]	>> TV (0) -> Recorder 1 (1): user control release (45)
DEBUG:   [          166236]	key released: left (3)
TRAFFIC: [          167195]	>> 01:44:02
DEBUG:   [          167195]	>> TV (0) -> Recorder 1 (1): user control pressed (44)
DEBUG:   [          167195]	key pressed: down (2)
TRAFFIC: [          167264]	>> 01:45
DEBUG:   [          167264]	>> TV (0) -> Recorder 1 (1): user control release (45)
DEBUG:   [          167264]	key released: down (2)
TRAFFIC: [          167924]	>> 01:44:01
DEBUG:   [          167924]	>> TV (0) -> Recorder 1 (1): user control pressed (44)
DEBUG:   [          167924]	key pressed: up (1)
TRAFFIC: [          167993]	>> 01:45
DEBUG:   [          167993]	>> TV (0) -> Recorder 1 (1): user control release (45)
DEBUG:   [          167993]	key released: up (1)


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

Re: [GUIDE] Getting libcec to work with ODROID's

Post by memeka »

Yup, unfortunately currently only works on HDMI-1 :)

letesch
Posts: 4
Joined: Sat Jan 11, 2014 6:28 am
languages_spoken: english, german
ODROIDs: U2
Has thanked: 0
Been thanked: 0
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by letesch »

Hi,
I'm testing the method on a fresh image of the September build of "the debian_jessie" image on an U2,
but I' getting this Error message:

Code: Select all

oot@odroid-wheezy:~/libcec# cec-client 
No device type given. Using 'recording device'
CEC Parser created - libCEC version 2.1.3
no serial port given. trying autodetect: FAILED
Can someone tell me whats wrong here?

Thanks.

robroy
Posts: 3459
Joined: Mon Feb 25, 2013 2:29 am
languages_spoken: English
ODROIDs: Q2, X, X2, U2, U3, XU-E, XU3, XU4, C1, C1+, C2, GO, GO Advance, H2+
Location: Northern California
Has thanked: 3 times
Been thanked: 38 times
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by robroy »

letesch wrote:Hi,
I'm testing the method on a fresh image of the September build of "the debian_jessie" image on an U2,
but I' getting this Error message:

Code: Select all

oot@odroid-wheezy:~/libcec# cec-client 
No device type given. Using 'recording device'
CEC Parser created - libCEC version 2.1.3
no serial port given. trying autodetect: FAILED
Can someone tell me whats wrong here?

Thanks.

Code: Select all

cec-client --list-devices
More here: http://manpages.ubuntu.com/manpages/rar ... ent.1.html
Rob Roy, Editor-in-Chief of ODROID Magazine (submit an article | make a donation)

letesch
Posts: 4
Joined: Sat Jan 11, 2014 6:28 am
languages_spoken: english, german
ODROIDs: U2
Has thanked: 0
Been thanked: 0
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by letesch »

Code: Select all

root@odroid-wheezy:~# cec-client --list-devices
Found devices: NONE
If I look for myself there is no /dev/CEC in my system, so it seems the driver isn't working properly and didn't "mount" the CEC interface.

User avatar
meveric
Posts: 11441
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 63 times
Been thanked: 459 times
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by meveric »

if there is no /dev/CEC then it's missing within the kernel.
the libcec does NOT add /dev/CEC... you probably should update your kernel to the most recent version, or recompile your current version with CEC support, cause you gonne have /dev/CEC even WITHOUT a working libcec if the kernel has CEC support.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

letesch
Posts: 4
Joined: Sat Jan 11, 2014 6:28 am
languages_spoken: english, german
ODROIDs: U2
Has thanked: 0
Been thanked: 0
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by letesch »

Ok, thanks. I'm currently copying the ODROID GameStation Turbo with XBMC image to my emmc,
which seems to have CEC in the kernel.
I started copying it because I hab problems with samba shares and running xbmc as root didn't seem like a good idea.

User avatar
meveric
Posts: 11441
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 63 times
Been thanked: 459 times
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by meveric »

letesch wrote:Ok, thanks. I'm currently copying the ODROID GameStation Turbo with XBMC image to my emmc,
which seems to have CEC in the kernel.
I started copying it because I hab problems with samba shares and running xbmc as root didn't seem like a good idea.
true true, that's why i made my own build to get rid of some of the issues i encountered with other versions of XBMC..
But on the GameStation Turbo image, it also only works, cause the Kernel was build with CEC support and later on added the libcec.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

letesch
Posts: 4
Joined: Sat Jan 11, 2014 6:28 am
languages_spoken: english, german
ODROIDs: U2
Has thanked: 0
Been thanked: 0
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by letesch »

Ok, with the Gamestation Image cec on the command line works great, after i start the cec-client.
I added "cec-client &" to rc.local, so it starts after every boot.
Now, how can I connect Keypresses to certain cec events?

Edit: Ok, cec seems to work with xbmc if I run it as root, but not with the odroid user although the permissions are set right.
(like you posted here.)

User avatar
codewalker
Posts: 1164
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 50 times
Been thanked: 82 times
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by codewalker »

How do I build cec-client static binary?
I want to test cec on android.

I try this command.
./configure --enable-static --enable-exynos
but output was not static binary...

Thank you.

g.gregory
Posts: 29
Joined: Sat Jan 25, 2014 9:30 pm
languages_spoken: english
ODROIDs: ODROID-U3
Has thanked: 0
Been thanked: 0
Contact:

Re: [GUIDE] Getting libcec to work with ODROID's

Post by g.gregory »

Thanks for the great guide @mdrjr!!

Helps alot when your a linux newbie like me :)

Works perfectly on my LG TV. Now just need to find out if theres XBMC integration.

Post Reply

Return to “Ubuntu (All Linux'es)”

Who is online

Users browsing this forum: No registered users and 2 guests