• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #define LOG_TAG "VtsHalDownmixTargetTest"
18 #include <android-base/logging.h>
19 
20 #include <audio_utils/ChannelMix.h>
21 #include "EffectHelper.h"
22 
23 using namespace android;
24 
25 using aidl::android::hardware::audio::common::getChannelCount;
26 using aidl::android::hardware::audio::effect::Descriptor;
27 using aidl::android::hardware::audio::effect::Downmix;
28 using aidl::android::hardware::audio::effect::getEffectTypeUuidDownmix;
29 using aidl::android::hardware::audio::effect::IEffect;
30 using aidl::android::hardware::audio::effect::IFactory;
31 using aidl::android::hardware::audio::effect::Parameter;
32 using android::audio_utils::channels::ChannelMix;
33 using android::hardware::audio::common::testing::detail::TestExecutionTracer;
34 
35 // minimal HAL interface version to run downmix data path test
36 constexpr int32_t kMinDataTestHalVersion = 2;
37 
38 // Testing for enum values
39 static const std::vector<Downmix::Type> kTypeValues = {ndk::enum_range<Downmix::Type>().begin(),
40                                                        ndk::enum_range<Downmix::Type>().end()};
41 
42 // Testing for supported layouts from AudioChannelLayout.h
43 static const std::vector<int32_t> kLayoutValues = {
44         AudioChannelLayout::LAYOUT_STEREO,        AudioChannelLayout::LAYOUT_2POINT1,
45         AudioChannelLayout::LAYOUT_TRI,           AudioChannelLayout::LAYOUT_TRI_BACK,
46         AudioChannelLayout::LAYOUT_3POINT1,       AudioChannelLayout::LAYOUT_2POINT0POINT2,
47         AudioChannelLayout::LAYOUT_2POINT1POINT2, AudioChannelLayout::LAYOUT_3POINT0POINT2,
48         AudioChannelLayout::LAYOUT_3POINT1POINT2, AudioChannelLayout::LAYOUT_QUAD,
49         AudioChannelLayout::LAYOUT_QUAD_SIDE,     AudioChannelLayout::LAYOUT_SURROUND,
50         AudioChannelLayout::LAYOUT_PENTA,         AudioChannelLayout::LAYOUT_5POINT1,
51         AudioChannelLayout::LAYOUT_5POINT1_SIDE,  AudioChannelLayout::LAYOUT_5POINT1POINT2,
52         AudioChannelLayout::LAYOUT_5POINT1POINT4, AudioChannelLayout::LAYOUT_6POINT1,
53         AudioChannelLayout::LAYOUT_7POINT1,       AudioChannelLayout::LAYOUT_7POINT1POINT2,
54         AudioChannelLayout::LAYOUT_7POINT1POINT4, AudioChannelLayout::LAYOUT_9POINT1POINT4,
55         AudioChannelLayout::LAYOUT_9POINT1POINT6, AudioChannelLayout::LAYOUT_13POINT0,
56         AudioChannelLayout::LAYOUT_22POINT2};
57 
58 static const std::vector<int32_t> kChannels = {
59         AudioChannelLayout::CHANNEL_FRONT_LEFT,
60         AudioChannelLayout::CHANNEL_FRONT_RIGHT,
61         AudioChannelLayout::CHANNEL_FRONT_CENTER,
62         AudioChannelLayout::CHANNEL_LOW_FREQUENCY,
63         AudioChannelLayout::CHANNEL_BACK_LEFT,
64         AudioChannelLayout::CHANNEL_BACK_RIGHT,
65         AudioChannelLayout::CHANNEL_BACK_CENTER,
66         AudioChannelLayout::CHANNEL_SIDE_LEFT,
67         AudioChannelLayout::CHANNEL_SIDE_RIGHT,
68         AudioChannelLayout::CHANNEL_FRONT_LEFT_OF_CENTER,
69         AudioChannelLayout::CHANNEL_FRONT_RIGHT_OF_CENTER,
70         AudioChannelLayout::CHANNEL_TOP_CENTER,
71         AudioChannelLayout::CHANNEL_TOP_FRONT_LEFT,
72         AudioChannelLayout::CHANNEL_TOP_FRONT_CENTER,
73         AudioChannelLayout::CHANNEL_TOP_FRONT_RIGHT,
74         AudioChannelLayout::CHANNEL_TOP_BACK_LEFT,
75         AudioChannelLayout::CHANNEL_TOP_BACK_CENTER,
76         AudioChannelLayout::CHANNEL_TOP_BACK_RIGHT,
77         AudioChannelLayout::CHANNEL_TOP_SIDE_LEFT,
78         AudioChannelLayout::CHANNEL_TOP_SIDE_RIGHT,
79         AudioChannelLayout::CHANNEL_BOTTOM_FRONT_LEFT,
80         AudioChannelLayout::CHANNEL_BOTTOM_FRONT_CENTER,
81         AudioChannelLayout::CHANNEL_BOTTOM_FRONT_RIGHT,
82         AudioChannelLayout::CHANNEL_LOW_FREQUENCY_2,
83         AudioChannelLayout::CHANNEL_FRONT_WIDE_LEFT,
84         AudioChannelLayout::CHANNEL_FRONT_WIDE_RIGHT,
85 };
86 
87 class DownmixEffectHelper : public EffectHelper {
88   public:
SetUpDownmix(int32_t inputBufferLayout=kDefaultChannelLayout)89     void SetUpDownmix(int32_t inputBufferLayout = kDefaultChannelLayout) {
90         ASSERT_NE(nullptr, mFactory);
91         ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
92 
93         AudioChannelLayout inputChannelLayout =
94                 AudioChannelLayout::make<AudioChannelLayout::layoutMask>(inputBufferLayout);
95 
96         Parameter::Specific specific = getDefaultParamSpecific();
97         Parameter::Common common = EffectHelper::createParamCommon(
98                 0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */,
99                 kFrameCount /* iFrameCount */, kFrameCount /* oFrameCount */, inputChannelLayout,
100                 AudioChannelLayout::make<AudioChannelLayout::layoutMask>(
101                         AudioChannelLayout::LAYOUT_STEREO));
102         ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &mOpenEffectReturn, EX_NONE));
103         ASSERT_NE(nullptr, mEffect);
104     }
105 
TearDownDownmix()106     void TearDownDownmix() {
107         ASSERT_NO_FATAL_FAILURE(close(mEffect));
108         ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
109         mOpenEffectReturn = IEffect::OpenEffectReturn{};
110     }
111 
createDownmixParam(Downmix::Type type)112     Parameter createDownmixParam(Downmix::Type type) {
113         return Parameter::make<Parameter::specific>(
114                 Parameter::Specific::make<Parameter::Specific::downmix>(
115                         Downmix::make<Downmix::type>(type)));
116     }
setParameters(Downmix::Type type)117     void setParameters(Downmix::Type type) {
118         // set parameter
119         auto param = createDownmixParam(type);
120         EXPECT_STATUS(EX_NONE, mEffect->setParameter(param)) << param.toString();
121     }
122 
validateParameters(Downmix::Type type)123     void validateParameters(Downmix::Type type) {
124         auto leId = Downmix::Id::make<Downmix::Id::commonTag>(Downmix::Tag(Downmix::type));
125         auto id = Parameter::Id::make<Parameter::Id::downmixTag>(leId);
126         // get parameter
127         Parameter getParam;
128         EXPECT_STATUS(EX_NONE, mEffect->getParameter(id, &getParam));
129         auto expectedParam = createDownmixParam(type);
130         EXPECT_EQ(expectedParam, getParam) << "\nexpectedParam:" << expectedParam.toString()
131                                            << "\ngetParam:" << getParam.toString();
132     }
133 
getDefaultParamSpecific()134     Parameter::Specific getDefaultParamSpecific() {
135         Downmix dm = Downmix::make<Downmix::type>(Downmix::Type::STRIP);
136         Parameter::Specific specific = Parameter::Specific::make<Parameter::Specific::downmix>(dm);
137         return specific;
138     }
139 
setDataTestParams(int32_t layoutType)140     void setDataTestParams(int32_t layoutType) {
141         // Get the number of channels used
142         mInputChannelCount = getChannelCount(
143                 AudioChannelLayout::make<AudioChannelLayout::layoutMask>(layoutType));
144         mInputBufferSize = kFrameCount * mInputChannelCount;
145         mInputBuffer.resize(mInputBufferSize);
146 
147         // In case of downmix, output is always configured to stereo layout.
148         mOutputBufferSize = kFrameCount * kOutputChannelCount;
149         mOutputBuffer.resize(mOutputBufferSize);
150     }
151 
isLayoutValid(int32_t inputLayout)152     bool isLayoutValid(int32_t inputLayout) {
153         if (inputLayout & kMaxChannelMask) {
154             return false;
155         }
156         return true;
157     }
158 
159     static const long kFrameCount = 256;
160     static constexpr float kMaxDownmixSample = 1;
161     static constexpr int kOutputChannelCount = 2;
162     // Mask for layouts greater than MAX_INPUT_CHANNELS_SUPPORTED
163     static constexpr int32_t kMaxChannelMask =
164             ~((1 << ChannelMix<AUDIO_CHANNEL_OUT_STEREO>::MAX_INPUT_CHANNELS_SUPPORTED) - 1);
165     std::shared_ptr<IFactory> mFactory;
166     Descriptor mDescriptor;
167     std::shared_ptr<IEffect> mEffect;
168     IEffect::OpenEffectReturn mOpenEffectReturn;
169 
170     std::vector<float> mInputBuffer;
171     std::vector<float> mOutputBuffer;
172     size_t mInputChannelCount;
173     size_t mOutputBufferSize;
174     size_t mInputBufferSize;
175 };
176 
177 /**
178  * Here we focus on specific parameter checking, general IEffect interfaces testing performed in
179  * VtsAudioEffectTargetTest.
180  */
181 enum ParamName { PARAM_INSTANCE_NAME, PARAM_TYPE };
182 
183 using DownmixParamTestParam =
184         std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, Downmix::Type>;
185 
186 class DownmixParamTest : public ::testing::TestWithParam<DownmixParamTestParam>,
187                          public DownmixEffectHelper {
188   public:
DownmixParamTest()189     DownmixParamTest() : mParamType(std::get<PARAM_TYPE>(GetParam())) {
190         std::tie(mFactory, mDescriptor) = std::get<PARAM_INSTANCE_NAME>(GetParam());
191     }
192 
SetUp()193     void SetUp() override { ASSERT_NO_FATAL_FAILURE(SetUpDownmix()); }
194 
TearDown()195     void TearDown() override { TearDownDownmix(); }
196 
197     const Downmix::Type mParamType;
198 };
199 
TEST_P(DownmixParamTest,SetAndGetType)200 TEST_P(DownmixParamTest, SetAndGetType) {
201     ASSERT_NO_FATAL_FAILURE(setParameters(mParamType));
202     ASSERT_NO_FATAL_FAILURE(validateParameters(mParamType));
203 }
204 
205 enum FoldParamName { FOLD_INSTANCE_NAME, FOLD_INPUT_LAYOUT, FOLD_TEST_CHANNEL };
206 
207 using DownmixDataTestParamFold =
208         std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t>;
209 
210 class DownmixFoldDataTest : public ::testing::TestWithParam<DownmixDataTestParamFold>,
211                             public DownmixEffectHelper {
212   public:
DownmixFoldDataTest()213     DownmixFoldDataTest() : mInputChannelLayout(std::get<FOLD_INPUT_LAYOUT>(GetParam())) {
214         std::tie(mFactory, mDescriptor) = std::get<FOLD_INSTANCE_NAME>(GetParam());
215     }
216 
SetUp()217     void SetUp() override {
218         SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
219         ASSERT_NO_FATAL_FAILURE(SetUpDownmix(mInputChannelLayout));
220         SKIP_TEST_IF_VERSION_UNSUPPORTED(mEffect, kMinDataTestHalVersion);
221         if (!isLayoutValid(mInputChannelLayout)) {
222             GTEST_SKIP() << "Layout not supported \n";
223         }
224         setDataTestParams(mInputChannelLayout);
225     }
226 
TearDown()227     void TearDown() override {
228         SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
229         TearDownDownmix();
230     }
231 
checkAtLeft(int32_t position)232     void checkAtLeft(int32_t position) {
233         for (size_t i = 0, j = position; i < mOutputBufferSize;
234              i += kOutputChannelCount, j += mInputChannelCount) {
235             // Validate Left channel has audio
236             if (mInputBuffer[j] != 0) {
237                 ASSERT_NE(mOutputBuffer[i], 0);
238             } else {
239                 // No change in output when input is 0
240                 ASSERT_EQ(mOutputBuffer[i], mInputBuffer[j]);
241             }
242             // Validate Right channel has no audio
243             ASSERT_EQ(mOutputBuffer[i + 1], 0);
244         }
245     }
246 
checkAtRight(int32_t position)247     void checkAtRight(int32_t position) {
248         for (size_t i = 0, j = position; i < mOutputBufferSize;
249              i += kOutputChannelCount, j += mInputChannelCount) {
250             // Validate Left channel has no audio
251             ASSERT_EQ(mOutputBuffer[i], 0) << " at " << i;
252             // Validate Right channel has audio
253             if (mInputBuffer[j] != 0) {
254                 ASSERT_NE(mOutputBuffer[i + 1], 0) << " at " << i;
255             } else {
256                 // No change in output when input is 0
257                 ASSERT_EQ(mOutputBuffer[i + 1], mInputBuffer[j]) << " at " << i;
258             }
259         }
260     }
261 
checkAtCenter(size_t position)262     void checkAtCenter(size_t position) {
263         for (size_t i = 0, j = position; i < mOutputBufferSize;
264              i += kOutputChannelCount, j += mInputChannelCount) {
265             // Validate both channels have audio
266             if (mInputBuffer[j] != 0) {
267                 ASSERT_NE(mOutputBuffer[i], 0);
268                 ASSERT_NE(mOutputBuffer[i + 1], 0);
269 
270             } else {
271                 // No change in output when input is 0
272                 ASSERT_EQ(mOutputBuffer[i], mInputBuffer[j]);
273                 ASSERT_EQ(mOutputBuffer[i + 1], mInputBuffer[j]);
274             }
275         }
276     }
277 
validateOutput(int32_t channel,size_t position)278     void validateOutput(int32_t channel, size_t position) {
279         switch (channel) {
280             case AudioChannelLayout::CHANNEL_FRONT_LEFT:
281             case AudioChannelLayout::CHANNEL_BACK_LEFT:
282             case AudioChannelLayout::CHANNEL_SIDE_LEFT:
283             case AudioChannelLayout::CHANNEL_TOP_FRONT_LEFT:
284             case AudioChannelLayout::CHANNEL_BOTTOM_FRONT_LEFT:
285             case AudioChannelLayout::CHANNEL_TOP_BACK_LEFT:
286             case AudioChannelLayout::CHANNEL_FRONT_WIDE_LEFT:
287             case AudioChannelLayout::CHANNEL_TOP_SIDE_LEFT:
288                 ASSERT_NO_FATAL_FAILURE(checkAtLeft(position));
289                 break;
290 
291             case AudioChannelLayout::CHANNEL_FRONT_RIGHT:
292             case AudioChannelLayout::CHANNEL_BACK_RIGHT:
293             case AudioChannelLayout::CHANNEL_SIDE_RIGHT:
294             case AudioChannelLayout::CHANNEL_TOP_FRONT_RIGHT:
295             case AudioChannelLayout::CHANNEL_BOTTOM_FRONT_RIGHT:
296             case AudioChannelLayout::CHANNEL_TOP_BACK_RIGHT:
297             case AudioChannelLayout::CHANNEL_FRONT_WIDE_RIGHT:
298             case AudioChannelLayout::CHANNEL_TOP_SIDE_RIGHT:
299             case AudioChannelLayout::CHANNEL_LOW_FREQUENCY_2:
300                 ASSERT_NO_FATAL_FAILURE(checkAtRight(position));
301                 break;
302 
303             case AudioChannelLayout::CHANNEL_FRONT_CENTER:
304             case AudioChannelLayout::CHANNEL_BACK_CENTER:
305             case AudioChannelLayout::CHANNEL_TOP_FRONT_CENTER:
306             case AudioChannelLayout::CHANNEL_BOTTOM_FRONT_CENTER:
307             case AudioChannelLayout::CHANNEL_FRONT_LEFT_OF_CENTER:
308             case AudioChannelLayout::CHANNEL_FRONT_RIGHT_OF_CENTER:
309             case AudioChannelLayout::CHANNEL_TOP_CENTER:
310             case AudioChannelLayout::CHANNEL_TOP_BACK_CENTER:
311                 ASSERT_NO_FATAL_FAILURE(checkAtCenter(position));
312                 break;
313 
314             case AudioChannelLayout::CHANNEL_LOW_FREQUENCY:
315                 // If CHANNEL_LOW_FREQUENCY_2 is supported
316                 if (mInputChannelLayout & AudioChannelLayout::CHANNEL_LOW_FREQUENCY_2) {
317                     // Validate that only Left channel has audio
318                     ASSERT_NO_FATAL_FAILURE(checkAtLeft(position));
319                 } else {
320                     // Validate that both channels have audio
321                     ASSERT_NO_FATAL_FAILURE(checkAtCenter(position));
322                 }
323                 break;
324         }
325     }
326 
getInputChannelLayouts()327     std::set<int32_t> getInputChannelLayouts() {
328         std::set<int32_t> supportedChannels;
329         for (int32_t channel : kChannels) {
330             if ((mInputChannelLayout & channel) == channel) {
331                 supportedChannels.insert(channel);
332             }
333         }
334         return supportedChannels;
335     }
336 
337     int32_t mInputChannelLayout;
338 };
339 
TEST_P(DownmixFoldDataTest,DownmixProcessData)340 TEST_P(DownmixFoldDataTest, DownmixProcessData) {
341     // Set FOLD type parameter
342     ASSERT_NO_FATAL_FAILURE(setParameters(Downmix::Type::FOLD));
343 
344     // Get all the channels from input layout
345     std::set<int32_t> supportedChannels = getInputChannelLayouts();
346 
347     for (int32_t channel : supportedChannels) {
348         size_t position = std::distance(supportedChannels.begin(), supportedChannels.find(channel));
349         generateInputBuffer(mInputBuffer, position, false /*isStripe*/,
350                             mInputChannelCount /*channelCount*/, kMaxDownmixSample);
351         ASSERT_NO_FATAL_FAILURE(
352                 processAndWriteToOutput(mInputBuffer, mOutputBuffer, mEffect, &mOpenEffectReturn));
353         validateOutput(channel, position);
354         std::fill(mInputBuffer.begin(), mInputBuffer.end(), 0);
355     }
356 }
357 
358 enum StripParamName { STRIP_INSTANCE_NAME, STRIP_INPUT_LAYOUT };
359 
360 using DownmixStripDataTestParam =
361         std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t>;
362 
363 class DownmixStripDataTest : public ::testing::TestWithParam<DownmixStripDataTestParam>,
364                              public DownmixEffectHelper {
365   public:
DownmixStripDataTest()366     DownmixStripDataTest() : mInputChannelLayout(std::get<STRIP_INPUT_LAYOUT>(GetParam())) {
367         std::tie(mFactory, mDescriptor) = std::get<STRIP_INSTANCE_NAME>(GetParam());
368     }
369 
SetUp()370     void SetUp() override {
371         ASSERT_NO_FATAL_FAILURE(SetUpDownmix(mInputChannelLayout));
372         SKIP_TEST_IF_VERSION_UNSUPPORTED(mEffect, kMinDataTestHalVersion);
373         if (!isLayoutValid(mInputChannelLayout)) {
374             GTEST_SKIP() << "Layout not supported \n";
375         }
376         setDataTestParams(mInputChannelLayout);
377     }
378 
TearDown()379     void TearDown() override { TearDownDownmix(); }
380 
validateOutput()381     void validateOutput() {
382         ASSERT_EQ(mInputBufferSize, mInputBuffer.size());
383         ASSERT_GE(mInputBufferSize, mOutputBufferSize);
384         for (size_t i = 0, j = 0; i < mInputBufferSize && j < mOutputBufferSize;
385              i += mInputChannelCount, j += kOutputChannelCount) {
386             ASSERT_EQ(mOutputBuffer[j], mInputBuffer[i]);
387             ASSERT_EQ(mOutputBuffer[j + 1], mInputBuffer[i + 1]);
388         }
389     }
390 
391     int32_t mInputChannelLayout;
392 };
393 
TEST_P(DownmixStripDataTest,DownmixProcessData)394 TEST_P(DownmixStripDataTest, DownmixProcessData) {
395     // Set STRIP type parameter
396     ASSERT_NO_FATAL_FAILURE(setParameters(Downmix::Type::STRIP));
397 
398     // Generate input buffer, call process and compare outputs
399     generateInputBuffer(mInputBuffer, 0 /*position*/, true /*isStripe*/,
400                         mInputChannelCount /*channelCount*/, kMaxDownmixSample);
401     ASSERT_NO_FATAL_FAILURE(
402             processAndWriteToOutput(mInputBuffer, mOutputBuffer, mEffect, &mOpenEffectReturn));
403     ASSERT_NO_FATAL_FAILURE(validateOutput());
404 }
405 
406 INSTANTIATE_TEST_SUITE_P(
407         DownmixTest, DownmixParamTest,
408         ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
409                                    IFactory::descriptor, getEffectTypeUuidDownmix())),
410                            testing::ValuesIn(kTypeValues)),
__anon3c97c98b0102(const testing::TestParamInfo<DownmixParamTest::ParamType>& info) 411         [](const testing::TestParamInfo<DownmixParamTest::ParamType>& info) {
412             auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
413             std::string type = std::to_string(static_cast<int>(std::get<PARAM_TYPE>(info.param)));
414             std::string name = getPrefix(descriptor) + "_type_" + type;
415             std::replace_if(
416                     name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
417             return name;
418         });
419 
420 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DownmixParamTest);
421 
422 INSTANTIATE_TEST_SUITE_P(
423         DownmixTest, DownmixFoldDataTest,
424         ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
425                                    IFactory::descriptor, getEffectTypeUuidDownmix())),
426                            testing::ValuesIn(kLayoutValues)),
__anon3c97c98b0302(const testing::TestParamInfo<DownmixFoldDataTest::ParamType>& info) 427         [](const testing::TestParamInfo<DownmixFoldDataTest::ParamType>& info) {
428             auto descriptor = std::get<FOLD_INSTANCE_NAME>(info.param).second;
429             std::string layout = std::to_string(std::get<FOLD_INPUT_LAYOUT>(info.param));
430             std::string name = getPrefix(descriptor) + "_fold_layout_" + layout;
431             std::replace_if(
432                     name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
433             return name;
434         });
435 
436 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DownmixFoldDataTest);
437 
438 INSTANTIATE_TEST_SUITE_P(
439         DownmixTest, DownmixStripDataTest,
440         ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
441                                    IFactory::descriptor, getEffectTypeUuidDownmix())),
442                            testing::ValuesIn(kLayoutValues)),
__anon3c97c98b0502(const testing::TestParamInfo<DownmixStripDataTest::ParamType>& info) 443         [](const testing::TestParamInfo<DownmixStripDataTest::ParamType>& info) {
444             auto descriptor = std::get<STRIP_INSTANCE_NAME>(info.param).second;
445             std::string layout =
446                     std::to_string(static_cast<int>(std::get<STRIP_INPUT_LAYOUT>(info.param)));
447             std::string name = getPrefix(descriptor) + "_strip_layout_" + layout;
448             std::replace_if(
449                     name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
450             return name;
451         });
452 
453 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DownmixStripDataTest);
454 
main(int argc,char ** argv)455 int main(int argc, char** argv) {
456     ::testing::InitGoogleTest(&argc, argv);
457     ::testing::UnitTest::GetInstance()->listeners().Append(new TestExecutionTracer());
458     ABinderProcess_setThreadPoolMaxThreadCount(1);
459     ABinderProcess_startThreadPool();
460     return RUN_ALL_TESTS();
461 }
462