aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-compliance
AgeCommit message (Collapse)AuthorFilesLines
2018-10-08cec-compliance: retry poll in case of Arbitration LostHans Verkuil1-2/+15
Polling for remote devices can fail due to an Arbitration Lost condition. Check for this and retry if that was the reason why the poll failed. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-10-08cec-compliance: abort when no remote devices were foundHans Verkuil1-0/+5
These tests expect that at least one remote device is found. If not, exit with an error. Continuing without any remote devices will give weird unexpected errors, so check for this early on. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-10-05cec-compliance: check for new status flagsHans Verkuil1-2/+3
Also warn when the CEC_TX_STATUS_TIMEOUT flag was set: this shouldn't happen. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-10-04cec: move status2s functions to cec-info.cppHans Verkuil1-68/+0
All three cec utilities used the same code to construct a string with the message status. Move this code to cec-info.cpp and use it in all three utilities. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-10-03cec-compliance: fix bad check for transmitted vs pending msgsHans Verkuil1-1/+1
The total number of pending messages may be equal to the number of transmitted messages, so replace >= by > in the test. Signed-off-by: Hans Verkuil <hansverk@cisco.com>
2018-09-28cec-compliance: improve fail messageHans Verkuil1-3/+7
Log how many pending messages and transmitted messages there were. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-09-25cec-compliance: improve CEC_EVENT_LOST_MSGS testHans Verkuil1-4/+10
- Count the number of transmits and the max TX queue depth - Check that the number of transmits and the number of received messages is close to one another (keep a margin of 2) - Increase the timeout when dequeueing any remaining messages. 1000 ms was too low for some corner cases. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-09-20cec-compliance: split up combines testsHans Verkuil1-49/+106
There were a lot of fail_on_test(test1 || test2 || test3) checks that made debugging harder than it needs to be since you don't know which of the three tests failed. So split them all up into separate fail_on_test checks. Signed-off-by: Hans Verkuil <hansverk@cisco.com>
2018-09-14cec-compliance: improve adapter testHans Verkuil1-1/+3
There is a failure that checks the msg.len after sending a message. It fails because the transmit times out waiting for a reply. This fail is very confusing, so improve the test to make it easy to see that it timed out. Signed-off-by: Hans Verkuil <hansverk@cisco.com>
2018-09-14cec-compliance: fix set_osd_string testHans Verkuil1-1/+1
Even though cec-follower implemented SET_OSD_STRING correctly, cec-compliance would still give this warning: warn: cec-test.cpp(332): The device is in an unsuitable state or cannot display the complete message. This was due to an incorrect 'else' statement which should have checked if the received message was a Feature Abort. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-08-15cec-compliance: adapter test fixesHans Verkuil1-8/+16
- Don't attempt to configure the adapter as a TV if the physical address isn't 0.0.0.0. - Add a sleep(1) after testing the logical address handling: the last test there is in non-blocking mode, so you need to wait a bit until that non-blocking configuration actually finished. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-08-06cec-compliance: measure pings per secondHans Verkuil1-0/+51
As part of the adapter test check how many pings per second you can do towards both a valid and invalid LA and warn if it is less than the expected value. Check this for 5 full consecutive seconds since the remote side might be sending messages as well which can influence this value. Also fix a bug in DQEVENT test in testAdapLogAddrs(): you can get pin events with the CEC_EVENT_FL_INITIAL_STATE flag set, thus causing a fail. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-07-24cec-compliance: OK & MAX_RETRIES: report that workaround was appliedHans Verkuil1-1/+1
Previous versions of cec-compliance just reported that OK and MAX_RETRIES were both set. But now this is worked around, so mention that as well. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-07-24cec-compliance: if MAX_RETRIES and OK were set, mark as RX timeoutHans Verkuil1-1/+12
Fix the previous fix. Upon closer examination of when both MAX_RETRIES and OK are set it became clear that this happens when the TX succeeded, but waiting for a reply was cancelled. So return an RX_TIMEOUT in that case. Note that this CEC framework bug was fixed in kernel 4.18. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-07-23cec-compliance: if MAX_RETRIES and OK were set, clear OKHans Verkuil1-1/+3
There was a bug in the CEC framework where tx_status could have both OK and MAX_RETRIES flags set (this happened if a message was canceled). The cec-compliance utility did warn about this, but still passed tx_status on as-is. So clear the incorrect OK flag instead to avoid problems with this. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-06-28cec utils: -w implies -vHans Verkuil2-4/+5
Enabling wall clock time only makes sense for verbose reporting. So automatically enable verbose reporting for the -w option so that you don't have to do -w -v every time. Signed-off-by: Hans Verkuil <hansverk@cisco.com>
2018-06-26cec-compliance: send ACTIVE_SOURCE after IMAGE/TEXT_VIEW_ONHans Verkuil1-0/+6
Some devices will ignore a STANDBY command after an IMAGE/TEXT_VIEW_ON if it is received on an input that is not the current input. So transmit an ACTIVE_SOURCE after the display wakes up following an IMAGE/TEXT_VIEW_ON. Signed-off-by: Hans Verkuil <hansverk@cisco.com>
2018-06-25cec-compliance: add warning if a standby was ignoredHans Verkuil1-0/+6
A STANDBY was sent right after the display reports it was powered on, but that standby was ignored and had to be re-transmitted. Warn if that happens. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-06-06cec-compliance: add tests for Wake up TV on Image/Text View OnHans Verkuil1-3/+58
Add new tests that check if a TV wakes up when Image or Text View On is sent. Also fix several related bugs in the code that waits for power status transitions, esp. when dealing with TVs that pull the HPD low when in standby. Signed-off-by: Hans Verkuil <hansverk@cisco.com>
2018-06-06cec-compliance: improve tx_status checksHans Verkuil1-3/+6
Check that OK and MAX_RETRIES cannot both be set. If error status bits were set, then show the status instead of only showing the transmit status if there was an error, but OK was still set. Signed-off-by: Hans Verkuil <hansverk@cisco.com>
2018-06-06cec-compliance: document -s option in manpageHans Verkuil1-0/+3
When the -s option was added to cec-compliance, I forgot to update the manpage. Signed-off-by: Hans Verkuil <hansverk@cisco.com>
2018-06-01cec-compliance: add --exit-on-fail/warn optionsHans Verkuil3-0/+29
These options simplify debugging: when the first fail or warning occurs, the application will call exit(1) instead of continuing. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-05-15cec-compliance: add --skip-info optionHans Verkuil1-10/+18
Skips showing the device info part and the explanation of the test terminology. Signed-off-by: Hans Verkuil <hansverk@cisco.com>
2018-04-24cec-compliance: improve standby_resume_active_source_nowakeHans Verkuil1-3/+6
This shouldn't be CEC 2.0 specific, it is also valid for 1.4. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-03-08cec-compliance: remove outdated commentHans Verkuil1-7/+3
The comment about waiting X seconds before sending Image View On was outdated. Just remove it. The other comment explaining why we send Image View On was moved up a few lines to just before where we create the CEC message instead of where we call the CEC_TRANSMIT ioctl. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-03-01cec-compliance: don't poll, just send Image View OnHans Verkuil1-4/+3
If the PA is invalid, then we attempt to wake up the display by sending Image View On. Don't send a poll first as this can confuse the display. Signed-off-by: Hans Verkuil <hansverk@cisco.com>
2018-02-28cec-follower/compliance: improve parsing of optional argumentsHans Verkuil1-0/+12
Improve parsing of optional arguments: it can now understand --remote 4. This worked fine for required arguments, but an '=' between the option and arguments was needed if the arguments were optional, otherwise they wouldn't be parsed. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-02-28cec: improve usage messagesHans Verkuil2-8/+8
Drop the '=' separator between the option and the arguments in the usage message. It's confusing and not needed. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-02-07v4l-utils: add SPDX license tagsHans Verkuil6-78/+6
Replace existing licenses with SPDX license tags for those files authored by Cisco. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-02-04cec: renamed cec-common to cec-infoHans Verkuil4-3/+3
We have v4l2-info.cpp, media-info.cpp and cec-common.cpp has the same purpose. Rename to cec-info.cpp for consistency. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-01-11cec: fix warnings when building on arm 32 bitsMauro Carvalho Chehab4-6/+7
time() returns time_t, whose definition is arch-dependent. This fixes the following warnings: cec-test-power.cpp: In function ‘bool wait_changing_power_status(node*, unsigned int, unsigned int, __u8&, unsigned int&)’: cec-test-power.cpp:273:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while (time(NULL) - t < long_timeout) { ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ cec-test-power.cpp: In function ‘bool poll_stable_power_status(node*, unsigned int, unsigned int, __u8, unsigned int&)’: cec-test-power.cpp:301:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while (time(NULL) - t < long_timeout) { ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-27cec-compliance: Fix typoGregor Jasny1-1/+1
2017-09-29cec-compliance: use correct initiator in Image View OnHans Verkuil1-2/+8
The initiator for Image View On should be 0xf (Unregistered) if there is no HPD, or the adapter's logical address if there is a valid HPD. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-09-19cec-compliance: various improvements for no-HPD-in-standbyHans Verkuil2-14/+25
The standby tests failed for TVs that disable the HPD when in standby. One reason was a silly mistake in a condition testing for CEC_CAP_NEEDS_HPD: a ! was missing there. But other issues were related to the tests themselves (don't issue an IMAGE_VIEW_ON when trying to transmit a GIVE_POWER_STATUS, STANDBY or ACTIVE_SOURCE command since that would defeat the purpose). Another issue that the long_timeout handling was wrong. Use time() to determine if we timed out, that's much more reliable compared to the old method. Tested with a display with this 'feature'. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-08-22cec: add support for the Hospitality ProfileHans Verkuil2-2/+6
This patch adds support for the CEC standard of the Hospitality Technology Next Generation association: https://htng.site-ym.com/resource/collection/0F424615-23F0-4CBB-AFA9-F381C0DB6ACF/2014-06-17_EDC-Hospitality_Profile_for_HDMI_CEC_v1_3-FINAL.docx.doc I finally managed to get hold of a display that implemented this so I could test it. Currently the cec-htng headers are maintained here, but this might change in the future. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-08-08cec-compliance: fix uninitialized format ID arrayHans Verkuil1-1/+1
The array with audio format IDs used to create the Request Short Audio Descriptor message was uninitialized. Set to 0. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-08-08cec-compliance: use cec-commonHans Verkuil5-293/+10
Use cec-common.h and drop the duplicate code. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-08-08cec-compliance: move top-level adapter tests to cec-test-adapter.cppHans Verkuil3-52/+59
Refactor the code a bit. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-08-08cec-compliance: send IMAGE_VIEW_ON when no HPDHans Verkuil1-3/+31
When no HPD is detected at the start, then try to send an IMAGE_VIEW_ON to wake up the display. This to support some displays that turn off the HPD but still listen to CEC commands. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-08-08cec-compliance: try to reconnect if the HPD is goneHans Verkuil2-55/+131
The transmit_timeout() function will fail if the HPD is gone. This can happen when the remote TV switches inputs or goes into standby/wakes up. Some TVs also pull the HPD low when in standby, even though CEC still works. In that case you need to send an Image View On message. Modify the transmit_timeout() so that it waits for 3 seconds for the HPD to reappear. If it doesn't, then it sends an Image View On message and again waits for the HPD. If neither works, only then does it fail. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-07-19cec utils: support CEC_CAP_MONITOR_PIN and CEC_EVENT_FL_DROPPED_EVENTSHans Verkuil1-0/+2
Support this new CEC cap and event. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-07-06cec-compliance: don't set app_result to -1 if the ioctl failsHans Verkuil1-3/+0
There are many tests that expect an ioctl to fail, so that is not a reason to set app_result to -1. Only do this when a test fails. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-07-06cec-compliance: improve --verboseHans Verkuil1-6/+21
Also show the received messages from CEC_RECEIVE. Don't show these messages if CEC_TRANSMIT or CEC_RECEIVE returned an error, since the msg content is not interesting in that case. If you want to see the errno value, then use -T. Make -T and -v work a bit better when used together: no need to log something for -T for successful CEC_TRANSMIT/RECEIVE ioctls since -v will already log in that case. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-07-06cec-compliance.1.in: update the manual pageHans Verkuil1-0/+9
The man page was out of date. Sync it to the latest code. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-06-24cec-*: add support for CEC_CAP_NEEDS_HPDHans Verkuil1-0/+2
Support this new capability. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-06-09cec-compliance: show status if retransmits were detectedHans Verkuil1-0/+4
When --verbose is given, then show the tx_status if the transmit was OK, but retransmits were needed. Without this retransmits would be hidden. If you get these often, then that could indicate a hardware problem. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-05-03cec-compliance: add -w option, improve loggingHans Verkuil1-9/+63
Add the -w option to log timestamps in wallclock time. Also improve the -v logging: now show when messages are transmitted. This makes it easier to match the cec-compliance output with that of the cec-ctl -M output during debugging. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-04-27v4l2/cec-compliance, cec-follower: use git -C $(srcdir) rev-parse HEADHugues Fruchet1-2/+2
Apply git command on source worktree instead of derived objects working directory. This is needed within openembedded build environment. Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-04-03buildsystem: do not assume building in source tree.Ismo Puustinen1-1/+1
Use $(top_srcdir) as reference for include paths and buildtime scripts. Otherwise compilation outside of project root directory will fail because header and script paths are wrong. To reproduce: mkdir b; cd b; ../configure; make Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-02-22cec: fix wrong initiator of poll messagesHans Verkuil3-10/+10
The initiator of a poll message should be the current logical address, not 0xf. Note: due to a bug in the CEC framework in kernels 4.8 and 4.9 this fails for those kernels. Starting with kernel 4.10 (when the CEC framework was moved out of staging) this has been fixed. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Privacy Policy