Commit Graph

166 Commits

Author SHA1 Message Date
Liam Girdwood 803f33a676 comp: buffer: complain loudly if componenst try to under/over run buffers
Complain loudly in trace if we have components overruning or underruning
buffers. Components should check buffer free/avail before use.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-23 23:57:08 +01:00
Liam Girdwood 6d5723dfd6 comp: buffer: condense buffer status trace data.
Condense the buffer status data into fewer trace lines.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-23 23:55:33 +01:00
Liam Girdwood 4897246c75 ipc: component config must always be after comp header.
State this to be obvious. TODO: merge into 1 structure to enforce this.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-23 23:54:15 +01:00
Liam Girdwood a68343fee8 comp: host: make sure we have enough data to copy to/from host
Perform a check in the copy() function to make sure there is enough
data to copy to/from host buffers.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-23 23:52:00 +01:00
Liam Girdwood c73ff5c16d ipc: byt: remove comment
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-22 22:34:46 +01:00
Liam Girdwood b0df61d04e ipc: stream params: Add reply for stream params.
Stream params has it's own reply message so use it.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-22 22:34:27 +01:00
Liam Girdwood 9ec831b137 comp: volume: use XRUN handler to report XRUNs
Use the new XRUN API to report XRUNs to host and trace.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-22 22:33:52 +01:00
Liam Girdwood bc83a0e147 component: xrun: Add XRUN convenience APIs for notification and trace
Add a simple convenience API to allow components to report XRUNs

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-22 22:32:21 +01:00
Liam Girdwood a1da5bcc8d pipeline: xrun: Add XRUN initial handler into pipeline
Add an XRUN handler into the pipeline to report bag overrun and underrun
from component buffers to the host. An XRUN on a component will now cause
a IPC XRUN message to each PCM interface source/sink to the component.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-22 22:31:04 +01:00
Liam Girdwood 2d5f55ca5f byt: mailbox: fix mailbox size.
4k is correct size.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-22 22:24:17 +01:00
Liam Girdwood 7c43aefb6f trace: cleanup: cleanup some trace.
Simple cleanup of some trace calls.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-21 20:33:49 +01:00
Liam Girdwood 8c0338e349 pipeline: preload: Fix preload completion detection and add limit
Make sure the preloader can detect when all buffers are loaded prior
to trigger and add a limiter to make sure we dont pre-load forever.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-21 20:33:49 +01:00
Liam Girdwood 0f1a8fd771 comp: volume: make sure we only calculate buffer positions once.
Position was being calculated in twice in the copy funcs.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-21 20:33:49 +01:00
Liam Girdwood 2126e25089 ipc: reply: Add message replies to component creation.
Make sure we return an error or 0 after component creation.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-21 20:33:49 +01:00
Liam Girdwood 2cfaebe1f0 component: params: removed unused host params arg in params() config API
Remove the unused pointer to host parameters in params(). This was only
useful to the host component. Provide some component frame configuration
variables to give more flaxability than host params.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-21 20:33:49 +01:00
Liam Girdwood ec2198621d dai: config: Use a generic structure for DAI configuration
Use a generic structure containing common DAI settings for configuration.
This structure also contains a tail of DAI specific data that can also
be used by DAI drivers.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-21 16:57:28 +01:00
Liam Girdwood 98e1dc5a89 ipc: improve error reporting and return values
Improve IPC error reporting and values to host by tracing all failures
and making sure errors are returned when detected.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-15 16:37:40 +01:00
Liam Girdwood 14dee1a218 ipc: pipeline: Add pipeline position/timestamp readback to IPC
Allow the IPC to send and receive pipeline position and timestamp data.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-15 16:18:19 +01:00
Liam Girdwood 46f30ceb7c pipeline: timestamp: Add support for pipeline timestamping
Allow pipeline host and DAI components to be timestamped in a platform
specific manner so that host DMA & DAI DMA position alongside any local
DSP timestamp can be returned to the host drivers.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-15 16:10:28 +01:00
Liam Girdwood b67b0c0b6f ipc: reply: make sure replies can return negative errors
Add support to add negative error values to IPC replies.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-15 16:02:01 +01:00
Liam Girdwood df091b0d09 component: add 64bit position counter to each component
Components will now each have a 64bit position counter that will indicate
the processing position in bytes for each component. This can be used
by time stamping, trace and debug.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-15 15:56:33 +01:00
Liam Girdwood 185ec6ab20 trace: comp: Make high frequency trace output verbose level
make sure our high frequency component and pipeline trace uses verbose
trace level.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-15 15:52:06 +01:00
Curtis Malainey 6bf480c4f8 ipc: Use unsigned defines to prevent negation when shifting
If values using in SOF_GLB_TYPE are > 0x08 then the highest bit is set. If this
bit is set then when the data is shifted back (for example in iGS in intel-ipc)
it will shift arithmetically and leave the sign bit which will cause comparisons
to fail. Ex:

    #define FOO 0x08
    #define BAR 0x08U
    #define LSHIFT(x) (x << 28)
    #define RSHIFT(x) (x >> 28)

    int main() {
      printf("%x, %x\n", RSHIFT(LSHIFT(FOO)), RSHIFT(LSHIFT(BAR)));
      // fffffff8, 8
    }

