path: root/utils/cec-compliance/cec-compliance.h
AgeCommit message (Collapse)AuthorFilesLines
2021-10-18cec-compliance: wake up remote device if neededHans Verkuil1-0/+1
Until now, if the remote device was in standby the test would just abort with a message that the remote device should be woken up manually. This patch changes this to attempt to automatically wake up the remote device. Basically it adds the 'Wake up' to the core tests, but it is only run if the remote device was in standby, otherwise it is skipped. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-08-25cec-compliance: fix broken timer testsHans Verkuil1-0/+1
If the remote device doesn't support the Timer Feature, then do not attempt to test for timer errors or overlapped timers. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-07-13cec-compliance: add cec-test-tuner-record-timer.cppHans Verkuil1-0/+5
Split off the tuner, record and timer tests into a separate source since cec-test.cpp became a bit too big. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-07-13cec: expand Timer Programming testsDeborah Brouwer1-0/+1
Check that Timer Status and Time Cleared Status replies have a valid operand. Send timers with out-of-range dates and check follower's response. Send an out-of-range recording sequence and check that the timer is not set. Send a duplicate timer and check that the timer is not set. Set overlapping timers and check that the timer overlap warning is set. In the follower, keep track of timers that have been received and warn if there may be insufficient space for a programmed recording. Signed-off-by: Deborah Brouwer <deborahbrouwer3563@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-07-01cec: expand One Touch Record testsDeborah Brouwer1-0/+1
Expand the One Touch Record tests so that the follower and initiator know their local and remote device types and respond accordingly. Send Record TV Screen and check that Record On source replies are valid. Send Record On source messages and check that Record Status replies are valid. Send Record Off and check that the recording terminates. Signed-off-by: Deborah Brouwer <deborahbrouwer3563@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-06-12cec: add tests for Deck Control messageDeborah Brouwer1-0/+5
Send all Deck Control commands Skip Forward, Skip Reverse, Stop and Eject and check the corresponding deck status. Test that the follower returns Feature Abort for invalid Deck Control operands. Signed-off-by: Deborah Brouwer <deborahbrouwer3563@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: move CEC_OP_DECK_CTL_MODE_EJECT up to after MODE_STOP]
2021-06-04cec-compliance: move CDC helper functions to cec-test.cppHans Verkuil1-4/+0
Several CDC helper functions were in cec-compliance.cpp, but they belong to cec-test.cpp where the CDC tests happen. Move them to cec-test.cpp. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-06-04cec-compliance: move audio helper functions to cec-test-audio.cppHans Verkuil1-2/+0
Several audio helper functions that were in cec-compliance.cpp really belong to cec-test-audio.cpp. Move them. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-04-21remove unused ARRAY_SIZERosen Penev1-3/+0
This is a C construct that is not really needed in C++. Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-04-21v4l2-compliance: rename stvec to vec_remote_subtestsHans Verkuil1-9/+9
I found stvec to be a bit too obscure, so renamed it. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-04-21v4l-utils: switch remote_subtest arrays to vectorRosen Penev1-16/+12
Easier to read and allows removing some boilerplate code. Only a moderate size increase. Ran through git clang-format Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-09-09clean up includes and convert C includes to C++Rosen Penev1-4/+0
Several C includes ending in .h are deprecated in C++. Tested with several combinations of uClibc-ng, musl, glibc, libstdcpp, libcxx, and uClibc++. Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-06-26cec-compliance: add 'reason' sanity check.Hans Verkuil1-0/+10
Fail if Feature Abort returned an unknown reason. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-05-14ubuntu1604: add missing headers for std::exitGregor Jasny1-0/+1
2020-04-28cec-compliance: add missing header for clangRosen Penev1-0/+1
Otherwise clock_getting doesn't get defined properly. Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-04-28utils: replace exit with std variantRosen Penev1-5/+3
Also converted to the appropriate macros for clarity. Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-03-20cec-compliance: check for invalid transient power statesHans Verkuil1-0/+6
Check in poll_stable_power_status() if the transient power state is correct, i.e. if you got from STANDBY to ON, then the transient state should be TO_ON, not TO_STANDBY. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-02-10cec-compliance: clarify obscure error messageHans Verkuil1-0/+2
The --expect option checks if the test result matches what is expected. If it isn't, then this message is shown: Dynamic Auto Lipsync feature: Request Current Latency: FAIL (Expected 0, got 3) That's not very clear, so this is now changed to: Dynamic Auto Lipsync feature: Request Current Latency: FAIL (Expected 'OK', got 'OK (Not Supported)') Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-01-21cec-compliance: add --expect-with-no-warningsHans Verkuil1-1/+1
This option is similar to --expect, but will fail if the test reported warnings. The --list-tests option can now be used even when the CEC adapter was unconfigured since this option doesn't rely on that. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-01-21cec-compliance.h: add warn_on_test, clean upsHans Verkuil1-17/+23
Clean up the macros a bit, add warn_on_test() macro. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-01-08cec-compliance: add invalid ioctls testHans Verkuil1-9/+0
Add an adapter test to check for correct handling of invalid ioctls. Also make the adapter tests static since they are only used inside cec-test-adapter.cpp. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-12-11cec: remove duplicate cec_phys_addr_exp definesHans Verkuil1-3/+0
Removed some duplicate defines for cec_phys_addr_exp. Also use this define in cec-follower. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-12-03cec-compliance: test CEC 2.0 power transitionsHans Verkuil1-1/+15
The CEC 2.0 standard requires that devices broadcast power state changes to avoid polling of the power state. Test that this is indeed implemented. Note that there is a bug in the linux cec framework that prevents this test from working. It is fixed in this patch: https://patchwork.linuxtv.org/patch/60444 But it will take some time before this appears in distro kernels. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-11-21cec-compliance: add -e and -l optionsHans Verkuil1-6/+13
The new -l (--list-tests) option lists all tests that are run, and a list of possible test results. The new -e (--expect) option allows the user to specify expected test results. This makes it possible to e.g. check that an optional feature is actually supported, or that a FAIL result is actually expected. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-10-14cec-compliance: add timeout to util_receiveHans Verkuil1-2/+3
util_receive() can currently loop indefinitely if it never gets the expected reply. Add a timeout. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-10-14cec-compliance: move util_receive to cec-compliance.cppHans Verkuil1-0/+2
We need this function elsewhere as well, so make it generic instead of specific to cec-test-audio.cpp. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-09-30cec-compliance: add --test-fuzzing optionHans Verkuil1-2/+6
Add fuzzing support. Randomly generate CEC messages. After every 10 random messages check that you can still get the CEC version from the remote device. This is an initial implementation. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-09-09cec-compliance: rename has_arc_rx, has_arc_txJiunn Chang1-2/+2
Renaming has_arc_rx and has_arc_tx to better match the macros defined in cec.h: - CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX - CEC_OP_FEAT_DEV_SINK_HAS_ARC_TX For devices on a HDMI ARC link, sources can only receive ARC and sinks can only transmit ARC. Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: slight rewording of the commit text]
2019-04-24cec-compliance: add colorsPhilipp Zabel1-2/+10
Use color codes to mark OK, warn, and FAIL messages with green, bold, and bright red accents, respectively. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-04-24cec-compliance: use warn() in warn_once()Philipp Zabel1-6/+1
Use the warn() macro in warn_once() instead of duplicating its contents. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29Revert "cec-compliance: suppress some warnings for vivid"Hans Verkuil1-1/+0
Instead of changing the adapter test itself (and thus hiding the very real vivid bug), we drop the -A option in test-media instead. This reverts commit 336df387b517572f06d37bbc79a9337804291530.
2019-03-29cec-compliance: suppress some warnings for vividHans Verkuil1-0/+1
The vivid's CEC emulation isn't perfect (it doesn't handle Arbitration Lost situations properly). So disable some warnings when the vivid emulation is detected. This should be reverted once vivid is eventually fixed. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2018-10-19cec-compliance: some standby tests should be a warningHans Verkuil1-9/+20
Tests were added to check the handling of core messages while the remote device is in standby. After testing with various devices I realized that many of those do not handle this well, causing the compliance test to fail. For now I have turned them into warnings. This might change in the future. I feel that this falls in the category of "it is really a failure, but almost everyone does this", so for the time being a warning is more appropriate. Signed-off-by: Hans Verkuil <hansverk@cisco.com>
2018-10-16cec-compliance: check core messages when remote is in standbyHans Verkuil1-0/+14
Check if the remote CEC device can handle the CEC core messages when in standby. And check that what is returned is equal to the value returned when the device was on. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2018-06-01cec-compliance: add --exit-on-fail/warn optionsHans Verkuil1-0/+8
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-02-07v4l-utils: add SPDX license tagsHans Verkuil1-13/+1
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 Verkuil1-1/+1
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 Chehab1-1/+2
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-08-22cec: add support for the Hospitality ProfileHans Verkuil1-0/+1
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: use cec-commonHans Verkuil1-11/+2
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 Verkuil1-0/+2
Refactor the code a bit. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-08-08cec-compliance: try to reconnect if the HPD is goneHans Verkuil1-55/+2
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-02-16cec-compliance: add --timeout optionHans Verkuil1-0/+1
The default timeout for power-related messages is 60 seconds. Add the --timeout option to make this configurable. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2016-12-19cec-ctl/cec-compliance: the transmit time for a byte is 24 ms, not 25Hans Verkuil1-2/+2
The time it takes for a byte to be transmitted on the CEC bus is 24 ms, not 25. Update the response time calculations accordingly. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2016-12-16cec-compliance: add option to set reply time thresholdHans Verkuil1-2/+9
Make this programmable (default is 1 second). Also improve the calculation by subtracting the time it takes (approximately) to receive the message. That gives a more accurate response time. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2016-12-16cec-compliance: report which message took too longHans Verkuil1-1/+2
When a reply to a message takes more than 1s, then a warning is issued. But it didn't say which message was transmitted. Show the opcode to help debugging such situations. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2016-12-07cec-compliance: only test for has_deck_ctl for playback and record devicesHans Verkuil1-0/+5
The CEC 2.0 has_deck_ctl tests should only be done for playback and record devices. Other devices do not set that feature. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2016-10-10cec tools: exit if device is disconnectedJohan Fjeldtvedt1-2/+7
If the CEC device is disconnected, ioctl will return ENODEV. This is checked for in cec-ctl (when monitoring), cec-follower and cec-compliance, to make these exit when the CEC device disappears. Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2016-08-15cec-compliance/follower: fix opcode printingJohan Fjeldtvedt1-3/+3
This contains some small fixes for printing opcodes correctly: opcode2s should print the message's opcode (based on byte 1), not the Aborted Message operand for Feature Abort messages (byte 2). When printing unknown opcode numbers, __u8 must be converted to unsigned to not print the numbers as characters. In transmit_timeout the original message struct is kept in order to print the original message opcode when a Feature Abort occurs. Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2016-08-15cec-compliance: add CEC compliance utilityJohan Fjeldtvedt1-0/+459
This utility makes it possible to test the local CEC adapter and/or a remote CEC device. It verifies as much as possible whether the CEC implementation follows the CEC specification. Note that these CEC features have currently limited test coverage: One Touch Record Deck Control Device Menu Control Audio Rate Control Tuner Control Timer Programming Capability Discovery and Control Vendor Specific Commands There is also no or very limited testing for Unregistered devices, CEC switches and CDC-only devices. Many thanks to Johan Fjeldtvedt who did this work during his Cisco Summer internship! Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Privacy Policy