Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
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>
|
|
Also warn when the CEC_TX_STATUS_TIMEOUT flag was set: this shouldn't
happen.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
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>
|
|
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>
|
|
Log how many pending messages and transmitted messages there were.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
- 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>
|
|
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>
|
|
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>
|
|
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>
|
|
- 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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
When the -s option was added to cec-compliance, I forgot to update
the manpage.
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
|
|
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>
|
|
Skips showing the device info part and the explanation of the
test terminology.
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
|
|
This shouldn't be CEC 2.0 specific, it is also valid for 1.4.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Replace existing licenses with SPDX license tags for those
files authored by Cisco.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
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>
|
|
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>
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Use cec-common.h and drop the duplicate code.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Refactor the code a bit.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
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>
|
|
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>
|
|
Support this new CEC cap and event.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
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>
|
|
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>
|
|
The man page was out of date. Sync it to the latest code.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Support this new capability.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|