Skip to content

Commit dbb13a4

Browse files
committed
audio: host-zephyr: Do not track 'no bytes to copy' in case of FAST_MODE
In FAST_MODE the host DMA is not paced with the period size and can copy more data once to do no copying for a other periods. In other words: in FAST_MODE the host is not running in stream mode, but in batch mode. Printing warnings in this does not make sense and just fills up the firmware log. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 80aa053 commit dbb13a4

1 file changed

Lines changed: 20 additions & 17 deletions

File tree

src/audio/host-zephyr.c

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -478,27 +478,30 @@ static uint32_t host_get_copy_bytes_normal(struct host_data *hd, struct comp_dev
478478
* in order to avoid high load spike
479479
* if FAST_MODE is enabled, then one period limitation is omitted
480480
*/
481-
if (!(hd->ipc_host.feature_mask & BIT(IPC4_COPIER_FAST_MODE)))
482-
dma_copy_bytes = MIN(hd->period_bytes, dma_copy_bytes);
483-
484-
const uint64_t now = k_uptime_get();
485-
const uint64_t delta = now - hd->nobytes_last_logged;
486-
const bool reset_skipped = delta > SOF_MIN_NO_BYTES_INTERVAL_MS;
481+
if (!(hd->ipc_host.feature_mask & BIT(IPC4_COPIER_FAST_MODE))) {
482+
const uint64_t now = k_uptime_get();
483+
const uint64_t delta = now - hd->nobytes_last_logged;
484+
const bool reset_skipped = delta > SOF_MIN_NO_BYTES_INTERVAL_MS;
487485

488-
if (hd->n_skipped > 1 && (dma_copy_bytes || reset_skipped)) {
489-
comp_warn(dev, "Skipped %u no-bytes events in last %llu ms, bytes %u",
490-
hd->n_skipped - 1, delta, dma_copy_bytes);
491-
hd->n_skipped = 0;
492-
}
486+
dma_copy_bytes = MIN(hd->period_bytes, dma_copy_bytes);
493487

494-
if (!dma_copy_bytes) {
495-
if (!hd->n_skipped || reset_skipped) {
496-
hd->nobytes_last_logged = now;
488+
if (hd->n_skipped > 1 && (dma_copy_bytes || reset_skipped)) {
489+
comp_warn(dev,
490+
"Skipped %u no-bytes events in last %llu ms, bytes %u",
491+
hd->n_skipped - 1, delta, dma_copy_bytes);
497492
hd->n_skipped = 0;
498-
comp_warn(dev, "no bytes to copy, available samples: %u, free_samples: %u",
499-
avail_samples, free_samples);
500493
}
501-
hd->n_skipped++;
494+
495+
if (!dma_copy_bytes) {
496+
if (!hd->n_skipped || reset_skipped) {
497+
hd->nobytes_last_logged = now;
498+
hd->n_skipped = 0;
499+
comp_warn(dev,
500+
"no bytes to copy, available samples: %u, free_samples: %u",
501+
avail_samples, free_samples);
502+
}
503+
hd->n_skipped++;
504+
}
502505
}
503506

504507
/* dma_copy_bytes should be aligned to minimum possible chunk of

0 commit comments

Comments
 (0)