Commit Graph

5144 Commits

Author SHA1 Message Date
Liam Girdwood c14a4e97f1 comp: pause: Make sure dai/host state are preserved during pause/resume
The DAI and host components states must be preserved during pause so that
when normal pipeline positions are used on resume. i.e. pause just looks
like a very long pipeline schedule.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-22 14:33:23 +00:00
Liam Girdwood a9e1b6c673 trace: dont resend old buffers if trace buffer overflows
The circular trace buffer can overflow if too much trace data is sent
before it can schedule a DMA copy to flush the data. This overflow
causes the avail bytes counter to be greater than the buffer size and
means the DMA copy is rescheduled until avail is 0 (repeating old data).

Fix this by resetting avail to 0 when we overflow.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-22 13:29:46 +00:00
Liam Girdwood 5277acbfe1 comp: pause: Make sure dai/host state are preserved during pause/resume
The DAI and host components states must be preserved during pause so that
when normal pipeline positions are used on resume. i.e. pause just looks
like a very long pipeline schedule.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-21 22:09:13 +00:00
Liam Girdwood 0c9e55b6da panic: fix panic_dump_stack()
Fix so that dump stack does not overwrite any debug data and does not
read past the end of the stack.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-21 21:07:24 +00:00
Liam Girdwood bc73899f9a arch: add API call to get stack current pointer.
Return the current stack pointer.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-21 21:07:24 +00:00
Liam Girdwood cb6c5fd669 platform: Add a platform workQ clock source macro
Add this macro at platform level so it can be used by others.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-21 21:07:24 +00:00
Liam Girdwood b7bcd47085 baytrail: panic: fix panic on baytrail.
Simplify and fix panic output on baytrail.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-21 21:07:24 +00:00
Liam Girdwood cf3221b362 agent: integrate system agent into idle loop.
Initialise the SA during platform init and then notify SA of idle in the
main audio loop.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-21 17:17:26 +00:00
Liam Girdwood d163f6d970 agent: Add initial system monitoring agent.
Add a simple system monitoring agent that can detect when FW does not
execute correctly. The assumption is that FW will always idle from time
to time and this idling can be monitored by the SA. The FW wont idle if
it's thrashing, continually interrupted, continually running work or
continually rescheduling a task.

