CEC support?

Ask fellow members about Ceton's infiniTV tuners here.
Forum rules
Ceton no longer participate in this forum. Official support may still be handled via the Ceton Ticket system.
joshmsab

Posts: 20
Joined: Mon Jan 30, 2012 9:28 am
Location:

HTPC Specs: Show details

CEC support?

#1

Post by joshmsab » Mon Aug 19, 2013 5:18 am

are there any plans by Ceton to develop a cec adapter or integrate cec into any future devices? Or potentially partner with Pulse Eight to further develop their product? (they offer a usb hdmi cec adapter)

staknhalo

Posts: 1176
Joined: Wed Jun 08, 2011 1:26 pm
Location: Coral Springs, FL

HTPC Specs: Show details

#2

Post by staknhalo » Mon Aug 19, 2013 5:53 am

I don't believe so. A user here by the name of barnabas1969 is currently messing around with the Pulse Eight; so he might be able to help you/give advice.

http://www.thegreenbutton.tv/forums/vie ... f=7&t=5587

Tester

Posts: 95
Joined: Mon Jun 06, 2011 7:27 pm
Location:

HTPC Specs: Show details

#3

Post by Tester » Mon Aug 19, 2013 2:44 pm

I purchased the Pulse Eight USB device last year and have yet to get it to work properly with my system.
Unfortunately I had to move 3 months ago and my system is still in boxes till later this year when I will have the time to mess with the device.

My issue was mainly with their very confusing software, lack of forum help and lack of email response. I will be fair to note that they did finally respond to my emails/posts and provided quite a bit of info, which I intend to put to use later this year.

I hope my experience is a better one once I have the time to work with the device.

signcarver

Posts: 115
Joined: Thu Aug 02, 2012 8:39 pm
Location:

HTPC Specs: Show details

#4

Post by signcarver » Mon Aug 19, 2013 10:55 pm

Unless Ceton decides to deliver their Q, I don't think any device ceton makes could possibly support CEC as that would be up to the computer not the tuner as there is no HDMI.

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#5

Post by barnabas1969 » Tue Aug 20, 2013 6:09 pm

Signcarver is correct, at least partially. The tuners from Ceton have nothing to do with HDMI-CEC. The Echo, however, was supposed to have CEC functionality at launch... but it still does not. Ceton has stated that the Echo does in fact contain a CEC controller (the actual hardware required for CEC), but their firmware does not yet support it.

More than a year ago, I purchased the RCAware HDMI-CEC USB device. It works, but hangs occasionally. The RCAware device was actually a special version of the RainshadowTech device. The difference was in the firmware, device driver, and the fact that it was controlled by EventGhost. Soon after I bought it, RCAware told me that a new firmware version was forthcoming to solve my issues. That new firmware never materialized. RCAware has apparently closed up shop. They don't answer any e-mails (I've tried repeatedly for more than 6 months). Their website now refers you to RainshadowTech to purchase the device. RainshadowTech responded to me that there was a new firmware for the device and it was provided to RCAware, but that RCAware never tested it. After that response, RainshadowTech has gone silent too.

I purchased the Pulse-Eight device a few weeks ago. The software they supply is "supposed" to work with Windows Media Center, but it doesn't work very well at all. I sent them a list of 10+ items that don't work correctly. They responded with "we'll get back to you" and I haven't heard a word since.

I am currently trying to create an EventGhost plugin for the Pulse-Eight device. Pulse-Eight says that the "documentation" for their API is "in the source code." Yeah... but it's very bad documentation, and not nearly complete or detailed enough to use their API. So, I'm left to decipher their C++ source code. Unfortunately, I'm not a programmer by trade... but I've dabbled in VB6 (and several prior versions) for many years. I don't know anything about C++, so deciphering their code is going very slowly. EventGhost plugins are written in Python. I don't know Python either, so this just compounds the problem.