Singed-off-by: Curtis Malainey <cujomalainey@google.com>
2017-08-10 20:03:15 +01:00
Liam Girdwood 3f5847c3d2 platform: dma: add host DMA timeout macro
Host DMA needs it's own timeout as its not bound to any synchronous data
transfer timings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-10 16:54:51 +01:00
Liam Girdwood ae73307721 platform: cleanup platform header an remove unused macros
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-10 16:53:30 +01:00
Liam Girdwood 9b22986695 static pipeline: move static SSP config into static pipeline.
Move the  platform SSP configs into a the static pipeline

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-10 16:37:18 +01:00
Liam Girdwood 4d0e197e07 pipeline: move static scheduling params to static_pipeline.c
Move all the static scheduling params out of the platform headers and into
the static pipeline source as they are no longer used by dynamic pipeline
code.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-10 16:30:11 +01:00
Liam Girdwood fb1d0047e2 pipeline: static: move static buffer sizes out of platform header
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-10 15:58:06 +01:00
Liam Girdwood d164e00a54 wait: fix potential race if condition completes close to timeout
The completion condition may complete very close to the timeout. This will
result in an error being returned alongside completion. make sure we dont
return an error in this case.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-10 15:23:17 +01:00
Liam Girdwood 3488cce9f9 core: Add support for pipeline creation and scheduling via IPC.
This is a large tightly coupled patch that adds support for pipeline
definition and scheduling configuration via host IPC.

The intention is that hosts can create and configure pipelines dynamically
at runtime based on use case. This involves defining a pipeline topologies
and scheduling configuration. It also includes configuration of
individual components within a pipeline.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-10 12:28:24 +01:00
Curtis Malainey 974a577c23 Incorrect trace variable name
Minor debugging issue, when verbose trace is turned on it will not compile
because these variables are incorrect.

Signed-off-by: Curtis Malainey <cujomalainey@google.com>
2017-08-10 12:22:50 +01:00
Liam Girdwood 71a35c317b trace: provide locking around trace output.
Make sure trace mailbox writes are atomic and provide reef context.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-09 17:48:50 +01:00
Liam Girdwood 14e1310bb1 arch: xtensa: generate a disassembly output fro debug.
Also generate a disassembly with no interleaved source for easier
memory debugging.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-09 16:00:31 +01:00
Rajavardhan Gundi def4a9ffaf build: Generate separate .map and .lst files.
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2017-08-09 15:52:58 +01:00
Keyon Jie afbc689446 byt-ipc: fix a src/dst error
We should copy from [inbox_base + offset(0 here)] src to
msg->rx_data dst here, otherwise, copying to 0 dst will
crash the firmware here.

