Commit Graph

747 Commits

Author SHA1 Message Date
Yixiao Luo
04a9ed4b79 Merge "Add OWNERS file to TV Input HAL" am: 511538808f am: a8ca4e0c2b am: d510d715e7 am: 8c943a70d3 am: 668d7b8fc9
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2189256

Change-Id: I5084c7797c2111167395bf8171446e266f092ec1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-27 00:54:07 +00:00
Yixiao Luo
f8de1e8e49 Merge "TV Input HAL 2.0 VTS" 2022-08-26 23:19:47 +00:00
Yixiao Luo
dc5ed0b53b Merge "TV Input HAL 2.0 default implementation" 2022-08-26 23:19:47 +00:00
Yixiao Luo
29b6721e15 Merge "TV Input HAL 2.0 AIDL interface" 2022-08-26 23:19:47 +00:00
Hongguang Chen
c45168ad17 Merge "Make the default tuner HAL to be a dynamic AIDL" 2022-08-25 20:18:43 +00:00
Lucas Gates
b6d357a1f4 Merge "Tuner HAL Remove Outdated Filter Buffer Comment" 2022-08-25 05:13:01 +00:00
Lucas Gates
ee301e5d50 Tuner HAL Remove Outdated Filter Buffer Comment
The filter BUFFER_SIZE parameter currently contains a
comment stating that changing its size may cause sudden
crashes due to problems with memory management. This
problem has since been found and solved. Since the buffer
size is no longer a likely source of errors, this comment
should be removed.

Test: Comment only change
Bug: 236847284 introduced this comment, 239741712
covered the real root cause

Change-Id: I9344d136c7220f54d8c66dd4f4da68890b841886
2022-08-25 01:43:05 +00:00
Yixiao Luo
ce501336b9 TV Input HAL 2.0 VTS
Initial version, fixed tabs.
Addressed comments.
Updated based on new AIDL interface changes.

Bug: 227673740
Test: VTS
Change-Id: I0b5533ccff8c2c9ab9e0393cadce86b26cfc157b
2022-08-23 18:39:07 -07:00
Yixiao Luo
aaa523018f TV Input HAL 2.0 default implementation
Initial version, fixed tabs.
Addressed comments.
Updated based on new AIDL interface changes.

Bug: 227673740
Test: atest VtsHalTvInputTargetTest
Change-Id: I49af8baa30404700fc38662b813913fe8cf08c0f
2022-08-24 01:31:36 +00:00
Yixiao Luo
2b41ee5263 TV Input HAL 2.0 AIDL interface
Initial version, fixed tabs.
Addressed comments.

Bug: 227673740
Test: atest VtsHalTvInputTargetTest
Change-Id: Id4bc501c4898239bd9325c8688687d95db74cf1d
2022-08-23 17:17:22 -07:00
Hongguang
4a8ac29204 Make the default tuner HAL to be a dynamic AIDL
Add lazy tuner service.
Refine code to allow Tuner reference count to be 0 when no one uses it.

Bug: 236002754
Test: atest VtsHalTvTunerTargetTest on both lazy and normal HALs
Test: atest android.media.tv.tuner.cts on both lazy and normal HALs
Change-Id: I0cc69fe8ffd79a66db00cb72d212c222130629b5
2022-08-23 15:37:21 -07:00
Yixiao Luo
7c22a89d1d Add OWNERS file to TV Input HAL
Bug: 227673740
Test: N/A
Change-Id: I35db194e2597cdd17ecb7b15c5591fb1009e1be8
2022-08-17 18:46:14 -07:00
Frankie Lizcano
bcf4ebbbc2 Tuner HAL VTS: Dynamically Configure LnbDescrambling
This CL allows the vendor to ommit LnbDescrambling from the
configuration file. The VTS will look at the devices configured by the
vendors and automatically configure the dataflows and determine which
tests to run for LnbDescrambling.

Bug: b/240476983

