We continue our discussion of the CEC functionality in HDMI for Installment 025. Before we dive into CEC though, Ian spends a little time enlightening us to his adventures with MyDevices and a couple of other applications for interacting with devices and services based on UPnP technologies/DLNA from his cell phone.
There has been a lot of confusion regarding CEC, proprietary implementations (cross-vendor compatibility), and interoperability. Fortunately, there finally is a trend with many of the newer products to work across different vendors’ implementations. It still takes some sort of UI to set the CEC relationships up initially and certain vendors do a better job at that than others, but they are improving all of the time. My view is that we finally are starting to see a workable cross-product CEC solution from several vendors which actually lives up to the original vision conceived by the HDMI founders.
We do get lost a little bit with the internals of how CEC addressing works (and may even confuse many listeners). Sorry about that – how CEC really functions is a difficult topic to try to summarize. Fortunately, it is not something that most custom integrators need to worry about, although it is good to understand the concepts behind it because it is a key piece of how CEC and HDMI work in general. The basics of it are included here for clarification. The main concept to grasp is that CEC affords the “macro-like” usage (one touch) scenarios we described in the previous Installment (024). Those scenarios are based on communicating with device types through their physical CEC addresses while using their logical addresses for communicating with the individual devices themselves.
In other words, the CEC usage scenario functionality we discussed previously deals with a hierarchy of HDMI-based device types. Each device type has a specific physical address assigned to it. At first, this seems a bit limiting in practice, but the following device type list does encompass all of the major types of A/V devices in a cluster. It does induce constraints in very large HDMI-based implementations, so it is important to take this into account when looking at large HDMI Matrix Switches and distribution platforms.
CEC DEVICE TYPES
ADDRESS DEVICE
0 TV
1 Recording Device 1
2 Recording Device 2
3 STB1
4 DVD1
5 Audio System
6 STB2
7 STB3
8 DVD2
9 Recording Device 3
10 Reserved
11 Reserved
12 Reserved
13 Reserved
14 Free Use
15 Unregistered (as initiator address)
Broadcast (as destination address)
CEC ADDRESSING
• CEC devices have both physical and logical addresses. Normally, upon each hot-plug, each CEC source obtains a physical address by reading the EDID of the sink it is attached to.
• For CEC to be able to address specific physical devices and control switches, all devices have a physical address. CEC device addressing and connectivity is negotiated whenever a new device is added to an HDMI cluster. The physical address discovery process uses only the DDC/EDID mechanism and must apply to all HDMI Sinks and Repeaters, not just the CEC-capable devices themselves.
• The CEC line is directly connected to all nodes on the network. After discovering their own physical address, the CEC devices transmit their physical and logical addresses to all other devices, thus allowing any device to create a map of the network.
• The physical address of each CEC device is expressed as four numbers and indicates where it is relative to the “root” display (TV), whose address is always fixed at 0.0.0.0. As an example, the first STB in the system is always given the logical address 3 (as seen above).
– For example, a source attached to input #1 of the “root” display (TV), will have a physical address of 1.0.0.0
• Each CEC device also obtains a logical address – reflecting its product type – by negotiating with other CEC devices in the system.
CEC DISCOVERY
• The physical address of each node is determined through the physical address discovery process. This process is dynamic in that it automatically adjusts physical addresses as required when devices are physically or electrically added or removed from the device tree.
• All Sinks and Repeaters perform the steps of physical address discovery and propagation, even if those devices are not CEC-capable. Sources are not required to determine their own physical address unless they are CEC-capable.
• A Sink or a Repeater that is acting as the CEC root device will generate its own physical address: 0.0.0.0. A Source or a Repeater reads its physical address from the EDID of the connected Sink.
• The CEC line may be connected to only one HDMI output so a device with multiple HDMI outputs will read its physical address from the EDID on the CEC-connected output. Each Sink and Repeater is responsible for generating the physical address of all Source devices connected to that device by appending a port number onto its own physical address and placing that value in the EDID for that port. The Source Address Field of the HDMI Vendor Specific Data Block (VSDB) is used for this purpose.
CEC DISCOVERY SEQUENCE
• Each device appearing on the control signal line (CEC buss) has a unique logical address. This address defines a device type as well as being a unique identifier.
• If a physical device contains the functions of more than one logical device, then it should take the logical addresses for each of those logical devices. A device may declare the functionality of another device by using a different logical address.
–For example a recordable DVD device may take the address 4 or 8 to expose only the functionality of a standard DVD device.
CEC LOGICAL ADDRESS ALLOCATION
• A logical address only is allocated when a device has a valid physical address (i.e. not F.F.F.F). At all other times, a device takes the ‘Unregistered’ logical address (15).
• Only the device at physical address 0.0.0.0 may take the logical address of a TV (0). A TV at any other physical address should take the ‘Free Use’ (14) address. If address 14 already is allocated, it takes the ‘Unregistered’ address (15).
• Reserved addresses currently are not used and are reserved for future extensions to the specification.
• Where more than one possible logical address is available for the given device type (i.e. STB1, STB2, etc.), an address allocation procedure is carried out by a newly connected device. The device takes the first allocated address and sends a polling message to the same address (STB1 to STB1). If the polling message is not acknowledged, then the device stops the procedure and retains that address.
• If the first address is acknowledged, then the device takes the next address and repeats the process (STB2 to STB2). Again, if the message is not acknowledged, the device keeps that address.
• This procedure continues until all possible ‘type specific’ addresses have been checked. If no ‘type specific’ addresses are available, the device takes the unregistered address (15).
• A device may lose its logical address when it is disconnected or switched off. However, it may remember its previous logical address so that the next time it is reconnected, it can begin the polling process at its previous logical address. It then tries each other allowable logical address in sequence before taking the unregistered address.
– For example if a STB that was previously allocated address STB2 is reconnected, it would poll STB2, STB3, and STB1 before taking the unregistered address.
• If a device loses its physical address at any time (if it is unplugged), then its logical address shall be set to unregistered (15).
CEC PROTOCOL EXTENSIONS
• To allow for extensions to the protocol in future releases of the specification, the current opcodes and parameters can be extended by adding further parameters onto them. If an older CEC node receives a message with more operands than expected, it should ACK the additional operands and simply ignore unknown ones, thus allowing extensions to already existing commands.
• For entirely new commands, new opcodes can be allocated. For entirely new device types, new standardized addresses may be allocated.
SO, WHAT DOES ALL OF THIS MEAN TO A SYSTEM DESIGN?
• CEC allows a variety of usage scenarios to take occur automatically if the equipment supports it.
• There is a limit of ten (10) devices total in a CEC/HDMI hierarchy (which is not discussed much by any of the vendors).
– This limit partially is dependent upon the time it takes to renew the HDCP keys
– There also may be an additional limit on the number of HDCP Key Registers in specific devices in the chain
• HDMI Matrix Switches and CEC addressing are critical factors in your purchasing criteria and should not be overlooked when evaluating specifications.
CEC has a lot of potential. It seems to have gotten a bad rap early on because most vendors only supported their own products. That is changing. We definitely are seeing a trend in the marketplace for devices to leverage the capabilities of a CEC backbone for command and control. We hope that trend continues, because it is one of those underused features of HDMI that really gives it an edge in system designs and implementations.
One thought on “More CEC and a Little 3-D – Installment 025”
Hello!
Sorry to comment that late, but I just recently found your podcast.
Although we set a few errors of your podcast straight here in the show notes, I would really like to mention, that a few statements were very misleading. Especially were you talk about CEC and matrix switchers.
Many of the shortcomings of CEC are based on the simple fact, that CEC was never intended for multi-display systems. Without kicking most of the spec it is also not easy to get matrix switcher support (multiple outputs, multiple displays) into the spec.
After designing the probably most extensive CEC implementation for control systems (Crestron to be specific) I felt the pain and learned a lot. There are dramatically less real incompatibilities in CEC than people are claiming to be. Most of them in fact relate to the “it does not work as I want it to work and therefore it must be a bug”. I could give you numerous examples.
Long story short: CEC is indeed cool but you have to go the extra mile to do it right. Otherwise you and especially the end user will be burned badly.
{"id":null,"mode":"button","open_style":"in_place","currency_code":"GBP","currency_symbol":"\u00a3","currency_type":"decimal","blank_flag_url":"https:\/\/thedigitallifestyle.com\/w\/wp-content\/plugins\/tip-jar-wp\/\/assets\/images\/flags\/blank.gif","flag_sprite_url":"https:\/\/thedigitallifestyle.com\/w\/wp-content\/plugins\/tip-jar-wp\/\/assets\/images\/flags\/flags.png","default_amount":500,"top_media_type":"none","featured_image_url":false,"featured_embed":"","header_media":null,"file_download_attachment_data":null,"recurring_options_enabled":true,"recurring_options":{"never":{"selected":true,"after_output":"One time only"},"weekly":{"selected":false,"after_output":"Every week"},"monthly":{"selected":false,"after_output":"Every month"},"yearly":{"selected":false,"after_output":"Every year"}},"strings":{"current_user_email":"","current_user_name":"","link_text":"Leave a tip","complete_payment_button_error_text":"Check info and try again","payment_verb":"Pay","payment_request_label":"TheDigitalLifestyle.com","form_has_an_error":"Please check and fix the errors above","general_server_error":"Something isn't working right at the moment. Please try again.","form_title":"TheDigitalLifestyle.com","form_subtitle":null,"currency_search_text":"Country or Currency here","other_payment_option":"Other payment option","manage_payments_button_text":"Manage your payments","thank_you_message":"Thank you for being a supporter!","payment_confirmation_title":"TheDigitalLifestyle.com","receipt_title":"Your Receipt","print_receipt":"Print Receipt","email_receipt":"Email Receipt","email_receipt_sending":"Sending receipt...","email_receipt_success":"Email receipt successfully sent","email_receipt_failed":"Email receipt failed to send. Please try again.","receipt_payee":"Paid to","receipt_statement_descriptor":"This will show up on your statement as","receipt_date":"Date","receipt_transaction_id":"Transaction ID","receipt_transaction_amount":"Amount","refund_payer":"Refund from","login":"Log in to manage your payments","manage_payments":"Manage Payments","transactions_title":"Your Transactions","transaction_title":"Transaction Receipt","transaction_period":"Plan Period","arrangements_title":"Your Plans","arrangement_title":"Manage Plan","arrangement_details":"Plan Details","arrangement_id_title":"Plan ID","arrangement_payment_method_title":"Payment Method","arrangement_amount_title":"Plan Amount","arrangement_renewal_title":"Next renewal date","arrangement_action_cancel":"Cancel Plan","arrangement_action_cant_cancel":"Cancelling is currently not available.","arrangement_action_cancel_double":"Are you sure you'd like to cancel?","arrangement_cancelling":"Cancelling Plan...","arrangement_cancelled":"Plan Cancelled","arrangement_failed_to_cancel":"Failed to cancel plan","back_to_plans":"\u2190 Back to Plans","update_payment_method_verb":"Update","sca_auth_description":"Your have a pending renewal payment which requires authorization.","sca_auth_verb":"Authorize renewal payment","sca_authing_verb":"Authorizing payment","sca_authed_verb":"Payment successfully authorized!","sca_auth_failed":"Unable to authorize! Please try again.","login_button_text":"Log in","login_form_has_an_error":"Please check and fix the errors above","uppercase_search":"Search","lowercase_search":"search","uppercase_page":"Page","lowercase_page":"page","uppercase_items":"Items","lowercase_items":"items","uppercase_per":"Per","lowercase_per":"per","uppercase_of":"Of","lowercase_of":"of","back":"Back to plans","zip_code_placeholder":"Zip\/Postal Code","download_file_button_text":"Download File","input_field_instructions":{"tip_amount":{"placeholder_text":"How much would you like to tip?","initial":{"instruction_type":"normal","instruction_message":"How much would you like to tip? Choose any currency."},"empty":{"instruction_type":"error","instruction_message":"How much would you like to tip? Choose any currency."},"invalid_curency":{"instruction_type":"error","instruction_message":"Please choose a valid currency."}},"recurring":{"placeholder_text":"Recurring","initial":{"instruction_type":"normal","instruction_message":"How often would you like to give this?"},"success":{"instruction_type":"success","instruction_message":"How often would you like to give this?"},"empty":{"instruction_type":"error","instruction_message":"How often would you like to give this?"}},"name":{"placeholder_text":"Name on Credit Card","initial":{"instruction_type":"normal","instruction_message":"Enter the name on your card."},"success":{"instruction_type":"success","instruction_message":"Enter the name on your card."},"empty":{"instruction_type":"error","instruction_message":"Please enter the name on your card."}},"privacy_policy":{"terms_title":"Terms and conditions","terms_body":null,"terms_show_text":"View Terms","terms_hide_text":"Hide Terms","initial":{"instruction_type":"normal","instruction_message":"I agree to the terms."},"unchecked":{"instruction_type":"error","instruction_message":"Please agree to the terms."},"checked":{"instruction_type":"success","instruction_message":"I agree to the terms."}},"email":{"placeholder_text":"Your email address","initial":{"instruction_type":"normal","instruction_message":"Enter your email address"},"success":{"instruction_type":"success","instruction_message":"Enter your email address"},"blank":{"instruction_type":"error","instruction_message":"Enter your email address"},"not_an_email_address":{"instruction_type":"error","instruction_message":"Make sure you have entered a valid email address"}},"note_with_tip":{"placeholder_text":"Your note here...","initial":{"instruction_type":"normal","instruction_message":"Attach a note to your tip (optional)"},"empty":{"instruction_type":"normal","instruction_message":"Attach a note to your tip (optional)"},"not_empty_initial":{"instruction_type":"normal","instruction_message":"Attach a note to your tip (optional)"},"saving":{"instruction_type":"normal","instruction_message":"Saving note..."},"success":{"instruction_type":"success","instruction_message":"Note successfully saved!"},"error":{"instruction_type":"error","instruction_message":"Unable to save note note at this time. Please try again."}},"email_for_login_code":{"placeholder_text":"Your email address","initial":{"instruction_type":"normal","instruction_message":"Enter your email to log in."},"success":{"instruction_type":"success","instruction_message":"Enter your email to log in."},"blank":{"instruction_type":"error","instruction_message":"Enter your email to log in."},"empty":{"instruction_type":"error","instruction_message":"Enter your email to log in."}},"login_code":{"initial":{"instruction_type":"normal","instruction_message":"Check your email and enter the login code."},"success":{"instruction_type":"success","instruction_message":"Check your email and enter the login code."},"blank":{"instruction_type":"error","instruction_message":"Check your email and enter the login code."},"empty":{"instruction_type":"error","instruction_message":"Check your email and enter the login code."}},"stripe_all_in_one":{"initial":{"instruction_type":"normal","instruction_message":"Enter your credit card details here."},"empty":{"instruction_type":"error","instruction_message":"Enter your credit card details here."},"success":{"instruction_type":"normal","instruction_message":"Enter your credit card details here."},"invalid_number":{"instruction_type":"error","instruction_message":"The card number is not a valid credit card number."},"invalid_expiry_month":{"instruction_type":"error","instruction_message":"The card's expiration month is invalid."},"invalid_expiry_year":{"instruction_type":"error","instruction_message":"The card's expiration year is invalid."},"invalid_cvc":{"instruction_type":"error","instruction_message":"The card's security code is invalid."},"incorrect_number":{"instruction_type":"error","instruction_message":"The card number is incorrect."},"incomplete_number":{"instruction_type":"error","instruction_message":"The card number is incomplete."},"incomplete_cvc":{"instruction_type":"error","instruction_message":"The card's security code is incomplete."},"incomplete_expiry":{"instruction_type":"error","instruction_message":"The card's expiration date is incomplete."},"incomplete_zip":{"instruction_type":"error","instruction_message":"The card's zip code is incomplete."},"expired_card":{"instruction_type":"error","instruction_message":"The card has expired."},"incorrect_cvc":{"instruction_type":"error","instruction_message":"The card's security code is incorrect."},"incorrect_zip":{"instruction_type":"error","instruction_message":"The card's zip code failed validation."},"invalid_expiry_year_past":{"instruction_type":"error","instruction_message":"The card's expiration year is in the past"},"card_declined":{"instruction_type":"error","instruction_message":"The card was declined."},"missing":{"instruction_type":"error","instruction_message":"There is no card on a customer that is being charged."},"processing_error":{"instruction_type":"error","instruction_message":"An error occurred while processing the card."},"invalid_request_error":{"instruction_type":"error","instruction_message":"Unable to process this payment, please try again or use alternative method."},"invalid_sofort_country":{"instruction_type":"error","instruction_message":"The billing country is not accepted by SOFORT. Please try another country."}}}},"fetched_oembed_html":false}
Hello!
Sorry to comment that late, but I just recently found your podcast.
Although we set a few errors of your podcast straight here in the show notes, I would really like to mention, that a few statements were very misleading. Especially were you talk about CEC and matrix switchers.
Many of the shortcomings of CEC are based on the simple fact, that CEC was never intended for multi-display systems. Without kicking most of the spec it is also not easy to get matrix switcher support (multiple outputs, multiple displays) into the spec.
After designing the probably most extensive CEC implementation for control systems (Crestron to be specific) I felt the pain and learned a lot. There are dramatically less real incompatibilities in CEC than people are claiming to be. Most of them in fact relate to the “it does not work as I want it to work and therefore it must be a bug”. I could give you numerous examples.
Long story short: CEC is indeed cool but you have to go the extra mile to do it right. Otherwise you and especially the end user will be burned badly.