The current status of my plugin is that I have a shell of a plugin that successfully loads in EventGhost, and it will successfully load the API (libcec.dll). However, the first function which must be called before doing anything with the device is CecInitialise(). This function accepts exactly one parameter, which is defined as a very complicated structure in C++.

I believe that I have correctly translated this structure to Python using the ctypes library. Here's that section of my Python script for your reference:

Code: Select all

from ctypes import *
class CecConfiguration(Structure):
    _fields_ = [
    ('clientVersion',  c_uint32),           # the version of the client that is connecting 
    ('strDeviceName', c_char),              # the device name to use on the CEC bus, must be 13 characters 
    ('deviceTypes', c_int * 5),             # the device type(s) to use on the CEC bus for libCEC 
    ('bAutodetectAddress', c_uint8),        # (read only) set to 1 by libCEC when the physical address was autodetected 
    ('iPhysicalAddress', c_uint16),         # the physical address of the CEC adapter 
    ('baseDevice', c_int),                  # the logical address of the device to which the adapter is connected. only used when iPhysicalAddress = 0 or when the adapter doesn't support autodetection 
    ('iHDMIPort', c_uint8),                 # the HDMI port to which the adapter is connected. only used when iPhysicalAddress = 0 or when the adapter doesn't support autodetection 
    ('tvVendor', c_uint64),                 # override the vendor ID of the TV. leave this untouched to autodetect 
    ('wakeDevices', c_int * 16),            # list of devices to wake when initialising libCEC or when calling PowerOnDevices() without any parameter. 
    ('powerOffDevices', c_int * 16),        # list of devices to power off when calling StandbyDevices() without any parameter. 
    #
    ('serverVersion', c_uint32),            # the version number of the server. read-only 
    #
    # player specific settings
    ('bGetSettingsFromROM', c_uint8),       # true to get the settings from the ROM (if set, and a v2 ROM is present), false to use these settings. 
    ('bUseTVMenuLanguage', c_uint8),        # use the menu language of the TV in the player application 
    ('bActivateSource', c_uint8),           # make libCEC the active source on the bus when starting the player application 
    ('bPowerOffScreensaver', c_uint8),      # put devices in standby mode when activating the screensaver 
    ('bPowerOnScreensaver', c_uint8),       # wake devices when deactivating the screensaver 
    ('bPowerOffOnStandby', c_uint8),        # put this PC in standby mode when the TV is switched off. only used when bShutdownOnStandby = 0  
    ('bSendInactiveSource', c_uint8),       # send an 'inactive source' message when stopping the player. added in 1.5.1 
    #
    ('callbackParam', c_void_p),            # the object to pass along with a call of the callback methods. NULL to ignore 
    ('callbacks', c_void_p),
    #    callbacks                 = ICECCallbacks           # the callback methods to use. set this to NULL when not using callbacks 
    #
    ('logicalAddresses', c_int * 16),       # (read-only) the current logical addresses. added in 1.5.3 
    ('iFirmwareVersion', c_uint16),         # (read-only) the firmware version of the adapter. added in 1.6.0 
    ('bPowerOffDevicesOnStandby', c_uint8), # put devices in standby when the PC/player is put in standby. added in 1.6.0 
    ('bShutdownOnStandby', c_uint8),        # shutdown this PC when the TV is switched off. only used when bPowerOffOnStandby = 0. added in 1.6.0 
    ('strDeviceLanguage', c_char),          # the menu language used by the client. 3 character ISO 639-2 country code. see http://http://www.loc.gov/standards/iso639-2/ added in 1.6.2 
    ('iFirmwareBuildDate', c_uint32),       # (read-only) the build date of the firmware, in seconds since epoch. if not available, this value will be set to 0. added in 1.6.2 
    ('bMonitorOnly', c_uint8),              # won't allocate a CCECClient when starting the connection when set (same as monitor mode). added in 1.6.3 
    ('cecVersion', c_int),                  # CEC spec version to use by libCEC. defaults to v1.4. added in 1.8.0 
    ('adapterType', c_int),                 # type of the CEC adapter that we're connected to. added in 1.8.2 
    ('iDoubleTapTimeoutMs', c_uint8),       # prevent double taps withing this timeout. defaults to 200ms. added in 2.0.0 
    ('comboKey', c_int),                    # key code that initiates combo keys. defaults to CEC_USER_CONTROL_CODE_F1_BLUE. CEC_USER_CONTROL_CODE_UNKNOWN to disable. added in 2.0.5 
    ('iComboKeyTimeoutMs', c_uint32)        # timeout until the combo key is sent as normal keypress 
    ]