Test: Test: ts-tradefed run vts --module VtsHalTvTunerTargetTest
Change-Id: I003c6405e7fcc4e3494ef976dca83b9f7d6160a6
2022-08-11 18:00:44 +00:00
Frankie Lizcano
82101d2d5b Tuner HAL VTS: Testing LnbDescrambling
This CL implements integration tests for LnbDescrambling. The new
testing function ScrambledBroadcastTestWithLnb tests the functionality
of the Lnb and, if the frontend is not software, tests passing a signal
through the tuner and descrambling a broadcast.

Additionally, this CL adds a context variable to the
ScrambledBroadcastTest function to determine which dataflow
(LnbDescrambling or Descrambling) is being tested. It specializes
behavior differently for each datflow to model real world
use cases. Notably, a Descrambler could be tested with no frontend when
playing back a descrambled recording, whereas testing an Lnb broadcast
would require a hardware frontend.

Bug: b/240476983

Test: ts-tradefed run vts --module VtsHalTvTunerTargetTest
Change-Id: Ia35d2d45dca4411b0a15f0585d6ddaecd3f9321a
2022-08-11 18:00:27 +00:00
Frankie Lizcano
523e5455fd Tuner HAL VTS: Added LnbDescrambling
This CL implements a new dataflow: LnbDescrambling, which aims to test
descrambling a broadcast brought into the tuner with an Lnb attached.
The struct for the configuration and a function to read this dataflow
from the vendor's input file were added. Additionally, the api was
updated to allow the automatic xml parser to read this new dataflow.
Note, no tests were added for this object yet. Those come later in the
chain. The vendor, at this moment, can only harcode this dataflow. It
will be dynamically configurable later in the chain.

Bug: b/240476983

Test: ts-tradefed run vts --module VtsHalTvTunerTargetTest
Change-Id: I545be7d4b2bea0b80a67fd542a80bba7fa38c4ca
2022-08-11 17:59:48 +00:00
Frankie Lizcano
8b87f25f99 Improve Tuner VTS: Generate Live Combos
This CL allows the VTS to read a vendor's configuration file, determine
if the given devices could support the Live dataflow, and generate
all combinations of units to run them on corresponding integration tests.
Each combination is error checked to ensure they meet the minumum
requirements, and any invalid ones are discared, which may narrow the
combination space immensely.

This CL also adds logic to store IP and PCR filter IDs to include
using them in any configuration combinations. We also pair PCR filters
with audio and video filters if the vendor chooses to provide more than
1, enforcing the invariant that the number of pcr, audio, and video
filters must be equal.  If there is only 1 pcr filters, we default to
use that one.

Bug: b/182519645

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest. Manual
tests with different input configuration files.

Change-Id: Icb2d96b32ed7a14b845c752a79744c44fdaf04e3
2022-08-09 23:53:26 +00:00
Frankie Lizcano
9c464f7c5c Improve Tuner VTS: Generate DVR Record Combos
This CL allows the VTS to read a vendor's configuration file, determine
if the given devices could support the DVR Record dataflow, and runs the
integration tests with all valid combinations.

2 functions were added to help drive the testing logic.
  generateRecordCombinations() generates all valid record dataflow
  configurations, and the integration tests call
  generateRecordCombinations() to analyze whether to generate these
  combinations or use the data flow provided by the vendor (if there is
  one).

Additionally, when dynamically configuring DVR_Record, a bug was exposed
in the VTS that came about from recycling the function
recordSingleFilterTest(). When LnbRecord was initialized with a software
frontend, the VTS was looking to the record dataflow's dvr source for
input. If record is not hardcoded by the vendor, the VTS would crash.

To fix this error, an enum class was added as a parameter to
RecordSingleFilterTest() to take into consideration which dataflow
(lnbRecord or record [no Lnb]) was calling the function. New behavior is
defined to take into account both cases. Also, lnbRecord will not be
tested if there are no hardware frontends, as this is not very likely to
be configured by vendors.

Bug: b/182519645

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest. Manual
tests with different input configuration files.

