1
0
Fork 0
Commit Graph

9 Commits (e17ee871b97ab37ed885673631d4d6d4e77f6fb1)

Author SHA1 Message Date
Shengjiu Wang e17ee871b9 MLK-24444-1: ASoC: fsl_dsp: Support PCM format for compress sound card
For PCM format the supported format is mono/stereo, S16_LE/S32_LE,
and 8KHz-192kHz frequency.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-07-30 09:54:07 +08:00
Bing Song 23219672c1 MLK-24365-4 dsp: enable dsp lpa.
One big buffer shared between A core and DSP to buffer audio
bitstram. So A core can sleep more time when DSP is playing
buffered audio bit stream.

Signed-off-by: Bing Song <bing.song@nxp.com>
2020-07-10 16:48:11 +08:00
Zhang Peng dcf3272d11 MLK-23850 soc: fsl: Correct parameters getting from DSP
Before the parameters getting from dsp is not right, now correct it.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-27 15:03:16 +08:00
Zhang Peng 92d77a4619 MLK-23701-3 ASoc: fsl: Fill pcm_io_frames and sampling_rate
Get samplerate and consumed data from dsp when call
snd_compr_ops.pointer.

Signed-off-by: Zhang Peng <peng_zhang_8@nxp.com>
2020-04-07 12:48:18 +08:00
Zhang Peng d235be4b28 MLK-23701-2 ASoc:fsl: Add support cplay in mp board
1. Add clk necessary in dsp driver
2. Add renderer type for select sai or esai

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2020-04-07 12:48:18 +08:00
Zhang Peng 21f3df8506 MLK-22815-1: ASoC: fsl: dsp: Expand parameter msg size
Modified parameter msg in dsp, make sure still can transfer right msg
between DSP and user, modified parameter msg in kernel.

Signed-off-by: Zhang Peng <peng_zhang_8@nxp.com>
2019-11-25 15:52:21 +08:00
Daniel Baluta 3aa009e2c0 MLK-20094: ASoC: fsl: dsp: Fix crash in compress cleanup path
We must find a way to no longer touch resources after they are
cleand up.

Now, after a stress test we get the following crash:

[ 2156.863772] fsl-dsp 596e8000.dsp: xf_pool_alloc failed
[ 2156.869337] Unable to handle kernel NULL pointer dereference at
virtual address 00000060
[ 2157.148594] [<ffff000008d8839c>] _raw_spin_lock+0x14/0x48
[ 2157.153995] [<ffff000008b3e0b8>] xf_cmd_send_recv_complete+0x40/0xf0
[ 2157.160354] [<ffff000008b3e470>] xf_close+0x40/0x88
[ 2157.165239] [<ffff000008b3f7a4>] xaf_comp_delete+0x5c/0x70
[ 2157.170730] [<ffff000008b40530>] dsp_platform_compr_free+0xa0/0xe8
[ 2157.176917] [<ffff000008b287fc>] soc_compr_free_fe+0x144/0x1a0
[ 2157.182754] [<ffff000008b11b24>] snd_compr_free+0x64/0x98

This happens because:

	1) dsp_platform_process work handler waits in a loop for
	   messages to arrive.
	2) when cplay process finishes it cleans up most of the
	   resources.
	3) when another cplay process starts it reinitializes the
	  resources including queues for example.
	4) a message will be generated and kernel will crash because
	   dsp_platform_process uses the older queues.

A solution for this is to make sure dsp_platform_process work loop
is stopped at cleanup time.

We use is_active state and signal dsp_platform_process handler to
finish because we are on the cleanup path.

While at it replace cancel_work with cancel_work sync to be sure
that work handler ends before going on with the rest of the cleanup.

Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25 15:52:06 +08:00
Daniel Baluta 2cdddf2f2e MLK-19972-1: ASoC: fsl: dsp: Fix compr_set_param cleanup path
In case of error no cleanup was done leaving thus reasources
in an undefined state.

This can cause crashes like this:

[   34.259281] fsl-dsp 596e8000.dsp: load codec wrap lib error
[   34.266333] fsl-dsp 596e8000.dsp: create component failed, type = 1,
err = -2
[   34.273493] err pool alloc ret = -2
[   34.298363] Unable to handle kernel NULL pointer dereference at
virtual address 00000000

... which happens when lib_dsp_codec_wrap.so is not present.

While at it, we also realign some lines of code in order to avoid
going over the 80 characters limit that Linux kernel coding style
preaches on.

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25 15:52:05 +08:00
Daniel Baluta 09194b889d MLK-18497-11: ASoC: fsl: compress: Introduce compress implemenation
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25 15:52:02 +08:00