@@ -145,6 +145,7 @@ static void print_usage(char *executable)
145145 printf ("%s -i in.txt -o out.txt -t test.tplg " , executable );
146146 printf ("-r 48000 -R 96000 -c 2" );
147147 printf ("-b S16_LE -a vol=libsof_volume.so\n" );
148+ printf ("-C number of copy() iterations\n" );
148149}
149150
150151/* free components */
@@ -175,7 +176,7 @@ static void parse_input_args(int argc, char **argv, struct testbench_prm *tp)
175176 int option = 0 ;
176177 int ret = 0 ;
177178
178- while ((option = getopt (argc , argv , "hdi:o:t:b:a:r:R:c:" )) != -1 ) {
179+ while ((option = getopt (argc , argv , "hdi:o:t:b:a:r:R:c:C: " )) != -1 ) {
179180 switch (option ) {
180181 /* input sample file */
181182 case 'i' :
@@ -223,6 +224,12 @@ static void parse_input_args(int argc, char **argv, struct testbench_prm *tp)
223224 debug = 1 ;
224225 break ;
225226
227+ /* number of pipeline copy() iterations */
228+ case 'C' :
229+ tp -> copy_iterations = atoi (optarg );
230+ tp -> copy_check = true;
231+ break ;
232+
226233 /* print usage */
227234 default :
228235 fprintf (stderr , "unknown option %c\n" , option );
@@ -262,6 +269,7 @@ int main(int argc, char **argv)
262269 tp .output_file_num = 0 ;
263270 tp .channels = TESTBENCH_NCH ;
264271 tp .max_pipeline_id = 0 ;
272+ tp .copy_check = false;
265273
266274 /* command line arguments*/
267275 parse_input_args (argc , argv , & tp );
@@ -358,9 +366,15 @@ int main(int argc, char **argv)
358366 pipeline_schedule_copy (curr_p , 0 );
359367 }
360368 }
369+
370+ /* are we bailing out after a fixed number of iterations ? */
371+ if (tp .copy_check ) {
372+ if (-- tp .copy_iterations == 0 )
373+ break ;
374+ }
361375 }
362376
363- if (!frcd -> fs .reached_eof )
377+ if (!frcd -> fs .reached_eof && ! tp . copy_check )
364378 printf ("warning: possible pipeline xrun\n" );
365379
366380 /* reset and free pipeline */
0 commit comments