Change-Id: I76c05ca2e33767e4bdcd2072db5144d495d623b0
2022-08-09 20:44:31 +00:00
Frankie Lizcano
0c0695379d Improve Tuner VTS: Generate TimeFilter Combinations
This CL allows the VTS to read a vendor's configuration file, determine
if the given devices could support the TimeFilter dataflow, and generate
all combinations of units to run them on corresponding integration tests.
Additionally, the configuration file is checked to see if the vendors
provide the dataflow themselves. If not, the combinations are created.

Bug: b/182519645

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest. Manual
tests with different input configuration files.

Change-Id: Icdbf8961e9dc06fd979be953027409a0a197cba4
2022-08-04 19:23:58 +00:00
Frankie Lizcano
14aa8484b7 Tuner VTS: Pair Audio and Video Filters
This CL enforces the invariant that vendors provide audio and video
filters in pairs to the Tuner Hal VTS. Thus, the number of each must be
equal. If they do not, the tests are not
ran, and the test suite exits.

Additionally, this CL enforces the assupmtion that vendors will pair
their audio and video filters in the order they are provided, and it
treats the audioFilterIds and videoFilterIds vectors as 2 parallel
structures, where members at the same indicies correspond to a pair.
This is how media filter pairs are chosen when configuring them in the
VTS testing combinations.

Bug: b/182519645

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest. Manual
    tests with different input configuration files.
Change-Id: I74cc059ed610bb08d0929f250f252a16c9f954a8
2022-08-04 19:17:18 +00:00
Frankie Lizcano
d1f520e595 Tuner HAL VTS: LnbLive Test Fix
This CL checks to see if the frontends given in the LnbLive dataflow are
accompanied by a software frontend. If so, these tests are not ran,
because this does not model a real world use case that would be
intentionally configured by a vendor.

Furthermore, the implemented code fixes a bug that would cause the VTS
to crash if the LnbLive tests were ran using a software frontend without
the vendor having configred the Live dataflow. Previously, the
workaround for using a software frontend with an Lnb was to use the dvr
source configured in the live dataflow to simulate input to the frontend.
Now that vendors do not need to provide this in their configuration file
(because it will be automatically generated for them), this access causes
an error that makes the VTS crash. With this new fix, this logic will never be
exectuted, and the VTS will not crash in this case.

Bug: b/240305035

Test: Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest.
Change-Id: I68dc7ff4cfd103a51e3e8d7c6ff787d349a9e241
2022-07-29 18:21:38 +00:00
Frankie Lizcano
8742181688 Tuner HAL VTS: Fix Memory Leak
This CL fixes an issue on the Tuner HAL VTS that lead to a memory leak.
Heap space was allocated to store Lnb Id's for dataflows without being
cleaned using Free(). The fix includes switching to the use of an
integer passed by reference. No heap memory is allocated.

Bug: b/240572001

Test: Test: ts-tradefed run vts --module VtsHalTvTunerTargetTest
Change-Id: I9fcad4c05f548ee4b64cfb34175f34834eec6c56
2022-07-28 17:47:17 +00:00
Frankie Lizcano
81dcde82a8 Merge changes Ic1b9dae6,I470d5931,Ic6756e28,Iba526237,I8e8be258
* changes:
  Improve Tuner VTS: Generate Descrambling Combos
  Improve Tuner VTS: Generate LnbRecord Combos
  Improve Tuner VTS: Generate Scan Combos
  Improve Tuner VTS: Generate LnbLive Combos
  Improve Tuner VTS: Generate DVR Playback Combos
2022-07-25 23:50:44 +00:00
Frankie Lizcano
1c8ba7b8f3 Merge "Improve Tuner VTS: Add DVBS Settings" 2022-07-25 20:38:11 +00:00
Lucas Gates
e1bafc9bc0 Merge "TunerHAL Fix filterDispatcher returning false" 2022-07-25 17:50:42 +00:00
Frankie Lizcano
42caff499e Improve Tuner VTS: Add DVBS Settings
This CL expands the settings and specs that can be added by vendors to
DVBS frontend types. It also updates the value expectations to model the
format present in the other types.

