Commit Graph

293 Commits

Author SHA1 Message Date
Yan Wang 1c6ecd0023 Use "const char*" instead of "char*".
It is unnecessary to use "char*" for calculating string length.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2017-10-12 22:28:22 +01:00
Liam Girdwood a639ef098f component: host: add error trace for elem errors
Also place a TODO for future improvement.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-10-12 16:51:04 +01:00
Liam Girdwood 5fa2fb7ca2 dma: dw: fix indentation in error path
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-10-12 16:51:04 +01:00
Liam Girdwood 067b8ead34 comp: dai: wait for pause/stop to complete before returning.
Block on DMA completion for stop/pause to serialise IPC with host.
i.e. new host IPC is queued until DMA completes.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-10-12 16:51:04 +01:00
Liam Girdwood c47fd180b6 dma: dw: report any IRQs that are not cleared.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-10-12 16:51:04 +01:00
Liam Girdwood 2f60b25062 dma: dw: check channel status at stop.
Report an error if channel is still active during stop.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-10-12 16:51:04 +01:00
Liam Girdwood 2d48d47bf2 dma: dw: improve IRQ handler reload handling.
The reload handling code has 3 outcomes that are better represented in
a switch statement. Remove unreachable if statement too.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-10-12 16:51:04 +01:00
Liam Girdwood 97dadbedde dma: dw: improve state handling in dw dma driver
Use the COMP_STATE_READY to indicate a channel has an assigned user and
ready for use.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-10-12 16:51:04 +01:00
Liam Girdwood 6e2894faab dma: dw: fix position callback to use platform timer
Use platform timer for timestamp.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-10-12 16:51:04 +01:00
Liam Girdwood b083e58c94 component: enforce checking on component state transitions
Make sure we check all component state transitions and report any errors
to trace by calling comp_set_state().

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

comp fixup
2017-10-12 16:51:03 +01:00
Liam Girdwood e1f0ce26ff ssp: trail: disable DMA handling of trailing bytes
Make sure SSP does not assert FIFO requests for trailing bytes.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-10-12 15:27:24 +01:00
Liam Girdwood 1bb7cda702 ssp: pause: fix pause/release logic
SSP can either be in paused or prepared state during stream pause
depending on the state of the other SSP data direction. Make sure this
is taken into account.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-10-12 15:21:40 +01:00
Seppo Ingalsuo 28fafc1071 SRC: Support block sizes near or equal to period length
This patch decouples the first and second stage in two phase conversion
that is used for out/in rate fractions with high numerator or denominator
value. For e.g. 44.1 -> 48 kHz 160/147 fraction the 1st 8/7 stage and
2nd 20/21 stage are executed number of times close to period length in
time used for the scheduling rate. The number of consumed and produced
samples per copy() is no more constant. The latency of 44.1 kHz is
decreased about 2 ms and processing load is less variable.

This patch removes mute feature due to non-compatibility with variable
length data processing. It can be introduced later if needed as different
implementation.

The polyphase filter is also optimized slightly. More optimizations will
follow.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-10-11 13:50:07 +01:00
Yan Wang 860292e74e Use 64-bit time instead of 32-bit time for work queue utility.
Current timer has been upgraded to 64-bit but work queue utility
still uses 32-bit.
So timer->hitime can't be added rightly because the 64-bit time
is truncated by work queue utility.
"rmbox" will still receive 32-bit timestamp value only and can't
be upgraded to 64-bit timestamp.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2017-10-11 13:37:53 +01:00
Yan Wang 138fd825aa Fix the calculation of 64bit timeout.
Before the 1st rollover, timer->hitimeout = 0, it will cause
platform_timer_64_handler() set timeout = 1.
So the time irq is forced to be fired at the beginning of rollover.
And the timeout of platform_timer_set() will be invalid and work
queue cannot be fired.

