Skip to content

Backport 1bfb1978d ('dma: alloc separate buffers for DMAs') - #3682

Closed
brentlu wants to merge 11 commits into
thesofproject:cml-008-patch-backportfrom
brentlu:fix-3619
Closed

brentlu wants to merge 11 commits into
thesofproject:cml-008-patch-backportfrom
brentlu:fix-3619

Conversation

@brentlu

@brentlu brentlu commented Dec 10, 2020 •

Copy link
Copy Markdown
Contributor

Backport the commit 1bfb197 ('dma: alloc separate buffers for DMAs') and other related commits to fix the audio stop issue. Need review to make sure the commits are sufficient without side effects.

commit 1bfb197
Author: Tomasz Lauda tomasz.lauda@linux.intel.com
Date: Fri Oct 18 13:08:44 2019 +0200

dma: alloc separate buffers for DMAs

Currently DMAs are using buffers on pipelines connected to either
host or dai components. This causes many problems in firmware logic
e.g. we need to preload playback pipelines with data or we need
to manually override buffer sizes, if the buffer isn't complaint
with specific DMA requirements. Also it requires from topology
creators to know some hardware specific things on each platform
like that for timer based scheduling on cAVS platforms we need
to have 3 periods in buffers connected to dai components.
This patch allocates separate buffers for DMAs, which are made
complaint by using different DMA attributes first. We no longer
need to preload playback streams, because we can start DMA
right away and just let it transfer zeroes before any valid
data will come.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>

dabekjakub and others added 11 commits December 10, 2020 00:39
Add alignment option for memory requests.
Fix alloc definitions for UT.
Function definitions were using defines in their body
which blocked usage of const values in said defines.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
Adds new start_position field based on which we assess whether
we should throw an xrun. It fixes rare cases of xruns on release
with timer scheduled pipelines.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Add seeting of alignment for DMA buffer that is required by
Hardware configuration.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
Unify function naming to fix DEBUG_HEAP build

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
Adds and initializes id, pipeline_id and caps fields in buffer struct.
This is the only data needed after buffer creation. It allows us to
remove the whole sof_ipc_buffer struct from the buffers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Extracts allocation part of buffer_new to separate function.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds new DMA attribute DMA_ATTR_BUFFER_PERIOD_COUNT and implements
it for every DMA. This attribute says how many periods should DMA
buffer consist of.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Implements simple buffer copy functions for 16 and 32 bit data.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Implements copy functions from/to DMA buffer. They take care
of cache operations and also can perform custom processing
during copy. By default it will be usual buffer copy, but in the future
it can be replaced with pcm conversions, so we don't need volume
into the pipelines just for that operation.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
DW-DMA has no specific alignments regarding buffer and copy sizes.
However setting it to 32 bytes breaks stream formats with period
sizes lower than 32 bytes, as linked list is being configured
incorrectly.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Currently DMAs are using buffers on pipelines connected to either
host or dai components. This causes many problems in firmware logic
e.g. we need to preload playback pipelines with data or we need
to manually override buffer sizes, if the buffer isn't complaint
with specific DMA requirements. Also it requires from topology
creators to know some hardware specific things on each platform
like that for timer based scheduling on cAVS platforms we need
to have 3 periods in buffers connected to dai components.
This patch allocates separate buffers for DMAs, which are made
complaint by using different DMA attributes first. We no longer
need to preload playback streams, because we can start DMA
right away and just let it transfer zeroes before any valid
data will come.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
@lgirdwood

Copy link
Copy Markdown
Member

@slawblauciak who's the branch owner ?

@slawblauciak

Copy link
Copy Markdown
Collaborator

@lgirdwood which branch?

@brentlu

brentlu commented Dec 14, 2020

Copy link
Copy Markdown
Contributor Author

cml-008-patch-backport which is for all CML Chromebooks

@brentlu

brentlu commented Dec 23, 2020

Copy link
Copy Markdown
Contributor Author

abandon this PR since we created another backport to cml-008-patch-backport2 branch

@brentlu brentlu closed this Dec 23, 2020
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.

[BUG][CML] audio stops during aplay playback

5 participants