Bug: b/239968750

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest
Change-Id: Ifd4a97ce71cfea11e4f5c1293a6342e337cb5699
2022-07-22 20:33:23 +00:00
Frankie Lizcano
d2c09c4703 Improve VTS: Allow Extra Filters for Live and Playback
This CL allows vendors to specify extra filters they would like to
include in the Live dataflow. Note, however, that these filters are not
included in any integration tests yet, as those will come later.

Additionally, this CL cleans up the code originally used to configure
extra filters for DVR playback. It converts the code and API strucutre
to a uniform format consistent with that of other dataflows that allow
extra filters.

Bug: b/239751563

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest
Change-Id: I662814666873254eff84791b5057da1f44f5e73e
2022-07-21 00:02:35 +00:00
Lucas Gates
11afa26d34 TunerHAL Fix filterDispatcher returning false
The Dvr::startFilterDispatcher method is intended to
call the startFilterHandler method on every filter by using
pass through methods in the Demux. However, the method
currently returns early with a failure (false return value)
whenever isVirtualFrontend and isRecording are both false.
This causes the thread that the method is called from to
immediately log and exit.

This error occurs when the Dvr::startFilterDispatcher
method is called from the Dvr threadloop, but not when it
is called from the Demux threadloop due to their different
parameters. As noted by current bug 239731089, this means
that this error is only exhibited inconsistently due to
a race condition.

Bug: 237718541
Test: Manually using Cuttlefish, as well as VTS. Previous
inconsistent Dvr filtering errors no longer occur.

Change-Id: I677b66bdc0dacf1a7d57bcbd3085ffd6475547dd
2022-07-20 23:56:58 +00:00
Frankie Lizcano
f4e0796ef3 Improve Tuner VTS: Generate Descrambling Combos
This CL allows the VTS to read a vendor's configuration file, determine
if the given devices could support the Descrambling dataflow, and generate
all combinations of units to run them on corresponding integration tests.
Each combination is error checked to ensure they meet the minumum
requirements, and any invalid ones are discared, which may narrow the
combination space immensely.

Bug: b/182519645

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest. Manual
tests with different input configuration files.

Change-Id: Ic1b9dae6b43f8f01bc4e490ef9e910a933562bd2
2022-07-19 20:35:09 +00:00
Frankie Lizcano
ecba02ae0e Improve Tuner VTS: Generate LnbRecord Combos
This CL allows the VTS to read a vendor's configuration file, determine
if the given devices could support the LnbRecord dataflow, and generate
all combinations of units (frontend, record filter, dvr, lnb)
to run them on corresponding integration tests.

Bug: b/182519645

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest. Manual
tests with different input configuration files.

Change-Id: I470d593195d3f6e81cea9758b5758ec47ad3d21c
2022-07-19 20:33:13 +00:00
Frankie Lizcano
3138d6b7ea Improve Tuner VTS: Generate Scan Combos
This CL allows the VTS to read a vendor's configuration file, determine
if the given devices could support the Scan dataflow, and runs the
integration tests with all valid frontends.

Bug: b/182519645

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest. Manual
tests with different input configuration files.

Change-Id: Ic6756e284090fbd1961a9ed12c1a4b541fb834b8
2022-07-19 20:32:52 +00:00
Frankie Lizcano
1e283b3864 Improve Tuner VTS: Generate LnbLive Combos
This CL allows the VTS to read a vendor's configuration file, determine
if the given devices could support the Lnb Live dataflow, and generate
all combinations of units to run them on corresponding integration tests.

Bug: b/182519645

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest. Manual
tests with different input configuration files.

Change-Id: Iba5262375b3053e0093f91fd3b05a9ebd42ca7d0
2022-07-19 20:31:50 +00:00
Frankie Lizcano
a53f554ca8 Improve Tuner VTS: Generate DVR Playback Combos
This CL allows the VTS to read a vendor's configuration file, determine
if the given devices could support the playback dataflow, and generate
all combinations of units (dvr, audio filter, video filter, section
filters) to run them on corresponding integration tests.

