Commit Graph

5144 Commits

Author SHA1 Message Date
Liam Girdwood 44509242b0 comp: buffer size: Add resize support for SRC, EQ and DAI
Make SRC, EQ and DAI use the new buffer size and reset position API
calls rather than manually resetting and sizing the buffer.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-07 15:34:42 +01:00
Liam Girdwood 4e3ebe9b98 comp: buffer: reject buffer size 0 requests.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-07 15:33:19 +01:00
Liam Girdwood 08ccf3380b topology: SRC: Use 4ms for topology scheduling and increase buffers
SRC should be scheduled on at least 4ms tick. Increase buffers to
deal with 2 times output rate.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-07 14:25:18 +01:00
Ranjani Sridharan 6200408cd7 comp: default function to set comp state
This patch adds a the comp_set_state() used for
the mandatory pipeline commands, START, STOP, PAUSE and RELEASE. It also
updates the cmd method in existing components to use comp_set_state().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2017-09-07 12:17:45 +01:00
Liam Girdwood a57a7b1ec8 comp: dai: drain and stop notifications come from host.
Make sure all stop/drain notification come from host and not DAI
component.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-07 11:46:38 +01:00
Liam Girdwood 158a203e96 buffer: trace: improve R/W position to trace
Make sure R/W positions are in trace. Clarify comment for buffer size.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-06 23:42:14 +01:00
Liam Girdwood 1291afeaa0 comp: mixer: fix buffer position update
Buffer pointers were being updated twice. Fix.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-06 23:40:52 +01:00
Liam Girdwood 1eee57481c buffer: add new buffer management apis for component convenience
Add new APIs to allow components to easily resize, reset and clear
buffers. Update host, mixer and volume to use them.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-06 23:39:00 +01:00
Liam Girdwood 8e1e7e6dbd comp: buffer: add support for non period aligned buffers
Add support for non period aligned buffers to the buffer free/avail
calculation.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-06 23:33:29 +01:00
Seppo Ingalsuo cb3a64d3e6 SRC: Bug fix for copy period length and some init code cleanup
The error in computing block length in copy() function is fixed. It
caused SRC to use unnecessarily long blocks with some rates and fail
to execute within available buffer size. The input and output block
length is now computed in initization. Sample rates support mask bit
for 7350 Hz is removed also.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-09-06 21:29:53 +01:00
Liam Girdwood b1aaef8199 comp: buffer: Align trace buffer output on 2 * 16 bit shorts.
Align on shorts now that rmbox supports 32bit values in trace.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-05 23:53:10 +01:00
Liam Girdwood 10be4902d6 ipc: streams: add stream component ID to stream messages.
Make sure we include the stream component ID in any stream message to
the host.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-05 23:51:05 +01:00
Liam Girdwood 46be4c583d ipc: mailbox: simplify mailbox usage.
There can be some confusion over mailbox naming wrt to in/out and up/down
naming with respect to DSP or host context.

Rename the mailboxes to imply either host initiated or DSP initiated IPC
so that it's obvious to driver and FW engineers which is the correct
mailbox to use.

This change also simplifies the IPC command replies by returning 1 if
the command function creates the reply message otherwise a generic
reply is used.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-05 23:49:38 +01:00
Liam Girdwood 097e0a1947 pipeline: preload: dont return an error if preload completes
Dont return an error and emit trace errors if preload succeeds.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-05 23:42:43 +01:00
Liam Girdwood 4d5af6f8ac comp: xrun: improve trace output for xruns
Add more data for xrun trace analysis.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-05 23:39:22 +01:00
Liam Girdwood dc028171bb pipeline: XRUNs: Only transmit XRUN to host when pipeline is running.
ALSA can get confused during preload if we send an XRUN (i.e. before ALSA
has triggered).

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-05 23:36:19 +01:00
Liam Girdwood b22edfdbdf pipeline: xrun: fix timestamp to use comp type instead of ID to find DAIs
Pipeline should use the comp type to find DAIs and not IDs.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-05 23:35:17 +01:00
Liam Girdwood 505a3a8335 comp: mixer: report any mixer XRUNs to pipeline.
Report any mixer underruns or overruns for each source and sink to
pipeline.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-05 23:29:56 +01:00
Liam Girdwood 5f53e40c52 topology: byt-rt5640: Fix stream name for BE DAI link
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-04 21:03:44 +01:00
Liam Girdwood f00e8884dd rmbox: check for non printable chars in trace.
Non printable means trace is a value.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-04 16:35:01 +01:00
Ranjani Sridharan ae370c111f pipeline: fixed return value from preload_downstream
This patch fixes the return value from the preload_downstream() call in
pipeline_params()

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2017-09-04 16:18:05 +01:00
Keyon Jie 14e2d8e61c alloc: Add support for allocating different types of memory from the heap
To add support for different types of heap memory, here it will:

