Makes dai_info and dai_type structures constant.
Pointer to dai array should not change during the lifetime of DSP.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Uses new platform_shared_commit() function to commit
shared notify data. Notify data no longer needs to be explicitly
aligned to data cache line size. It is implicitly handled by
SHARED_DATA macro.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Removes unnecessary lock from notifier. Notification list
is allocated in core context, so it's not shared between
cores. There is no need to lock during unregistration.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Uses new platform_shared_commit() function to commit
shared timer data. Timers can be shared between cores,
so let's use new shared API in timer API.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Replaces void pointer to timer_data with pointers to
timer handler and handler data. We had multiple definitions
of timer_data structure and they were all the same.
This way we can remove unnecessary static data.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Marks memory map as shared data and refactors code in alloc
to use new platform_shared_commit function. Memory map is
accessed from SMP code, so it should be explicitly marked
as shared resource. Newly introduced API makes code more generic.
We no longer need explicit cache operations.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds platform_shared_commit function for keeping shared data
synchronized. It's used after usage of data shared by different
cores. Such data is either statically marked with SHARED_DATA
or dynamically allocated with SOF_MEM_FLAG_SHARED flag.
cAVS platforms use uncached memory region, so no additional
synchronization is needed, but for SMP platforms without
uncache this function should writeback and invalidate data.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This patch implements universal macro for shared data
modified at runtime by different cores. On platforms
with uncached memory region all this data can be placed
into dedicated section, so it can be later accessed through
uncache without worrying about cache line alignment and random
cache evictions. Other SMP platforms without uncache can implement
it in some other way, but it's highly advised this macro should
align data to cache line size in such cases.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This patch adds dedicated section for shared data
on cAVS platforms. This section will be used to store
static data, which can be accessed by multiple cores.
Access to this data will go through uncached memory region.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Removes shared_ctx from ipc structure and add its members
directly to struct ipc. From now on ipc struct needs to
be shared to support SMP. It's done in order to eliminate
possible wrong pointer to shared_ctx, since it was a part
of cached data.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This patch removes a trivial function vol_update() and alters
vol_sync_host() to update all channels the same time into the
host data structure instead of per channel updates. There is no
other change to component operation.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The earlier version of ramp step calculation was more complex than
necessary and there was no way to ensure the max. topology defined
ramp time happens in beginning of streaming so the step equation
was rewritten. The step value is rounded for better match with
topology defined ramp length.
Normally the ramp is constant rate type where the topology define
time happens for vol min-max transition. A smaller transition is
completed in less time.
The constant rate mode is not used for the first copy() triggered
ramp to ensure the ramp from vol min to used volume takes the
entire topology defined time. This mode is also as earlier used
for legacy kernels where the vol min/max information is not passed.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch ensures that a ramp will happen in beginning of
streaming even if the driver control sequence would not launch
it by successive volume requests for mute and actual volume.
Also a check is added into volume ramp update to prevent a volume
command in component idle state to schedule repeatedly ramp
updates. In that case the volume can be set immediately to ramp
end value.
Also the ramp is updated for active channels only. There's no need to
update for the maximum channels count.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch fixes the calculation of macro VOL_RAMP_STEP_CONST
that is used in linear step size calculation. The previous version
calculated incorrectly the value as inverse. However with used ramp
update rate of 1000 us there were no issues seen because the value
and inverse were both 1.0. The bug would have triggered with with
a faster or slower ramp update rate.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch replaces in topology sof-hda-generic.m4 the use of macro
pipe-volume-capture.m4 usage with a new macro pipe-highpass-capture.m4.
The used 40 Hz cut-off is sufficient to suppress the DC pulse in the
beginning of capture from headset with minimal impact to other
applications such as recording music.
The capture volume ramp length is changed from 250 ms to 400 ms. The
longer ramp is feasible because the microphone path seems to open
at 500 ms from capture. It helps to attenuate the remaining noises
in the beginning of capture.
The patch also adds additional high-pass responses macros for
topology with different 20-50 Hz cut-off frequencies into
SOF/tools/topology/m4.
The changes for Matlab/Octave script example_iir_eq.m that
generated the filter coefficients are included here as well.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Periodic stamp traces cpu ticks every time agent task run.
This peak value compared to cpu clock shows the peak load.
Platform art ticks are traced and allow for fine adjustment
of cpu ticks in case there is a jitter in agent task period.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Performance ts macros use both the platform timer and cpu timer
in case the latter is not always-running-timer.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
A cpu timer may be used with arch_timer api to read
a cpu timer in a common way including platforms that
have a dedicated platform timer and their platform_timer
api is not a simple redirection to arch_timer.
Sometimes it is important to have access to both, e.g.
when computing performance counters, since the platform
one is expected to be always running timer while the
cpu timer may be gated in idle.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
arhument name 'source' (instead 'buffer') implies that this
parameter shouldn't be modified inside function, what is true.
This change improves code readability.
Suggested-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
pcm_converter is plenty of preprocessor conditional build so it's
easy to be puzzled.
Added comments improve code readability.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Input buffer should be explicit marked as const to indicate
that input samples and other comp_buffer fields shouldn't
be modified (especially r_ptr/w_ptr).
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
In pcm, host and dai was implicit data definition corresponding
to defined in pcm 'converter' function pointer.
Using common function interface improve code coherence.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This patch enables the generic C version code when xt-xcc compiler
is used for e.g. HiFi2EP platform like BYT. The intrinsics in
HiFi3 version are not compatible with the elder xtensa architecture
and cause build fail.
There will be need for update here for architectures after HiFi3 where
HiFi3 version might be as such applicable while a dedicated optimized
version is missing but it will be done later.
The patch includes some comments additions/changes to help follow
the nested #if #else #endifs.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
When entering D0ix, we can run FW with either DMA trace on (e.g. the
host system is in S0) or off (e.g. the host system is in S0ix), here
take the NO_TRACE flag passed from host and response to it.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
By reverting the condition, there is one indentation less
so readability improved a bit and gives more space for
longer lines.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
There is no need to keep dead code.
Currently host and DAI component is responsible for format conversion -
- using pcm_converter functions.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Revert changes introduced in commit 7003c1f for s32 format.
Moreover explicity declare threshold for s32 on same level as
for s24 to indicate that it is intentional.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
i.MX8X is very similar with i.MX8. Memory layout is the same
except IRQSTEER address.
Code will be shared but there will be different firmware binaries
named:
* sof-imx8.ri, for i.MX8
* sof-imx8x.ri, for i.MX8X
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
The trace issue is only cosmetic since VOL_MIN is currently defined
to zero. There linear gain value was not altered despite the emitted
trace. With this change the limiting no more happens for input value
zero.
The related trace messages are improved to show the defined limits
for easier adjust the offending topology volume scale if this
happens. The string split style is also updated to current.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch unifies the configuration blob parsing related traces
with IIR. The low importance trace for response start index is
removed and a note about setting a channel to bypass is added. The
illegal channel map response index is traced with error.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Response channel map extrapolation uses now last valid channel
response instead of first response when there are more stream
channels than channel map on configuration blob. The change is
done for similarity with IIR. It prevents a false issue report
from static code analysis.
The extrapolation behavior is not critical and in effect type of
usage where it is common to apply the single defined response for
every channel so in that case there is no change.
In transducer equalization the blob needs to define usually a different
for every channel so also in that case extrapolation is not feasible
to let happen and a full length channel map need to be defined anyway.
The firmware trace shows which response # gets applied for channel. So
when unsure the parsing of configuration blob can be quickly checked.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch removes the command handler stubs for COMP_CMD_SET_VALUE
and COMP_CMD_GET_VALUE. A proper error is issued if these commands are
passed to FIR.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>