Just set the new hitimeout to timer->hitimeout.
timer->hitime will be added in the next rollover.
It is unnecessary to check timer->hitimout > 0.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2017-10-09 12:20:37 +01:00
Liam Girdwood c1917ddd94 ipc: stream: add debug trace if triiger command is unknown.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-10-05 22:09:05 +01:00
Liam Girdwood fdf1a37d69 component: make sure we can enter the start from paused state
Fix state checking to make sure start can be entered after pause.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-10-05 22:03:21 +01:00
Seppo Ingalsuo 2a382e99a6 SRC: Fix use of int and uint types and remove unused function parameters
This patch fixes the warning messages shown with gcc option -Wextra. The
source and sink buffer pointers advance is moved from filter function to
higher level copy function as update consume/produce parameter.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-09-28 23:07:33 +01:00
Liam Girdwood 60d1bf3a33 xtensa: hal: fix build warnings
Make remaining region translation APIs static inline to avoid
unused function errors.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-28 22:52:47 +01:00
Yan Wang a9d5181621 Add header file for avoiding compiing warning.
If no this, "error: no previous prototype for XXX" will be reported.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2017-09-28 22:50:16 +01:00
Pierre-Louis Bossart d46dd3567d sof: check for missing prototypes
gcc -Wall is not enough, add -Wmissing-prototypes to align with
kernel warnings.

Add relevant includes and move functions without prototype as static

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-09-27 10:54:34 +01:00
Pierre-Louis Bossart 0ffc585dff ipc: remove unnecessary tests
Last test would always evaluate as true, refactor to fold equal and
less than case as one

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-09-27 10:54:23 +01:00
Pierre-Louis Bossart 090d4f4c8d wait: reduce number of nested breaks
MISRA-C:2012, 15.4 - There should be no more than one break or goto
statement used to terminate any iteration statement

reshuffle the code to use a single break

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-09-27 10:54:23 +01:00
Pierre-Louis Bossart 66bc346267 ssp: remove unnecessary direction parameter in ssp_stop
No longer needed since we do the same thing for playback and capture

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-09-27 10:54:23 +01:00
Pierre-Louis Bossart e079f9eb96 ssp: replace switch by if for readability
MISRA C:2012, 16.5: Every switch statement shall have at least two
switch-clauses

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-09-27 10:54:23 +01:00
Pierre-Louis Bossart 8f03c9ba0a volume: replace switch by if for readability
MISRA C:2012, 16.5: Every switch statement shall have at least two
switch-clauses

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-09-27 10:54:23 +01:00
Pierre-Louis Bossart c3253e1d8f tone: replace switch by if for readability
MISRA C:2012, 16.5: Every switch statement shall have at least two
switch-clauses

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-09-27 10:54:23 +01:00
Pierre-Louis Bossart b513a45e10 SRC: replace switch by if for readability
MISRA C:2012, 16.5: Every switch statement shall have at least two
switch-clauses

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-09-27 10:54:23 +01:00
Pierre-Louis Bossart 0d9fd41b3b pipeline: simplify prepare loop
MISRA-C:2012, 15.4 - There should be no more than one break or goto
statement used to terminate any iteration statement

reshuffle the code to use a single break with no additional tests.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-09-27 10:54:23 +01:00
Pierre-Louis Bossart 5f6d6c8391 pipeline: add missing default case
Make static analysis warnings go away and comply with MISRA rules:
the final clause of a switch statement shall be the default case

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-09-27 10:54:23 +01:00
Pierre-Louis Bossart 4ccf81daff sof: define each identifier in a dedicated statement
MISRA C++:2008, 8.0.1 and CERT-DCL52-J require that one variable per
declaration.

Change tree-wide, keeping variables in the initial order (except
when it was obviously better to change).