I've also attached the cectypes.h file (zipped) to this post. In it, you'll find the structure named "libcec_configuration". This file contains tags for the compiler that change the code depending on whether it is being compiled in C++ or C# (Pulse-Eight supplies their API in both languages). Since I don't know C++ nor C#, it's difficult for me to be sure that my Python ctypes structure is correct.

If anyone here knows C++, Python, and is familiar with the ctypes library, I'd greatly appreciate your help. I'm willing to do the grunt work of typing all the code, and testing it with my device, which is currently installed in my newly-built HTPC (that is not in everyday use yet). I just need someone to point me in the right direction.

Here's the cectypes.h file:
cectypes.zip
(12.35 KiB) Downloaded 124 times

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#6

Post by barnabas1969 » Tue Aug 20, 2013 8:25 pm

Someone PM'd me because they didn't understand what I was asking for in my post above.

Well, first, I need to know if my Python structure is correct and matches the C++ struct named libcec_configuration in the cectypes.h file. Then, I'm probably going to need help in setting the values in the few fields within that structure that are defined as arrays (look for "c_int * 5" and "c_int * 16" in the code that I pasted in the post above). It's easy to set values in the rest of the fields, but I am unable to set a value in those fields that are defined as arrays. I've been searching, but I just don't understand how to set values in them.

For example, I can easily set a value in the iHDMIPort field by doing this:

Code: Select all

CecConfiguration.iHDMIPort = 1
But when I try to do something like:

Code: Select all

CecConfiguration.deviceTypes[0] = 0
I get an error.

Then, once I have the structure correct, and understand how to update those arrays, I **think** that I should be able to successfully call CECInitialise.

Once I get past that hurdle, I think the rest of the programming will be pretty straight-forward. The other functions in the DLL only take one or two simple arguments each. Only the CECInitialise function takes this huge structure as an argument. It really has me baffled.

Tester

Posts: 95
Joined: Mon Jun 06, 2011 7:27 pm
Location:

HTPC Specs: Show details

#7

Post by Tester » Fri Aug 23, 2013 2:11 pm

Barnabas, I have been following your various posts and completely agree with you in regards to Pulse Eight.. Seems like a good hardware product, everything else about them sucks.
I would also like to lend a hand, I am a C++ programmer, but unfortunately am in a middle of move/house rehab and all my goodies are in a box for the moment. I hope to be in a position where I can help later this year.
In the meantime, I feel your pain and best of all luck !!!

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#8

Post by barnabas1969 » Fri Aug 23, 2013 2:17 pm

I discovered that I can do something like this in Python:

Code: Select all

CecConfiguration.deviceTypes = (0, None, None, None, None)
And it successfully sets the value 0 in the first element of the array. However, I haven't had time to test it further. I need to duplicate all of Pulse-Eight's constants in my Python code, which shouldn't be difficult. Then, I need to set all the default values in the CecConfiguration structure using the constants. Next, I'll try passing the CecConfiguration structure to the CECInitialise function, and cross my fingers that it works. If it doesn't then I'm going to need some help from someone who knows Python (especially the ctypes library) and C++.

casblan

Posts: 1
Joined: Sun Sep 01, 2013 11:35 pm
Location:

HTPC Specs: Show details

#9

Post by casblan » Sun Sep 01, 2013 11:44 pm

Barnabas, I registered for this board just to let you know I really hope you can figure it out. It would be awesome to operate the pulse eight adapter via event ghost. I'll be the first one in line to try out your plug in. Best of luck and thank you!

kasinator

Posts: 3
Joined: Tue Dec 10, 2013 7:54 am
Location:

HTPC Specs: Show details

#10

Post by kasinator » Tue Dec 10, 2013 7:55 am

Hi guys,

i just created a wrapper function around the cec-client.exe to interface events to Eventghost.
Open Items:
-Reconnect if connection to dongle is lost
-error handling if dongle not found (e.g. already in use by other application)
-hide cec-client.exe window
-make location of cec-client.exe configurable via GUI

working items (since 3 days):
-Generate Events from any Traffic going around
-Amp-Control (on, off, request power status, volumeup, volumedown, mute)
-TV-Control (on)

Here you can download it:
https://www.dropbox.com/s/rq24zz1v06rbhvf/libCEC.zip
Unzip to EventGhost plugin folder.

please keep me informed if you add features :)

Kasinator

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#11

Post by barnabas1969 » Tue Dec 10, 2013 7:16 pm

Cool. How did you manage to capture events from it? I looked at it, and it seemed too limited for that purpose.

kasinator

Posts: 3
Joined: Tue Dec 10, 2013 7:54 am
Location:

HTPC Specs: Show details

#12

Post by kasinator » Tue Dec 10, 2013 7:40 pm

That indeed was a very hard job as I am new to python, this is my first script ;-) at least I knew what I wanted to have.
I redirected stdout of the console window into a background task that is searching first for end of line character, then to grab everything after >> and << to fire plugin events.
I wanted to have the return path to automatically switch windows audio output when the amp is on and to switch it to TV, if not. I saw that my TV switches off my amp when it goes off. And the amp then sends a goodbye before powering off. On that command I trigger if winamp is running to switch the amp back on. Also my amp goes to 10 seconds mute if it receives a second 'on 5'. So I request the power status of the amp and react on the result, as it only comes if the amp is off.
And I wanted it fast, as I wanted to have it also for repeated volume up/down. So command line options were out. Also sendkeys was not fast and reliable enough.
I needed a background task as otherwise event ghost is halted until a cec traffic arrives.
And the pipe.readline function doesn't work for interactive console apps.

I think this method is very generic for any application that also send unrequested data and so should work for any CPP programmed console app.

In cec-client.exe press h <enter> to see a list of natively supported commands. You can use tx <weird number codes> to see how the media system reacts.
When starting with -d 8 it only reports traffic what makes it easier to debug with cec-o-matic.com

Have fun and comment :-)

kasinator

Posts: 3
Joined: Tue Dec 10, 2013 7:54 am
Location:

HTPC Specs: Show details

#13

Post by kasinator » Fri Dec 13, 2013 7:36 am

http://www.eventghost.ne...opic.php?f=9&t=5907
Hi
I created a v0.2 and move it to event ghost forum
The new version is more stable and provides an interface to send own packets without adapting the code.
I also added commands groups
The plugin now can be started and stopped without eventghost-crash.
It also kills all (for me known) libCEC using programs to get control over the adapter in case eventghost crashes and the cec-client.exe survived in background invisible.

Kasinator
Tvoff is now also in
If i remember correctly I also changed what is send for mute to cec

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#14

Post by barnabas1969 » Fri Dec 13, 2013 11:32 pm

Interesting... I received an e-mail reply from Pulse-Eight today. The reply came FOUR MONTHS after I sent them an e-mail detailing some major bugs in their tray application (in addition to other e-mails detailing bugs that were not as severe). They say that the new version of the tray application will be available this week ("probably today").

Here it is for your reading pleasure:

Code: Select all