Additionally, began storing section filter id's and eliminated the check
to see if they were stored already by utilizing the TearDown() function
between integration tests.

Bug: b/182519645

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest. Manual
tests with different input configuration files.

Change-Id: I8e8be258dce9927e755f9c8bdb41441f367a196b
2022-07-19 20:31:22 +00:00
Frankie Lizcano
349ad5394a Merge "Improve Tuner VTS Configuration: Dynamically determine possible dataflows" 2022-07-18 21:25:21 +00:00
Frankie Lizcano
5b29f50944 Improve Tuner VTS Configuration: Dynamically determine possible
dataflows

This CL allows the VTS to read the contents of vendors'
configuration files and determine which dataflows can be tested
depending on the devices provided. This only implements the logic of
determining which data flows are possible. Currently, the data flow
section of the configuration file is still being read, and
configurations are not being cycled yet. Additionally, TearDown() was
overidden for each testing class.

Bug: b/182519645

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest
Change-Id: Ib3b3c4de62e6556ef44b42e855a369a5015d66ff
2022-07-18 14:57:21 +00:00
Lucas Gates
de9709a03e TunerHAL Handle PES Header in MediaFilterHandler
As according to the ISO/IEC 13818-1 specification, media
data in TransportStreams comes in PES packets which are
made up of TS packets. Currently, the MediaFilterHandler
strips out TS Headers, but leaves the PES headers in with
the Media data. This CL has the MediaFilterHandler process
and remove the PES Header from the Media data, while saving
the Presentation Time Stamp if it exists.

Bug: 238889790
Test: Manually using Cuttlefish and SampleTunerTIS to
receive events. Also tested on the VTS.

Change-Id: Idd4fe06f15f5420afd0c473128d8b30f5ca779c6
2022-07-13 17:47:12 +00:00
Lucas Gates
0c96e67ed5 Merge "TunerHAL Fix bug in TS Size Read" 2022-07-12 23:50:18 +00:00
Lucas Gates
9f8a9dd4b0 TunerHAL Fix bug in TS Size Read
Previously in CL 19152256 the size variables for Pes and
Section event reading were made unsigned in order to
prevent negative values. However, the conversion from
int8_t directly to uint32_t still produces incorrect values.
To solve this, the values which are read in are first
converted from int8_t to uint8_t before their final
conversion.

Bug: 238797416
Test: Run on Cuttlefish with TS input, and view logging.
Old version should not work with any TS that declares a
size containing any byte with value > 0x80.

Change-Id: I55bb552bc857fd8acf16729f8cfcb9e147e07e9c
2022-07-12 22:06:01 +00:00
Lucas Gates
9e4ced71f3 Tuner HAL Fix bug allowing only one MediaEvent
Currently, our startMediaFilterHandler returns on the first
time it successfully creates a MediaEvent. This does not
match the intended behavior, which is that all of its
current output is read and turned into events, and then
cleared.

Bug: 238797398
Test: Manually with Cuttlefish and SampleTunerTvInput.
Before change, any input type except ES will only create a
single MediaEvent. After change, full input will be handled
properly.

Change-Id: I856385cdf8ebb3a7d3fb0f864085123ec6c172b9
2022-07-12 21:38:22 +00:00
Lucas Gates
dcac96de6b Merge "SampleTunerTIS HAL Process TS for SectionEvents" 2022-07-07 20:40:21 +00:00
Lucas Gates
37e509716f SampleTunerTIS HAL Process TS for SectionEvents
Currently, the HAL simply sends raw TS data when
SectionEvents are created from a TS file. This CL
will have the HAL process the TS packets and construct
sections to be sent to the SectionFilter. A slight-modified
TS protocol is used that mirrors the current implementation
for PES filters.

This CL is a replication of reverted CL 19121691.

Bug: 237323181
Test: Manually using cuttlefish and the SampleTunerTvInput.
SectionEvents should be received without the 4-byte
TsHeader or any trailing data.

