Skip to content

Optimize host copier with one less buffer copy - #6951

Merged
lgirdwood merged 10 commits into
thesofproject:mainfrom
btian1:moduleinterface
Mar 7, 2023
Merged

lgirdwood merged 10 commits into
thesofproject:mainfrom
btian1:moduleinterface

Conversation

@btian1

@btian1 btian1 commented Jan 13, 2023 •

Copy link
Copy Markdown
Contributor

Currently, copier actually created 2 devices for data input, it is
host and copier, hence there are two times copy from DMA buffer
to local buffer then to component buffer.

This PR intend to remove host device and one more time copy
through use host data to handle host interface calling.

Basically, there are several steps to go there:

  1. Add host data to copier data structure.
  2. Share host data structure to copier by add a host copier common header file.
  3. In copier, all host related ops calling should be replaced with new host exposed interface.
  4. Remove one more time copy and host endpoint buffer.
  5. Remove host device.

Performance data:

  1. mcps, saved 1.9mcps, 5.9 --> 4.0, 33% saved for copier.
    Before: comp:0 0x40000 perf comp_copy samples 48 period 1000 cpu avg 586 peak 598
    After: comp:0 0x40000 perf comp_copy samples 48 period 1000 cpu avg 408 peak 422

  2. memory, since host endpoint buffer and host device got removed, for each copier,
    16bit/32bit 384/768 bytes saved for buffer, 112 saved for host device.
    As a summary, 16/32 bit playback/capture totally saved 496/884 bytes for each copier usage.
    For the cases that have more than 10 copier usage, memory saving is quite remarkable.

Note:multiple sink host copier is not tested and will be fixed in a follow up dai optimization PR.

Signed-off-by: Baofeng Tian baofeng.tian@intel.com

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants