Lines Matching refs:aio

274   struct alsa_io *aio;  in TEST()  local
276 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
279 ASSERT_EQ(aio, (void *)NULL); in TEST()
283 struct alsa_io *aio; in TEST() local
287 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
290 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
293 EXPECT_EQ(SND_PCM_STREAM_PLAYBACK, aio->alsa_stream); in TEST()
297 aio->base.info.name, in TEST()
301 ASSERT_NE(reinterpret_cast<const char *>(NULL), aio->dev_name); in TEST()
302 EXPECT_EQ(0, strcmp(test_dev_name, aio->dev_name)); in TEST()
303 ASSERT_NE(reinterpret_cast<const char *>(NULL), aio->dev_id); in TEST()
304 EXPECT_EQ(0, strcmp(test_dev_id, aio->dev_id)); in TEST()
306 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
311 struct alsa_io *aio; in TEST() local
315 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
318 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
320 ASSERT_STREQ("(default)", aio->base.active_node->name); in TEST()
321 ASSERT_EQ(1, aio->base.active_node->plugged); in TEST()
322 ASSERT_EQ((void *)no_stream, (void *)aio->base.no_stream); in TEST()
323 ASSERT_EQ((void *)output_should_wake, (void *)aio->base.output_should_wake); in TEST()
324 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
326 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
329 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
331 ASSERT_STREQ("Speaker", aio->base.active_node->name); in TEST()
332 ASSERT_EQ(1, aio->base.active_node->plugged); in TEST()
333 ASSERT_EQ((void *)no_stream, (void *)aio->base.no_stream); in TEST()
334 ASSERT_EQ((void *)output_should_wake, (void *)aio->base.output_should_wake); in TEST()
335 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
337 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
340 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
343 ASSERT_STREQ("(default)", aio->base.active_node->name); in TEST()
344 ASSERT_EQ(1, aio->base.active_node->plugged); in TEST()
345 ASSERT_EQ((void *)no_stream, (void *)aio->base.no_stream); in TEST()
346 ASSERT_EQ((void *)output_should_wake, (void *)aio->base.output_should_wake); in TEST()
347 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
349 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
352 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
354 ASSERT_STREQ("Internal Mic", aio->base.active_node->name); in TEST()
355 ASSERT_EQ(1, aio->base.active_node->plugged); in TEST()
356 ASSERT_EQ((void *)no_stream, (void *)aio->base.no_stream); in TEST()
357 ASSERT_EQ((void *)output_should_wake, (void *)aio->base.output_should_wake); in TEST()
358 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
362 struct alsa_io *aio; in TEST() local
366 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
369 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
371 ASSERT_STREQ("(default)", aio->base.active_node->name); in TEST()
372 ASSERT_EQ(1, aio->base.active_node->plugged); in TEST()
376 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
378 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
381 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
383 ASSERT_STREQ("(default)", aio->base.active_node->name); in TEST()
384 ASSERT_EQ(1, aio->base.active_node->plugged); in TEST()
388 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
394 struct alsa_io *aio; in TEST() local
403 aio = (struct alsa_io *)iodev; in TEST()
409 aio->is_free_running = 1; in TEST()
410 aio->filled_zeros_for_draining = 512; in TEST()
419 EXPECT_EQ(0, aio->is_free_running); in TEST()
420 EXPECT_EQ(0, aio->filled_zeros_for_draining); in TEST()
422 aio->severe_underrun_frames); in TEST()
622 struct alsa_io *aio; in TEST() local
626 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
629 ASSERT_NE(aio, (void *)NULL); in TEST()
630 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
632 EXPECT_EQ(SND_PCM_STREAM_PLAYBACK, aio->alsa_stream); in TEST()
648 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
653 struct alsa_io *aio; in TEST() local
657 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
660 ASSERT_NE(aio, (void *)NULL); in TEST()
661 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
663 EXPECT_EQ(SND_PCM_STREAM_CAPTURE, aio->alsa_stream); in TEST()
678 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
683 struct alsa_io *aio; in TEST() local
686 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
689 ASSERT_NE(aio, (void *)NULL); in TEST()
690 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
692 EXPECT_EQ(SND_PCM_STREAM_CAPTURE, aio->alsa_stream); in TEST()
696 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
702 struct alsa_io *aio; in TEST() local
710 aio = (struct alsa_io *)iodev; in TEST()
729 aio->severe_underrun_frames); in TEST()
883 struct alsa_io *aio; in TEST() local
889 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
892 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
894 EXPECT_EQ(SND_PCM_STREAM_PLAYBACK, aio->alsa_stream); in TEST()
899 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
903 struct alsa_io *aio; in TEST() local
911 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
914 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
915 EXPECT_EQ(SND_PCM_STREAM_PLAYBACK, aio->alsa_stream); in TEST()
926 alsa_iodev_set_active_node(&aio->base, aio->base.nodes->next, 1); in TEST()
932 alsa_iodev_set_active_node(&aio->base, aio->base.nodes, 1); in TEST()
938 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
942 struct alsa_io *aio; in TEST() local
948 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
951 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
958 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
962 struct alsa_io *aio; in TEST() local
971 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
974 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
976 aio->base.set_swap_mode_for_node((cras_iodev*)aio, fake_node, 1); in TEST()
982 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
984 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
987 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
989 aio->base.set_swap_mode_for_node((cras_iodev*)aio, fake_node, 1); in TEST()
995 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
1002 struct alsa_io *aio; in TEST() local
1011 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
1014 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
1017 EXPECT_EQ(SND_PCM_STREAM_PLAYBACK, aio->alsa_stream); in TEST()
1021 rc = alsa_iodev_set_active_node((struct cras_iodev *)aio, in TEST()
1022 aio->base.nodes->next, 1); in TEST()
1036 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
1042 struct alsa_io *aio; in TEST() local
1051 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
1054 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
1056 EXPECT_EQ(SND_PCM_STREAM_PLAYBACK, aio->alsa_stream); in TEST()
1059 aio->handle = (snd_pcm_t *)0x24; in TEST()
1062 rc = alsa_iodev_set_active_node((struct cras_iodev *)aio, in TEST()
1063 aio->base.nodes->next, 1); in TEST()
1079 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
1083 struct alsa_io *aio; in TEST() local
1099 aio = reinterpret_cast<struct alsa_io *>(iodev); in TEST()
1127 jack_output_plug_event(reinterpret_cast<struct cras_alsa_jack *>(10), 0, aio); in TEST()
1130 jack_output_plug_event(reinterpret_cast<struct cras_alsa_jack *>(20), 0, aio); in TEST()
1137 struct alsa_io *aio; in TEST() local
1162 aio = reinterpret_cast<struct alsa_io *>(iodev); in TEST()
1192 jack_output_plug_event(reinterpret_cast<struct cras_alsa_jack *>(4), 0, aio); in TEST()
1197 EXPECT_EQ(SND_PCM_STREAM_PLAYBACK, aio->alsa_stream); in TEST()
1201 EXPECT_EQ(ucm_get_dma_period_for_dev_ret, aio->dma_period_set_microsecs); in TEST()
1203 aio->handle = (snd_pcm_t *)0x24; in TEST()
1206 rc = alsa_iodev_set_active_node(iodev, aio->base.nodes->next, 1); in TEST()
1224 jack_output_plug_event(reinterpret_cast<struct cras_alsa_jack *>(4), 0, aio); in TEST()
1231 struct alsa_io *aio; in TEST() local
1245 aio = reinterpret_cast<struct alsa_io *>(iodev); in TEST()
1262 EXPECT_EQ(SND_PCM_STREAM_PLAYBACK, aio->alsa_stream); in TEST()
1272 struct alsa_io *aio; in TEST() local
1287 aio = reinterpret_cast<struct alsa_io *>(iodev); in TEST()
1304 EXPECT_EQ(SND_PCM_STREAM_PLAYBACK, aio->alsa_stream); in TEST()
1314 struct alsa_io *aio; in TEST() local
1338 aio = reinterpret_cast<struct alsa_io *>(iodev); in TEST()
1365 jack_input_plug_event(reinterpret_cast<struct cras_alsa_jack *>(4), 0, aio); in TEST()
1371 jack_input_plug_event(reinterpret_cast<struct cras_alsa_jack *>(4), 0, aio); in TEST()
1376 EXPECT_EQ(SND_PCM_STREAM_CAPTURE, aio->alsa_stream); in TEST()
1383 EXPECT_EQ(0, aio->dma_period_set_microsecs); in TEST()
1385 aio->handle = (snd_pcm_t *)0x24; in TEST()
1388 rc = alsa_iodev_set_active_node(iodev, aio->base.nodes->next, 1); in TEST()
1405 struct alsa_io *aio; in TEST() local
1419 aio = reinterpret_cast<struct alsa_io *>(iodev); in TEST()
1436 EXPECT_EQ(SND_PCM_STREAM_CAPTURE, aio->alsa_stream); in TEST()
1446 struct alsa_io *aio; in TEST() local
1461 aio = reinterpret_cast<struct alsa_io *>(iodev); in TEST()
1475 EXPECT_EQ(SND_PCM_STREAM_CAPTURE, aio->alsa_stream); in TEST()
1485 struct alsa_io *aio; in TEST() local
1502 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
1506 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
1512 ASSERT_NE(aio->base.nodes, (void *)NULL); in TEST()
1513 EXPECT_EQ(aio->base.nodes->plugged, 1); in TEST()
1514 ASSERT_NE(aio->base.nodes->next, (void *)NULL); in TEST()
1515 EXPECT_EQ(aio->base.nodes->next->plugged, 0); in TEST()
1524 EXPECT_EQ(aio->base.nodes->plugged, 0); in TEST()
1525 EXPECT_EQ(aio->base.nodes->next->plugged, 1); in TEST()
1527 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
1531 struct alsa_io *aio; in TEST() local
1548 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
1551 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
1556 ASSERT_NE(aio->base.nodes, (void *)NULL); in TEST()
1557 EXPECT_EQ(aio->base.nodes->plugged, 1); in TEST()
1558 ASSERT_NE(aio->base.nodes->next, (void *)NULL); in TEST()
1559 EXPECT_EQ(aio->base.nodes->next->plugged, 0); in TEST()
1568 EXPECT_EQ(aio->base.nodes->plugged, 0); in TEST()
1569 EXPECT_EQ(aio->base.nodes->next->plugged, 1); in TEST()
1571 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
1794 struct alsa_io *aio; in TEST() local
1800 aio = (struct alsa_io *)alsa_iodev_create_with_default_parameters( in TEST()
1803 ASSERT_EQ(0, alsa_iodev_legacy_complete_init((struct cras_iodev *)aio)); in TEST()
1816 ASSERT_EQ(CRAS_NODE_TYPE_HDMI, aio->base.nodes->next->type); in TEST()
1818 ASSERT_STREQ("HDMI", aio->base.nodes->next->name); in TEST()
1820 alsa_iodev_destroy((struct cras_iodev *)aio); in TEST()
2005 memset(&aio, 0, sizeof(aio)); in SetUp()
2009 aio.base.frames_queued = frames_queued; in SetUp()
2010 aio.base.direction = CRAS_STREAM_OUTPUT; in SetUp()
2011 aio.base.format = &fmt_; in SetUp()
2012 aio.base.buffer_size = BUFFER_SIZE; in SetUp()
2013 aio.base.min_cb_level = 240; in SetUp()
2014 aio.base.min_buffer_level = 0; in SetUp()
2015 aio.filled_zeros_for_draining = 0; in SetUp()
2027 struct alsa_io aio; member in __anon0fe6506d0111::AlsaFreeRunTestSuite
2036 rc = fill_whole_buffer_with_zeros(&aio.base); in TEST_F()
2049 aio.is_free_running = 1; in TEST_F()
2051 rc = no_stream(&aio.base, 1); in TEST_F()
2069 rc = aio.base.frames_queued(&aio.base, &hw_tstamp); in TEST_F()
2072 rc = no_stream(&aio.base, 1); in TEST_F()
2078 EXPECT_EQ(280, aio.filled_zeros_for_draining); in TEST_F()
2079 EXPECT_EQ(0, aio.is_free_running); in TEST_F()
2091 rc = no_stream(&aio.base, 1); in TEST_F()
2096 EXPECT_EQ(0, aio.is_free_running); in TEST_F()
2107 aio.filled_zeros_for_draining = 100; in TEST_F()
2109 rc = no_stream(&aio.base, 1); in TEST_F()
2114 EXPECT_EQ(1, aio.is_free_running); in TEST_F()
2125 rc = no_stream(&aio.base, 1); in TEST_F()
2130 EXPECT_EQ(1, aio.is_free_running); in TEST_F()
2135 aio.is_free_running = 1; in TEST_F()
2137 EXPECT_EQ(0, output_should_wake(&aio.base)); in TEST_F()
2139 aio.is_free_running = 0; in TEST_F()
2140 aio.base.state = CRAS_IODEV_STATE_NO_STREAM_RUN; in TEST_F()
2141 EXPECT_EQ(1, output_should_wake(&aio.base)); in TEST_F()
2143 aio.base.state = CRAS_IODEV_STATE_NORMAL_RUN; in TEST_F()
2144 EXPECT_EQ(1, output_should_wake(&aio.base)); in TEST_F()
2146 aio.base.state = CRAS_IODEV_STATE_OPEN; in TEST_F()
2147 EXPECT_EQ(0, output_should_wake(&aio.base)); in TEST_F()
2156 aio.is_free_running = 0; in TEST_F()
2157 aio.filled_zeros_for_draining = 100; in TEST_F()
2158 aio.base.min_buffer_level = 512; in TEST_F()
2162 rc = no_stream(&aio.base, 0); in TEST_F()
2168 EXPECT_EQ(0, aio.is_free_running); in TEST_F()
2169 EXPECT_EQ(0, aio.filled_zeros_for_draining); in TEST_F()
2179 aio.is_free_running = 0; in TEST_F()
2180 aio.filled_zeros_for_draining = 500; in TEST_F()
2181 aio.base.min_buffer_level = 256; in TEST_F()
2185 rc = no_stream(&aio.base, 0); in TEST_F()
2189 EXPECT_EQ(aio.base.min_buffer_level + aio.base.min_cb_level, in TEST_F()
2192 EXPECT_EQ(0, aio.is_free_running); in TEST_F()
2193 EXPECT_EQ(0, aio.filled_zeros_for_draining); in TEST_F()
2199 aio.is_free_running = 1; in TEST_F()
2200 aio.filled_zeros_for_draining = 100; in TEST_F()
2201 aio.base.min_buffer_level = 512; in TEST_F()
2203 rc = no_stream(&aio.base, 0); in TEST_F()
2207 EXPECT_EQ(aio.base.min_buffer_level + aio.base.min_cb_level, in TEST_F()
2209 EXPECT_EQ(0, aio.is_free_running); in TEST_F()
2210 EXPECT_EQ(0, aio.filled_zeros_for_draining); in TEST_F()
2219 aio.num_underruns = 0; in TEST_F()
2222 rc = alsa_output_underrun(&aio.base); in TEST_F()
2224 EXPECT_EQ(1, aio.num_underruns); in TEST_F()
2233 EXPECT_EQ(aio.base.min_buffer_level + aio.base.min_cb_level, in TEST_F()