Change-Id: I48de90c9674fb69ecf877359f89f6b4f7f3eaca7
2022-07-06 21:50:31 +00:00
William Escande
04d16e124a Merge "Revert "SampleTunerTIS HAL Process TS for SectionEvents"" 2022-07-06 20:51:24 +00:00
William Escande
969c14ddd6 Revert "SampleTunerTIS HAL Process TS for SectionEvents"
This reverts commit 4a95c710b3.

Reason for revert: b/238230620

Change-Id: I6021b2e33d0cfa91706e2c382d92bca4032f0cb4
2022-07-06 20:41:19 +00:00
Lucas Gates
0babc2e472 Merge "SampleTunerTIS HAL Process TS for SectionEvents" 2022-07-06 20:22:02 +00:00
Lucas Gates
8c86315f4a Merge "Tuner Default HAL Fix bug in TS size calculation" 2022-07-06 18:45:47 +00:00
Lucas Gates
279d2aa794 Tuner Default HAL Fix bug in TS size calculation
The variable mPesSizeLeft is sometimes being set to a negative value
when it reads from TS data because of conversions from our int8_t vector. This is incorrect, as these sizes are defined to always be positive. Our vectors cannot easily be changed due to our AIDL interfaces, but the SizeLeft variable can be made unsigned to fix the issue.

Bug: 237819905
Test: Manually with cuttlefish and TS input to the DVR with
large values for size bytes. Can also manually test the
result of similar C++ expression to show the behavior.

Change-Id: Iae925cc3c505891b732434fb7c3ffadf7af95411
2022-07-06 17:10:52 +00:00
Lucas Gates
4a95c710b3 SampleTunerTIS HAL Process TS for SectionEvents
Currently, the HAL simply sends raw TS data when
SectionEvents are created from a TS file. This CL
will have the HAL process the TS packets and construct
sections to be sent to the SectionFilter. A slight-modified
TS protocol is used that mirrors the current implementation
for PES filters.

Bug: 237323181
Test: Manually using cuttlefish and the SampleTunerTvInput.
SectionEvents should be received without the 4-byte
TsHeader or any trailing data.

Change-Id: Ief6b9beb8f48bda1b83a0bffb83698ca431b7b12
2022-07-06 17:07:06 +00:00
Frankie Lizcano
7fa68f5141 Merge changes Ie7733750,I4f733091,Iaa216876
* changes:
  Improve Tuner VTS Configuration
  Improve Tuner VTS Configuration: Enable Lnb, LnbRecord, and LnbLive configuration
  Improve Tuner VTS Configuration: Enable Descrambling
2022-07-02 00:06:38 +00:00
Frankie Lizcano
5046193cd3 Improve Tuner VTS Configuration
This CL allows vendors to configure the DVR Playback data flow in their
configuration files for the Tuner Hardware. Their connections were
checked to ensure their validity. Additionally, vendors can now give an
extra list of optional filters that can be utilized in the DVR Playback data flow.

Bug: b/182519645

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest
Change-Id: Ie77337508444672e327ac88a91e73c96bd80fb22
2022-07-01 21:35:16 +00:00
Frankie Lizcano
647d5aa84c Improve Tuner VTS Configuration: Enable Lnb, LnbRecord, and
LnbLive configuration

This CL allows vendors to configure Lnb's in their configuration
files. Also, support for the LnbRecord and LnbLive data flows was
implemented. Their connections were checked to ensure their validity.
Additionally, the option to configure extra filters for each was added.

Bug: b/182519645

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest
Change-Id: I4f733091beb70e7f5658fb5572064f4628bbbfc3
2022-07-01 21:29:33 +00:00
Frankie Lizcano
f535212b77 Improve Tuner VTS Configuration: Enable Descrambling
This CL allows vendors to configure the Descrambling data flow in their
configuration files for the Tuner Hardware. Their connections were
checked to ensure their validity. Additionally, vendors can now give an
extra list of optional filters that can be utilized in the data flow.

Bug: b/182519645

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest
Change-Id: Iaa216876307571afa3ae6baf4624d0da14657439
2022-07-01 21:26:12 +00:00