Reported-by: Luo Xionghu <xionghu.luo@intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2017-07-07 12:10:14 +01:00
Seppo Ingalsuo 891235ea0e Fix long lines and other white space issues
This change fixes the warnings and errors returned by checkpatch.pl in
source code files eq_fir.c, eq_iir.c, fir.h, and tone.c.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-06-29 11:49:55 +01:00
Seppo Ingalsuo 4a00691b9e SRC: IPC updates and fixes v3
SRC sets the sink and downstream pipeline PCM rate, period_count and
period_bytes in src_params() according to received out_rate via IPC.

Fail in delay lines allocation results to -ENOMEM error.

Function call comp_set_sink_params() is renamed to
comp_buffer_sink_params().

Added void to functions and corresponding headers without parameters.

Plus white space and long lines fixes for all SRC source files.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-06-29 11:49:55 +01:00
Seppo Ingalsuo 54fbb1347d Component: Rename comp_set_sink_params to comp_buffer_sink_params
Rename to avoid confusion with the purpose of this function.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-06-29 11:49:55 +01:00
Seppo Ingalsuo 7bf86f5bb3 Add test bench SOF component types
Types SOF_COMP_FILEREAD and SOF_COMP_FILEWRITE are used used in host
test bench for test vector file I/O. These components are not used in
DSP firmware.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-06-29 11:49:55 +01:00
Seppo Ingalsuo c6faa66e39 Audio/buffer: Set alloc_size
The buffer->alloc_size was not set. It needs to be equal to
buffer->end_addr minus buffer->addr for circular buffers.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-06-29 11:49:55 +01:00
Seppo Ingalsuo a08edbf89f IIR EQ: Avoid issue with non-defined number of channels in configuration v2
Initialize EQ for max number of channels in configuration or switch
commands to avoid not set number of channels. A return value of -ENOMEM is
propagated in init functions and returned if allocation for memory fails.

Some trace output is added into EQ setup and some comments cleaned and
added.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-06-28 12:52:04 +01:00
Seppo Ingalsuo 7bb5530938 FIR EQ: Allocation bug fix and updates to configuration and switch cmd v2
A free of null pointer is fixed with this change. Also the possibility of
nondefined number of channels in EQ config or switch command is eliminated by
by initializing the FIR for max channels. An error of -ENOMEM is propagated
in functions and returned if allocation in config or switch response fails.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-06-28 12:51:07 +01:00
Seppo Ingalsuo a0a81ffbfa Tone: Bug fixes v2
The default tone frequency of 997 Hz was updated to a proper Q16.16 value.
Macros for tone frequency and gain were added to tone.h and a generic
float to fractional value conversion macro to format.h. Also some common
Q1.31 decibel constants were added. Tone function pointer set was moved to
tone_new() since it is not modified later in this component.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-06-28 12:51:07 +01:00
Liam Girdwood 246d4f79a6 pipeline: perform prepare() on the selected component.
prepare() is not being performed on the selected component. Fix this so
that all components including the selected are prepared in a pipeine.


Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-06-26 16:21:25 +01:00
Liam Girdwood a26c4cca98 ipc: byt: use SOF_IPC_FW_READY for boot notification
Use global SOF_IPC_FW_READY to notify FW boot,

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-06-26 16:07:06 +01:00
Liam Girdwood 8337b77972 ipc: make sure all IPC return error values are processed correctly
Return int instead of uint32_t for errors.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-06-15 13:42:01 +01:00
Liam Girdwood 82be00f200 comp: dai: remove extra memcpy()
No need to copy data twice during DAI init.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-06-15 13:41:52 +01:00
Seppo Ingalsuo 56856e6a38 tone: The endpoint needs to be set
The signal generator is an endpoint component so this needs to be set for
the pipeline to function.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-06-14 11:16:24 +01:00
Liam Girdwood 29f3cc815d pipeline: set component pipeline ID when connecting components.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-06-13 15:43:54 +01:00
Liam Girdwood 3032fc4667 ipc: fix IIR and FIR build since they use IPC comp that embeds hdr
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-06-12 13:46:17 +01:00