1. add handle for RFLAGS_DMA which will allocate DMA buffer blocks
if exist;
2. refine free_block, which will free blocks of runtime heap,
general buffer heap, or dma buffer heap.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Tested-by: Zhang Keqiao <keqiao.zhang@intel.com>
2017-09-04 13:39:23 +01:00
Liam Girdwood 9f8983fceb sof: abi: Add component ABI header for host configuration
Add an ABI header to be pre-pended to all binary blobs or bespoke
component data structures that will be passed from host to DSP component
or vice versa (i.e via binary kcontrols).

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-04 12:36:12 +01:00
Liam Girdwood 6cb0fd2806 topology: src: fix src config data by adding ""
SRC config data was missing "". Fixed.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-03 22:15:59 +01:00
Liam Girdwood ea3ff83bdc topology: media: fix media min period size to align with 1ms granularity
Make sure media buffers can align min period size on 1ms granularity.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-03 22:15:59 +01:00
Liam Girdwood 12b1907499 topology: src: fix W_SRC widget argument list order
Put format and data in correct order.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-03 22:15:58 +01:00
Liam Girdwood 22ce806f58 comp: src: use buffer allocator when allocating delay lines.
delay lines are typically several kB in size so use buffer allocator.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-03 22:04:26 +01:00
Liam Girdwood b12aa0d2e6 comp: src: add validation to SRC config and runtime params.
Make sure we validate all config and params variables and complain
if there are omissions or errors.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-03 22:00:58 +01:00
Liam Girdwood c3148825b9 heap: byt: balance heap block size map
Balance the heap block map size out to better fit real world usage by
reducing small blocks to create extra larger blocks.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-03 21:58:04 +01:00
Liam Girdwood 854b2e518b component: data: Make component get/set data host API generic
Make the host API and IPC to set and get component runtime data and values
generic with no bespoke commands at the IPC level.

Create a generic structure that descibes the type and size of data and
whether that data is appended to the IPC message or is available to
be DMAed from host.