Pulse-Eight Customer Services
6:40 AM (11 hours ago)

to me 
Hi,

we've looked into these bugs that you've reported, and these will be fixed in the next update of libCEC, 2.1.4, which should be released this week (probably today).

If you still encounter issues with this version, please let us know, so we can address those issues.

--
Pulse-Eight Customer Services
support@pulse-eight.com
---------------------------------------------------------------------------


-----Original Message-----
From: "brianr69@<hidden>.com" <brianr69@<hidden>.com>
Reply-To: "brianr69@<hidden>.com" <brianr69@<hidden>.com>
Date: Tue, 13 Aug 2013 20:37:57 -0400
To: "Pulse-Eight Customer Services" <support@pulse-eight.com>
Subject: Three MAJOR flaws with the tray application

>Tonight, I tried three simple tests using the tray application.  I am
>running Win 7 Professional x64, connected to a Samsung PN64D8000 TV
>(directly on HDMI port 3).  My RCAware CEC adapter, which is connected to a
>different PC, was disconnected during this test to ensure that it didn't
>interfere.
>
>For each test, I started the tray application and allowed it to start Media
>Center.  The tray application is set to minimize after it starts.  When I
>set these two options, I am able to use my TV remote to perform simple
>tasks in Media Center such as using the arrow keys.  The PC is set to S3
>standby mode.  Hibernate is disabled.
>
>All three of these problems are what I consider CRITICAL problems.  Your
>device/software are useless to me without this basic functionality.
>
>The three tests I performed were:
>
>1) I put the PC in standby while Media Center was in full-screen (while no
>video/audio was playing).  I did this by using the Media Center "Tasks"
>menu, then selected "shut down", and finally "Sleep".  The PC went to sleep
>successfully, but the TV did not turn OFF.  See attached log file named "PC
>standby but TV stays on.txt".
>
>2) After test #1, I woke the PC, closed the tray application and Media
>Center, and started the tray application again (because the tray
>application seems to not respond to CEC messages unless I start it from
>scratch each time).  This time, I used the TV remote to turn off the TV.  I
>expected the PC to also go to sleep.  It did not.  See attached log file
>named "TV standby but PC stays on.txt".
>
>3) Again, after test #2, I closed the tray application and Media Center,
>and started the tray application again.  This time, I scheduled a future
>recording.  Then, I put the PC to sleep, and turned off the TV.  When the
>PC woke up for the recording, it turned on the TV.  This should not happen.
>The TV should not turn on when a recording starts.  Only a user action
>should turn on the TV.  Scheduled tasks that cause the PC to resume from
>sleep should not turn on the TV.  Only user actions like pressing a button
>on the keyboard/mouse, pressing the power button on the PC, or pressing the
>power button an an MCE infrared remote should turn on the TV.  See attached
>log file named "TV turns on when PC wakes for recording.txt".

bandook

Posts: 21
Joined: Thu Sep 06, 2012 9:37 pm
Location:

HTPC Specs: Show details

#15

Post by bandook » Tue Jan 07, 2014 2:37 am

Hey Barnabas. Wondering if you have heard any more from pulse 8? I have been using the rcaware device for almost 2 years and it has been very reliable for me. However I am only using it to keep power states on my equipment in sync. I don't use it for any other features like controlling PC with TV remote or audio sync with receiver. You mentioned that you had issues with the rcaware adapter hanging. I also experienced that but for me it was due to its pickiness of what USB port it was plugged in. It hangs after a couple sleep cycles if its ever plugged into a usb3 port. And will hang on usb2 if its not the only device on the hub.

Anyways I'd be interested in what p8 does for you. Its really a shame that these companies put so little effort into further development of these products. The eg plugin for the rcaware device is working fine now, but what's gonna happen if eg is rewritten for python 3 or something in the eg code breaks the plugin. I'm pretty sure that there will be no more development for this plugin. Crap, support for the current plugin comes from one guy and it takes days/weeks to get a reply back from him. I've only asked him a couple questions but each time I did I felt out of place, like the plugin was written for only advanced system configurators and I shouldn't be bothering them with my noobish dribble. End rant. Good luck with p8!

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#16

