This patch removes the channel map table lookup from all volume control
since it is not used by the SOF 1.0 driver. Instead of enum channel
descriptors the channels are addressed with indices in
0..<number of channels -1> range.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Clean-up register configurations for SSCR0..5, SSPSP, SFIFOTT
The results are ok in I2S and LEFT_J 24 bits
Tested with RT5645 and DA7212
TODO:
1. fix 16 bit issue (right channel lost)
2. test DSP modes
3. connect SSP and DMA watermarks
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cosmetic change, for some reason the register definition was not
sequential as in the data sheet
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Make sure all macro parameters are protected with parentheses to avoid
unintended expansion issues
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The dma_sg_elem might be used uninitialized if the callback
function forget to do that.
Here adding initialization to fix that.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
1. "size" should not be considered twice.
2. Change host_offset to uint32_t type.
3. size = min(hsize, lsize), so it is unncessary to check ">"
for wrap local and host buffer.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
Move it from ipc handler into platform_init().
It should be placed after IPC and DMAC initialization.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
Replace the user-defined MAX and MIN values for 32-bit and 16-bit
with standard INTN_MAX/INTN_MIN macro
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This reverts commit 97addafa10.
git bisect tells me this is the source of IPC timeouts, 100% reproducible
[ 162.496099] sof-audio sof-audio: error: ipc timed out for 0x90010000 size 0x18
[ 162.496590] sof-audio sof-audio: error: cant set params for DMA for Trace-110
[ 162.496636] sof-audio sof-audio: error: failed to initialize trace -110
[ 162.808132] sof-audio sof-audio: error: ipc timed out for 0x30010000 size 0x3c
The same errors were also reported by Sven Schwermer on the mailing list
on a Tangier device, revert until we figure out what's wrong.
Cc: Sven Schwermer <sven@svenschwermer.de>
Cc: Yan Wang <yan.wang@linux.intel.com>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
SSP 0,1,2 on CHT share the same physical IRQ as SSP 3,4,5 respectively.
Fix this so that all SSPs IRQs are supported.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The previous patch for SOF updated component IPC commands and provided an
ABI for configuration and control. This patch updates the IIR equalizer
to use such controls.
Also the missing COMP_STATE_READY from method new() is added. Lack of it
caused pipeline prepare fail.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The previous patch for SOF updated component IPC commands and provided an
ABI for configuration and control. This patch updates the FIR equalizer
to use such controls.
Also the missing COMP_STATE_READY from method new() is added. Lack of it
caused pipeline prepare fail.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The control interface is fixed to follow the component ABI. Separate tone
generator instances are used to feed individual channels. It allows
simultaneous testing of all channels by use of different tone frequencies.
To simplify features there is no mixer so e.g. DTMF telephony UI sounds
generation would need a channel mixer component after a two channel tone
output in the pipeline.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Due to previous patch the volume mute is updated to be controlled with
SOF_CTRL_CMD_SWITCH that maps to ALSA switch style control. Mute for a
channel is set with an (unsigned) value larger than zero. Zero value
unmutes the channel.
In both mute and volume set code the if statement to compare component
channel map is changed to compare to chanv[j].channel instead of used
chanv[j].value that looks incorrect.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds to struct sof_ipc_ctrl_data three new commands
SOF_CTRL_CMD_ENUM, SOF_CTRL_CMD_SWITCH, and SOF_CTRL_CMD_BINARY. In
addition an index parameter is added to address various features or
registers.
Commands SOF_CTRL_CMD_ROUTE, SOF_CTRL_CMD_SRC, SOF_CTRL_CMD_LOOPBACK,
SOF_CTRL_CMD_EQ_SWITCH, SOF_CTRL_CMD_EQ_CONFIG, SOF_CTRL_CMD_MUTE, and
SOF_CTRL_CMD_UNMUTE are removed.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch changes the sample rate conversion processing to use a single
multi-channel filter instead of per channel called mono filter instances.
The filter output is now rounded with 1/2 LSB add. The polyphase filter
input input block sizes are multiplied in SRC initialization to reach
near to or exacly the period length to reduce polyphase filter call
overhead.
The polyphase filter is now called via function pointer for more
flexibility with audio data formats. Currently S32_LE and S24_4LE are
supported.
Code cleanup includes removal of redundant variables and some debug
print code.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1. Move source and header file.
2. Change src/lib/Makefile.am and src/audio/Makefile.am.
3. Chnage header file path.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
This patch fixes the DC offsets introduced in the volume component
due to shifts and handles sign extension for 24-bit input samples
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add a simple trace method to output lock users and detect any sleeping
during atomic context. The intention is to provide simple trace data
that can be used to pinpoint any deadlocks or attempts to sleep whilst
atomic.
Future: The trace output in that patch can be improved to provide easier
lookup for lock users rather than line numbers.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Execution should never return from do_task(). Dump stack in the panic
if we do return here.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add support for DMA trace to run in atomic and IRQ contexts. Currently
DMA trace would sleep between DMA copies and enter atomic state when
inserting new tarce data into the trace buffer.
This patch adds new DMA _nowait() APIs that dont sleep and _atomic() APIs
for trace logging that can be safely called in atomic context.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Fix locking in DMA trace. Also run the DMA trace as delayed work so
we dont block callers. Refactor API so that DMAC and channel are
pre-allocated.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
DMA trace must be run from a work context and not from any atomic
context as it waits on DMA completion IRQs.
Check the host and local buffers for wrap.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1. Ignore DMA trace event when forwarding for avoiding dead lock
because DMA tracing uses DMA API to copy trace event.
2. Add _trace_error() API to send error event by mail box at the same
time too when copying error event by DMA.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
1. Change trace data coping API for current trace event data including
64-bit timestamp.
2. Remove trace event of DMA tracing for avoiding dead lock.
3. If DMA tracing is ready, send event data when the data size is
half full or the DMA tracing buffer arrive at the end. Otherwise,
overwrite the data directly.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
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>