The SA will emit trace and panic if idle is not entered for a specific time
period.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-21 17:17:26 +00:00
Liam Girdwood 8334c554fa panic: fix panic_dump_stack()
Fix so that dump stack does not overwrite any debug data and does not
read past the end of the stack.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-21 17:17:26 +00:00
Liam Girdwood d1c61576a5 arch: add API call to get stack current pointer.
Return the current stack pointer.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-21 16:50:18 +00:00
Liam Girdwood 141f972672 platform: Add a platform workQ clock source macro
Add this macro at platform level so it can be used by others.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-21 16:19:52 +00:00
Liam Girdwood 4335929c8b baytrail: panic: fix panic on baytrail.
Simplify and fix panic output on baytrail.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-21 16:14:58 +00:00
Pan Xiuli bd40145123 rimage: Fix some memory leak error
Handle pointers and memory when error happens.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2017-12-20 15:27:56 +00:00
Pan Xiuli 6b59f8f698 rimage: Fix some memory leak error
Handle pointers and memory when error happens.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2017-12-20 14:16:15 +00:00
Pan Xiuli 0866b2a13e topology: test: Add test cases for SRC pipe
Add src pipe for test case.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2017-12-20 10:10:59 +00:00
Pan Xiuli 49d1ca9a13 topology: sof: Fix a typo for pipe src capture
Should be src capture here in capture pipe.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2017-12-20 10:10:59 +00:00
Pan Xiuli c737dcacc3 topology: test: Add test cases for SRC pipe
Add src pipe for test case.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2017-12-20 10:10:05 +00:00
Pan Xiuli 5dcdb6524d topology: sof: Fix a typo for pipe src capture
Should be src capture here in capture pipe.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2017-12-20 10:10:05 +00:00
Seppo Ingalsuo ece72b5e1a Volume: Code cleanup for minimum gain value limiting
This patch changes the condition for limiting the smallest gain to
eliminate a never executed code part when VOL_MIN is defined as zero. The
variable v is unsigned integer so less than zero is not possible.
The functionality is not modified by this patch.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-12-20 10:07:56 +00:00
Seppo Ingalsuo 33b144d2fe Volume: Code cleanup for minimum gain value limiting
This patch changes the condition for limiting the smallest gain to
eliminate a never executed code part when VOL_MIN is defined as zero. The
variable v is unsigned integer so less than zero is not possible.
The functionality is not modified by this patch.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-12-20 10:07:25 +00:00
Yan Wang 53976e4c38 Change type of size in trace_work() callback from uint32_t to int32_t.
This variable is set by the return value of dma_copy_to_host_nowait().
Unsigned type will mislead error checking.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2017-12-20 09:09:10 +00:00
Yan Wang b7cd6ac667 Change type of size in trace_work() callback from uint32_t to int32_t.
This variable is set by the return value of dma_copy_to_host_nowait().
Unsigned type will mislead error checking.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2017-12-20 09:08:57 +00:00
Liam Girdwood 8d47a54f5c rimage: remove flat file builder.
No longer needed so can be safely removed.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-20 09:07:44 +00:00
Liam Girdwood bd363e1631 rimage: update to new SOF driver file format.
Support the SOF driver file format.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-20 09:07:40 +00:00
Liam Girdwood 106192c58c rimage: remove flat file builder.
No longer needed so can be safely removed.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-20 09:04:24 +00:00
Liam Girdwood 2307a6ace2 rimage: update to new SOF driver file format.
Support the SOF driver file format.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-20 09:04:13 +00:00
Liam Girdwood bd220b212f lock: Add deadlock detection.
Add a debug option that can detect deadlock and panic(). The deadlock
detection attempts to acquire a lock several times before giving up
and causing a panic() taht dumps the  deadlock details.

Signed-off-by: Liam Girdwwod <liam.r.girdwood@linux.intel.com>
2017-12-19 19:51:47 +00:00
Liam Girdwood 24ff686d9e lock: Add deadlock detection.
Add a debug option that can detect deadlock and panic(). The deadlock
detection attempts to acquire a lock several times before giving up
and causing a panic() taht dumps the  deadlock details.

Signed-off-by: Liam Girdwwod <liam.r.girdwood@linux.intel.com>
2017-12-19 19:51:11 +00:00
Liam Girdwood 892ce16571 trace: dma: Help kernel and userspace detect missing trace messages.
Add message count and overflow detection to the trace position output
so that kernel and userspace can detect the trace buffer has overflowed.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-19 17:27:20 +00:00
Liam Girdwood 2b86cb3e02 trace: dma: Make sure we can trace platform device initialisation.
Currently the trace initialisation must be performed after DMAC init
has completed. This means we miss the trace output from any platform
device initialisation.

Split the DMA trace initialisation into two parts so the trace buffer
is allocated early on and can accept messages meaning we dont miss any
device initialisation trace.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-19 17:27:01 +00:00
Liam Girdwood 1b31a13798 pipeline: docs: Add some comments to further document the pipeline core
Add more descriptive documentation to help document the pipeline core.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-19 17:21:40 +00:00
Liam Girdwood 76d5b55b8a Merge branch '1.0-dev' 2017-12-19 14:51:05 +00:00
Keyon Jie 9b8e0e5fd7 dw-dma: set msize according to burst_elems setting
For memory to memory copy(burst_elems initialized to be 0),
we set msize to default value 3, that is 2 ^ 3 = 8 items for
each burst transaction.