Post by barnabas1969 » Wed Jan 08, 2014 4:12 am

I got an email a few weeks ago from Pulse Eight saying that they had updated their Windows app to fix the problems that I reported. I haven't tried it yet though. I plan to look at it in the next few days.

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#17

Post by barnabas1969 » Sat Jan 25, 2014 6:48 pm

Well, I finally tried the updated Pulse-Eight tray application. It appears that they did not fix many of the bugs that I reported. I replied to their e-mail and reported my findings. I'm planning to try kasinator's EG app today.

User avatar
makryger

Posts: 2132
Joined: Sun Jun 05, 2011 2:01 pm
Location: Illinois

HTPC Specs: Show details

#18

Post by makryger » Sat Jan 25, 2014 10:51 pm

That's disappointing. It still baffles me that graphics card companies aren't just adding HDMI-CEC to their outputs by default. Ignoring the fact that HDMI-CEC has been around for over ten years, HDMI has become commonplace for at least 5 years, and all the graphics card have HDMI by default now... with the more-than-satisfactory onboard graphics nowadays, the graphics card makers need a new feature to attract some of us HTPC users. Get us some HDMI-CEC, ARC, and HEC, and I'd buy a graphics card for my HTPC.
My Channel Logos XL: Get your Guide looking good! ~~~~ TunerSalad: Increase the 4-tuner limit in 7MC

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#19

Post by barnabas1969 » Mon Jan 27, 2014 6:27 am

I've been testing/using the EG plugin that kasinator wrote for the last two days. I'm so happy!

The plugin requires some knowledge of the CEC protocol (which I already have after messing with the RCAware plugin).

So far, I have my new Mini-ITX PC responding to events like when the TV turns on/off, or when I press the "Smart Hub" button on the TV remote (which is something that I could NEVER detect before). It even handles events when I select a source from the TV's internal "Source" menu!

Now, I've gone so far as to write my own EG plugin to control a Roku box over Ethernet/WiFi! You can get the plugin here:
http://www.eventghost.net/forum/viewtop ... f=9&t=5995

I'm planning to setup my EG macros so that EG will emulate a "phantom" CEC device, so that the TV thinks that the Roku box is CEC-compliant! The new plugin that I wrote (see link above) will then relay the appropriate commands to the Roku box over the network. This will allow anyone to control my Roku box using the TV's original remote control, and will also allow anyone to press the "Source" button on the TV remote in order to select the "Roku" device... which will then select the appropriate HDMI inputs automatically! Dummy-proof.

Like I said... I'm so happy!

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#20

Post by barnabas1969 » Thu Feb 13, 2014 6:09 pm

Just thought I'd post back here. The libCEC plugin that kasinator wrote for EventGhost has been 100% reliable for me over the past couple of weeks. I was never able to go more than a week on the RCAware device without a problem that required disconnecting it from the USB cable, waiting a few seconds, and then reconnecting it (so that it would reboot).

The Pulse-Eight hardware is perfect, and the plugin from kasinator works very well.

With my current configuration in EventGhost, when I turn on my TV... my EG macro turns on the AVR, sets the correct HDMI inputs, starts Media Center on the PC in full-screen, makes sure Media Center is in the foreground. When I turn off the TV, the AVR turns off, and Media Center is closed. I no longer let my PC sleep, so it's always on and waiting for CEC commands.

When I press the Source button on my TV remote, I can switch between the Media Center PC and the Roku box. This automatically changes the active source (switching to the correct HDMI input), changes my EG configuration tree to activate the appropriate set of commands, and controls the selected device using the IR sensor on my TV.

It's very stable.

Post Reply