No functional change. The Tensilica HAL remains as is as it should
be modified separately

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-09-27 10:54:23 +01:00
Liam Girdwood 34ab0309d8 gitigore: ignore disassembly and mapfiles
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-25 12:52:10 +01:00
Liam Girdwood 8af048f914 comp: host: Add trace output for buffer size errors
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-25 12:46:11 +01:00
Seppo Ingalsuo c46d66d7a1 EQ IIR: Get filter config and response switch via ABI
The IIR equalizer configure and control is updated to use the new
component ABI. In addition there are checks added to protect IIR
equalizer from invalid setup.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-09-25 12:44:24 +01:00
Seppo Ingalsuo 34e4dac557 EQ FIR: Get coefficients and response switch via ABI
The FIR equalizer configure and control is updated to use the new
component ABI. Checks are added to protect equalizer from invalid
setup. Also an unused parameter is removed from fir_init_delay()
function.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-09-25 12:44:24 +01:00
Seppo Ingalsuo 03e670b16a Component ABI: Check for valid ABI header for COMP_CMD_SET_DATA command
This patch adds the code to check the generic ABI header fields and reject
data with invalid header. The individual components those use ABI need
to check the component specific fields in addition.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-09-25 12:39:46 +01:00
Seppo Ingalsuo 66cf828eb7 Volume: Add 24 to 24 bit samples volume processing
This patch adds to component volume S24_4LE to S24_4LE processing. The
macro from audio/format.h is used to compute shifts needed for product.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-09-25 11:33:42 +01:00
Liam Girdwood 2293403b56 comp: volume: dump trace output on format matching failure.
Emit trace data to show format matching failures for source and sink data
types.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-23 23:06:14 +01:00
Liam Girdwood 6506fd93d4 pipeline: pipeline_complete() now checks pipe status and return errors
pipeline completion should check for valid pipeline status and return
any errors for invalid status (like already completed pipelines).

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-23 23:06:14 +01:00
Liam Girdwood 37cb3ebfc9 alloc: remove unecessary debug trace statement
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-23 23:06:14 +01:00
Liam Girdwood 52177cab21 pipeline: fix timestamp for capture streams.
Make sure we timestamp upstream in capture streams

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-23 23:06:14 +01:00
Pierre-Louis Bossart ea44940219 ssp: add missing break in dai format switch
Support for DSP_A is obviously broken.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-09-23 23:06:14 +01:00
Seppo Ingalsuo f9a671b8de Component ABI: Add SOF ABI header to struct sof_ipc_ctrl_data
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-09-23 23:06:14 +01:00
Seppo Ingalsuo e83a4808b7 Component ABI: Add data field to struct
This patch adds flexible field "data" to struct sof_abi_hdr to be used
to pass binary data via ABI.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-09-23 23:06:14 +01:00
Seppo Ingalsuo 94cd49734c Component ABI: Magic id for uapi/abi.h
This patch adds a define of 32 bit integer that equals to ASCII
string "SOF\0" to be used in checking for correct magic number in
binary data. The char type for the magic is changed to uint32_t for
simpler comparison.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-09-23 23:06:14 +01:00
Seppo Ingalsuo 8aa14a62cb EQ IIR: Fix duplicated buffers pointers advance
This patch removes pointers advance from filters function since it was
added to copy().

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-09-23 23:06:14 +01:00
Seppo Ingalsuo 1940496e25 EQ FIR: Fix duplicated buffers pointers advance
This patch removes pointers advance from filter function since it was
added to copy.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-09-23 23:06:14 +01:00
Seppo Ingalsuo 8725de778a EQ FIR: Minor trace bug fix
This patch fixes the trace class and renames the macro to match module
name. Note that some trace patches are related to other changes data
and cannot be separated to this patch.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-09-23 23:06:14 +01:00
Seppo Ingalsuo 14d10a82b8 SRC: Comment edit
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-09-22 15:23:37 +01:00
Seppo Ingalsuo 9d9a400c5f SRC: Add tiny 16 bit coefficient set and set it as default for BYT
This patch adds a very small size and fast to compute SRC coefficients set
for converting between 8/16/24/32/44.1/48 kHz and 48 kHz. It is
set as default for BYT platform until a more optimized SRC core is
available. The quality of this set has been reduced to achieve the faster
computation.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-09-22 15:23:37 +01:00