Update the components to use the new structure. Some components like
SRC, tone and tone still require some work to export thier ABI.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-09-02 23:14:02 +01:00
Liam Girdwood 1bed6ee95d topology: bind kcontrols to PGA widgets.
Add an parameter to bind TLV volume kcontrol to volume widget.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-31 23:51:20 +01:00
Seppo Ingalsuo aa62532d82 Testing: Add enums for file I/O based test components
This patch adds to ipc.h enabling for two new components to read and
write test vectors via file I/O. They are specific to test bench usage
on development computer only and are not real SOF components. This update
avoids need to edit this file for test bench build.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-08-31 13:36:16 +01:00
Seppo Ingalsuo f36e74c424 Tone: Bug fixes and code cleanup
This patch fixes issues in setting up the tone generator for correct
sample rate and channels number. Component IPC was missing latest needed
changes. The buffers handling issue is fixed. Obsolete commented code is
removed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-08-31 13:17:57 +01:00
Seppo Ingalsuo 48adb1933f SRC: Remove obsolete conversion filters
These conversion filters are no more used and will be replaced later with
new. The deletion is because the stop-band spec was changed from 0.51xFs
to 0.50xFs (no intentional aliasing of transition band) so the file
names of new default high-quality filters will be with different filename.
The filter spec is appended to file name to differentiate different
bandwidth filters for same rates fraction.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-08-31 13:17:49 +01:00
Seppo Ingalsuo 28ef854d02 SRC: Bug fixes, add support for int16 coefficients, comments cleanup
This patch fixes bugs in sink and source buffers handling and adds
support for short coefficient type to save RAM in platforms with less
space such as BYT. The patch introduces also a RAM saving minimum
conversions set between 16, 44.1, and 48 kHz. A new possible rate 18.9 kHz
was added to supported rates indication bits. SRC filters quality is also
adjusted for lower default performance. The higher performance will need
>16bit coefficients usage. The larger conversion set and 32 bit
filter coefficients can be easily restored with the SRC tools in rimage.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-08-31 13:17:35 +01:00
Liam Girdwood 6bb4da421c rmbox: Add support for floating point clock freq in MHz
Allow timestamp clock frequency to be set in MHz

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-30 22:55:57 +01:00
Liam Girdwood 7a1105772d rmbox: fix help output to show all options
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-30 22:55:57 +01:00
Liam Girdwood 811918df70 topology: Add format and scheduling info to DAI pipelines.
Some pipelines can be used to service DAIs before data is sent on to
other processing pipelines. Add scheduling and format info to DAI
pipelines.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-30 22:55:57 +01:00
Pierre-Louis Bossart 7e1610920f uapi: fix SOF_RATE common frequencies
Current definitions are missing 12 and 64 kHz, have
typos (11250, 22500), list a weird 40kHz and don't
have extension capabilities for non-standard rates

Before we create ABI problems with the Linux kernel, let's add all
the sampling frequencies needed before we submit stuff upstream
(the same list needs to be reflected in the kernel include/uapi)

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-08-30 22:17:49 +01:00
Liam Girdwood 6aebc6e26b drivers: ssp: Improve SSP I2S and DSP mode generation from topology.
Improve support for I2S and DSP modes alongside using topology data to
define the mode configuration. Add trace errors to reject any unsupported
configurations.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-30 22:08:58 +01:00
Liam Girdwood 4ca4028d2c Revert "rimage: remove flat file builder."
This reverts commit 072fb5c43f.
2017-08-27 17:11:06 +01:00
Liam Girdwood 91bee9eb50 Revert "rimage: update to new SOF driver file format."
This reverts commit 03acfd640d.
2017-08-27 17:10:08 +01:00
Liam Girdwood a80e2f84cc comp: mixer: make error trace messages non verbose
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-25 21:08:07 +01:00
Liam Girdwood 50be05b950 pipeline: params: Use correct host side comp when installing params.
Some components have multiple sources/sink and the correct host side
component must be used when installing params. Make sure the correct
component is used here by tracking the previous component and passing it
to the params installation.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-25 20:15:40 +01:00
Liam Girdwood 3d640ff6af comp: dai: Verify config ib params() and be verbose about any errors
Verify the configuration in params and send any errors to host and trace.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-25 19:56:59 +01:00
Liam Girdwood 26e11996b6 comp: mixer: calculate frame and period bytes in params().
TODO: need to check all sources for params.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-24 22:12:25 +01:00
Liam Girdwood 0f8737e2a0 comp: volume: provie additional trace on prepare() errors
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-24 22:09:25 +01:00
Liam Girdwood 6c40c58532 ipc: make sure all messages start at 1 instead of 0 to simplify debug
Messages starting at offset 1 remove any ambiguity over whether the
message has been constructed correctly.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-24 22:06:06 +01:00
Liam Girdwood 5ca8e8d39c topology: Remove second SRC from BYT/CHT default topologies
SRC in default full rate and high quality configuration is quite large.
free up some memory on BYT and CHT by using only one SRC.

TODO: Provide the SRC with configuration data for supported rates and
quality in order to significantly reduce it's footprint.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-24 21:52:00 +01:00
Liam Girdwood da9108adff topology: test: Add new test topologies to help with component debug
Add a simple passthrough and a passthrough with volume.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-08-24 21:49:08 +01:00