diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
index 202f83f..f489bf7 100644
--- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
+++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
@@ -704,6 +704,9 @@
     bool mediaFilter = isMediaFilter(filterConf);
     auto filter = mFilterTests.getFilterById(filterId);
 
+    // startTime needs to be set before calling setDelayHint.
+    auto startTime = std::chrono::steady_clock::now();
+
     auto timeDelayInMs = std::chrono::milliseconds(filterConf.timeDelayInMs);
     if (timeDelayInMs.count() > 0) {
         FilterDelayHint delayHint;
@@ -724,15 +727,22 @@
         ASSERT_EQ(filter->setDelayHint(delayHint).isOk(), !mediaFilter);
     }
 
-    // start and stop filter in order to circumvent callback scheduler race
-    // conditions after adjusting filter delays.
+    // start and stop filter (and wait for first callback) in order to
+    // circumvent callback scheduler race conditions after adjusting filter
+    // delays.
+    auto cb = mFilterTests.getFilterCallbacks().at(filterId);
+    auto future =
+            cb->verifyFilterCallback([](const std::vector<DemuxFilterEvent>&) { return true; });
     mFilterTests.startFilter(filterId);
+
+    auto timeout = std::chrono::seconds(30);
+    ASSERT_EQ(future.wait_for(timeout), std::future_status::ready);
+
     mFilterTests.stopFilter(filterId);
 
     if (!mediaFilter) {
-        auto cb = mFilterTests.getFilterCallbacks().at(filterId);
         int callbackSize = 0;
-        auto future = cb->verifyFilterCallback(
+        future = cb->verifyFilterCallback(
                 [&callbackSize](const std::vector<DemuxFilterEvent>& events) {
                     for (const auto& event : events) {
                         callbackSize += getDemuxFilterEventDataLength(event);
@@ -744,11 +754,9 @@
         // hint beforehand.
         ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId));
 
-        auto startTime = std::chrono::steady_clock::now();
         ASSERT_TRUE(mFilterTests.startFilter(filterId));
 
         // block and wait for callback to be received.
-        auto timeout = std::chrono::seconds(30);
         ASSERT_EQ(future.wait_for(timeout), std::future_status::ready);
         auto duration = std::chrono::steady_clock::now() - startTime;
 