For DMA copying which related to peripheral device(source or
destination), we will use the configured burst_elems, which
usually means the number of data items, e.g. slot number for
SSP dai fifos.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2017-12-19 11:14:26 +00:00
Keyon Jie 54e3325460 dai: set dai dma burst_elems according to slot number
We should set burst_elems for dma peripheral dev copy, for
dai/ssp, it should be set to valid slot number, otherwise,
the dma may copy in wrong burst size and data will run with
wrong speed.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2017-12-19 11:14:26 +00:00
Keyon Jie 3676017be2 dw-dma: add burst_elems setting to struct dma_sg_element
We need configure different burst_elems for different dma copy, so
here introduce it to dma_sg_element struct.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2017-12-19 11:14:26 +00:00
Pan Xiuli a0b9292508 topology: test: Add capture and playback only test.
We may need these test for validation, add these tests.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2017-12-19 11:11:04 +00:00
Pan Xiuli c3bd862032 topology: m4: Add two macros for one direction PCM
We may need to generate capture only or playback only PCMs.
Add these macros to help generate them.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2017-12-19 11:11:04 +00:00
Pan Xiuli 90856416b6 topology: test: Refine name for test generator.
We have 5 critical arguments in the test generator but only used 3 for
the naming, this will make some files be overwritten.
Refine the name method to let these 5 arguments show in the tplg name.
Also we decide the pipe type in one of the argument, test-ssp.m4 and
test-src-ssp.m4 are almost the same, just remove one.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2017-12-19 11:11:04 +00:00
Liam Girdwood ae8bd6059e dw-dma: trace: make sure all trace error are unique
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-17 12:33:23 +00:00
Liam Girdwood 7c2153af86 locks: Add try_lock API to attempt lock access without spinning
Add a try version to acquire a spin lock.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-13 21:58:00 +00:00
Liam Girdwood 471a47805e host: verify number of period > 0
Check number of periods is > 0 other wise return an error and emit some
trace.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-13 21:15:41 +00:00
Liam Girdwood c20762ecac topology: test: Add simple component test generator.
Move testing pipelines into a test directory and reuse test scaffolding
so that they can be used to test multiple components on multiple target
with multiples configs.

Test topology scafolding are now pre-processed using a script to generate
the ALSA conf format with the various changes for each test case.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-13 21:08:57 +00:00
Liam Girdwood 8b254b5f3d topology: AIF directions are codec centric wrt PCMs
Commit 0a1a9bbc492e4eb22173ed57c7f5499c8f106289 discovered a bug in
the direction of AIF widgets in relation to PCMs. AIF widgets are codec
centric in ASoC so topology must align.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-13 21:06:27 +00:00
Keyon Jie 88519eee73 topology: fix 2 typos for capture pipeline
1. Widget N_PCMC type should be "aif_in", not "aif_out".
2. Widget W_DAI_IN data should be "N_DAI_IN", not "N_DAI_OUT".

Signed-off-by: Xiuli Pan <xiuli.pan@intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2017-12-13 21:06:27 +00:00
Yan Wang 57d299420a Increase timeout of DMA trace work re-scheduling if local buffer is half full.
The timeout of work_reschedule_default() cannot be too short to finish
work queue rescheduling. Otherwise, the work will be rescheduled wrong
into the next timer loop.
Also change macro name of DMA trace time interval for reading easily.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2017-12-13 16:49:57 +00:00
Pierre-Louis Bossart c077cb31fa volume: pass format change to downstream components.
The volume component can change the sink data format depending on sink
component/pipeline topology configuration. This change is set locally,
but not to the host params that are passed downstream.

Fix this so that downstream components can check params match their
topology configuration.

Tested with test-passthrough-48k-vol-ssp2 and reef-byt-rt5651
topology files. Note that there are quite a few underflows likely added by
recent changes, more work needed to identify what goes on.

(first fix for prepare() from Liam, additional update for the params()
case by Pierre)

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-13 10:03:02 +00:00
Liam Girdwood 19e3240ec7 topology: Add duplex support to 24 bit volume passthrough
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-11 22:04:19 +00:00
Liam Girdwood e76aeeb7e9 topology: modify passthrough volume playback for duplex operation
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-11 22:03:50 +00:00
Liam Girdwood e094d38e95 topology: Add passthrough volume capture pipe
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-11 22:03:24 +00:00