[RFC PATCH v7 09/13] media: uapi: Add V4L2_CTRL_CLASS_M2M_AUDIO

2023-10-20 Thread Shengjiu Wang
The Audio M2M class includes controls for audio memory-to-memory use cases. The controls can be used for audio codecs, audio preprocessing, audio postprocessing. Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/common.rst| 1 + .../media/v4l/ext-ctrls-audio-m2m.rst

[RFC PATCH v7 08/13] media: uapi: define audio sample format fourcc type

2023-10-20 Thread Shengjiu Wang
till use the fourcc format. Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/pixfmt-audio.rst | 87 +++ .../userspace-api/media/v4l/pixfmt.rst| 1 + drivers/media/v4l2-core/v4l2-ioctl.c | 13 +++ include/uapi/linux/videodev2.h

[RFC PATCH v7 07/13] media: v4l2: Add audio capture and output support

2023-10-20 Thread Shengjiu Wang
device is named "/dev/v4l-audioX". Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/buffer.rst| 6 ++ .../media/v4l/dev-audio-mem2mem.rst | 71 +++ .../userspace-api/media/v4l/devices.rst | 1 + .../media/v4l/vidioc-en

[RFC PATCH v7 06/13] media: uapi: Add V4L2_CAP_AUDIO_M2M capability flag

2023-10-20 Thread Shengjiu Wang
V4L2_CAP_AUDIO_M2M is similar to V4L2_CAP_VIDEO_M2M flag. It is used for audio memory to memory case. Signed-off-by: Shengjiu Wang --- Documentation/userspace-api/media/v4l/vidioc-querycap.rst| 3 +++ Documentation/userspace-api/media/videodev2.h.rst.exceptions | 1 + include/uapi/linux

[RFC PATCH v7 05/13] ASoC: fsl_easrc: register m2m platform device

2023-10-20 Thread Shengjiu Wang
Register m2m platform device,that user can use M2M feature. Signed-off-by: Shengjiu Wang Acked-by: Mark Brown --- sound/soc/fsl/fsl_easrc.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index 0b9f3df8efc2

[RFC PATCH v7 04/13] ASoC: fsl_asrc: register m2m platform device

2023-10-20 Thread Shengjiu Wang
Register m2m platform device, that user can use M2M feature. Defined platform data structure and platform driver name. Signed-off-by: Shengjiu Wang Acked-by: Mark Brown --- include/sound/fsl_asrc_common.h | 23 +++ sound/soc/fsl/fsl_asrc.c| 18 ++ 2

[RFC PATCH v7 03/13] ASoC: fsl_asrc: move fsl_asrc_common.h to include/sound

2023-10-20 Thread Shengjiu Wang
Move fsl_asrc_common.h to include/sound that it can be included from other drivers. Signed-off-by: Shengjiu Wang Acked-by: Mark Brown --- {sound/soc/fsl => include/sound}/fsl_asrc_common.h | 0 sound/soc/fsl/fsl_asrc.h | 2 +- sound/soc/fsl/fsl_asrc_dm

[RFC PATCH v7 02/13] ASoC: fsl_easrc: define functions for memory to memory usage

2023-10-20 Thread Shengjiu Wang
ASRC can be used on memory to memory case, define several functions for m2m usage and export them as function pointer. Signed-off-by: Shengjiu Wang Acked-by: Mark Brown --- sound/soc/fsl/fsl_easrc.c | 214 ++ sound/soc/fsl/fsl_easrc.h | 4 + 2 files

[RFC PATCH v7 01/13] ASoC: fsl_asrc: define functions for memory to memory usage

2023-10-20 Thread Shengjiu Wang
output length according to input length m2m_get_maxburst: burst size for dma m2m_pair_suspend: suspend function of pair, optional. m2m_pair_resume: resume function of pair get_output_fifo_size: get remaining data size in FIFO Signed-off-by: Shengjiu Wang Acked-by: Mark Brown --- sound/soc/fsl

[RFC PATCH v7 00/13] Add audio support in v4l2 framework

2023-10-20 Thread Shengjiu Wang
st. changes in v2: - decouple the implementation in v4l2 and ALSA - implement the memory to memory driver as a platfrom driver and move it to driver/media - move fsl_asrc_common.h to include/sound folder Shengjiu Wang (13): ASoC: fsl_asrc: define functions for memory to memory usage ASoC: fsl_

Re: [RFC PATCH v6 09/11] media: uapi: Add audio rate controls support

2023-10-19 Thread Shengjiu Wang
On Wed, Oct 18, 2023 at 3:58 PM Hans Verkuil wrote: > > On 18/10/2023 09:40, Shengjiu Wang wrote: > > On Wed, Oct 18, 2023 at 3:31 PM Hans Verkuil wrote: > >> > >> On 18/10/2023 09:23, Shengjiu Wang wrote: > >>> On Wed, Oct 18, 2023 at 10:27 AM Shengji

Re: [RFC PATCH v6 09/11] media: uapi: Add audio rate controls support

2023-10-18 Thread Shengjiu Wang
On Wed, Oct 18, 2023 at 9:09 PM Hans Verkuil wrote: > > On 18/10/2023 14:52, Shengjiu Wang wrote: > > On Wed, Oct 18, 2023 at 3:58 PM Hans Verkuil wrote: > >> > >> On 18/10/2023 09:40, Shengjiu Wang wrote: > >>> On Wed, Oct 18, 2023 at 3:31 PM Hans Verk

Re: [RFC PATCH v6 10/11] media: imx-asrc: Add memory to memory driver

2023-10-18 Thread Shengjiu Wang
On Mon, Oct 16, 2023 at 10:01 PM Hans Verkuil wrote: > > On 13/10/2023 10:31, Shengjiu Wang wrote: > > Implement the ASRC memory to memory function using > > the v4l2 framework, user can use this function with > > v4l2 ioctl interface. > > > > User send the

Re: [RFC PATCH v6 09/11] media: uapi: Add audio rate controls support

2023-10-18 Thread Shengjiu Wang
On Wed, Oct 18, 2023 at 3:58 PM Hans Verkuil wrote: > > On 18/10/2023 09:40, Shengjiu Wang wrote: > > On Wed, Oct 18, 2023 at 3:31 PM Hans Verkuil wrote: > >> > >> On 18/10/2023 09:23, Shengjiu Wang wrote: > >>> On Wed, Oct 18, 2023 at 10:27 AM Shengji

Re: [RFC PATCH v6 09/11] media: uapi: Add audio rate controls support

2023-10-18 Thread Shengjiu Wang
On Wed, Oct 18, 2023 at 3:31 PM Hans Verkuil wrote: > > On 18/10/2023 09:23, Shengjiu Wang wrote: > > On Wed, Oct 18, 2023 at 10:27 AM Shengjiu Wang > > wrote: > >> > >> On Tue, Oct 17, 2023 at 9:37 PM Hans Verkuil wrote: > >>> > >>>

Re: [RFC PATCH v6 09/11] media: uapi: Add audio rate controls support

2023-10-18 Thread Shengjiu Wang
On Wed, Oct 18, 2023 at 10:27 AM Shengjiu Wang wrote: > > On Tue, Oct 17, 2023 at 9:37 PM Hans Verkuil wrote: > > > > On 17/10/2023 15:11, Shengjiu Wang wrote: > > > On Mon, Oct 16, 2023 at 9:16 PM Hans Verkuil wrote: > > >> > > >> Hi Shengji

Re: [RFC PATCH v6 09/11] media: uapi: Add audio rate controls support

2023-10-17 Thread Shengjiu Wang
On Tue, Oct 17, 2023 at 9:37 PM Hans Verkuil wrote: > > On 17/10/2023 15:11, Shengjiu Wang wrote: > > On Mon, Oct 16, 2023 at 9:16 PM Hans Verkuil wrote: > >> > >> Hi Shengjiu, > >> > >> On 13/10/2023 10:31, Shengjiu Wang wrote: > >>

Re: [RFC PATCH v6 09/11] media: uapi: Add audio rate controls support

2023-10-17 Thread Shengjiu Wang
On Mon, Oct 16, 2023 at 9:16 PM Hans Verkuil wrote: > > Hi Shengjiu, > > On 13/10/2023 10:31, Shengjiu Wang wrote: > > Fixed point controls are used by the user to configure > > the audio sample rate to driver. > > > > Add V4L2_CID_ASRC_SOURCE_RATE and V4L2_CID

[RFC PATCH v6 11/11] media: viaudm2m: add virtual driver for audio memory to memory

2023-10-13 Thread Shengjiu Wang
to output buffer. Signed-off-by: Shengjiu Wang --- drivers/media/test-drivers/Kconfig| 9 + drivers/media/test-drivers/Makefile | 1 + drivers/media/test-drivers/viaudm2m.c | 707 ++ 3 files changed, 717 insertions(+) create mode 100644 drivers/media/test-drivers

[RFC PATCH v6 10/11] media: imx-asrc: Add memory to memory driver

2023-10-13 Thread Shengjiu Wang
-off-by: Shengjiu Wang --- drivers/media/platform/nxp/Kconfig| 12 + drivers/media/platform/nxp/Makefile |1 + drivers/media/platform/nxp/imx-asrc.c | 1248 + 3 files changed, 1261 insertions(+) create mode 100644 drivers/media/platform/nxp/imx-asrc.c diff --git

[RFC PATCH v6 09/11] media: uapi: Add audio rate controls support

2023-10-13 Thread Shengjiu Wang
Fixed point controls are used by the user to configure the audio sample rate to driver. Add V4L2_CID_ASRC_SOURCE_RATE and V4L2_CID_ASRC_DEST_RATE new IDs for ASRC rate control. Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/common.rst| 1 + .../media/v4l/ext-ctrls-fixed

[RFC PATCH v6 08/11] media: uapi: define audio sample format fourcc type

2023-10-13 Thread Shengjiu Wang
till use the fourcc format. Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/pixfmt-audio.rst | 202 ++ .../userspace-api/media/v4l/pixfmt.rst| 1 + drivers/media/v4l2-core/v4l2-ioctl.c | 36 include/uapi/linux/videodev2.h|

[RFC PATCH v6 07/11] media: v4l2: Add audio capture and output support

2023-10-13 Thread Shengjiu Wang
device is named "/dev/v4l-audioX". Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/buffer.rst| 6 ++ .../media/v4l/dev-audio-mem2mem.rst | 71 +++ .../userspace-api/media/v4l/devices.rst | 1 + .../media/v4l/vidioc-en

[RFC PATCH v6 06/11] media: uapi: Add V4L2_CAP_AUDIO_M2M capability flag

2023-10-13 Thread Shengjiu Wang
V4L2_CAP_AUDIO_M2M is similar to V4L2_CAP_VIDEO_M2M flag. It is used for audio memory to memory case. Signed-off-by: Shengjiu Wang --- Documentation/userspace-api/media/v4l/vidioc-querycap.rst| 3 +++ Documentation/userspace-api/media/videodev2.h.rst.exceptions | 1 + include/uapi/linux

[RFC PATCH v6 05/11] ASoC: fsl_easrc: register m2m platform device

2023-10-13 Thread Shengjiu Wang
Register m2m platform device,that user can use M2M feature. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index dc603bb383e2..8ba6f045f425 100644

[RFC PATCH v6 04/11] ASoC: fsl_asrc: register m2m platform device

2023-10-13 Thread Shengjiu Wang
Register m2m platform device, that user can use M2M feature. Defined platform data structure and platform driver name. Signed-off-by: Shengjiu Wang --- include/sound/fsl_asrc_common.h | 23 +++ sound/soc/fsl/fsl_asrc.c| 18 ++ 2 files changed, 41

[RFC PATCH v6 03/11] ASoC: fsl_asrc: move fsl_asrc_common.h to include/sound

2023-10-13 Thread Shengjiu Wang
Move fsl_asrc_common.h to include/sound that it can be included from other drivers. Signed-off-by: Shengjiu Wang --- {sound/soc/fsl => include/sound}/fsl_asrc_common.h | 0 sound/soc/fsl/fsl_asrc.h | 2 +- sound/soc/fsl/fsl_asrc_dma.c

[RFC PATCH v6 02/11] ASoC: fsl_easrc: define functions for memory to memory usage

2023-10-13 Thread Shengjiu Wang
ASRC can be used on memory to memory case, define several functions for m2m usage and export them as function pointer. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 193 ++ sound/soc/fsl/fsl_easrc.h | 4 + 2 files changed, 197 insertions

[RFC PATCH v6 01/11] ASoC: fsl_asrc: define functions for memory to memory usage

2023-10-13 Thread Shengjiu Wang
output length according to input length m2m_get_maxburst: burst size for dma m2m_pair_suspend: suspend function of pair, optional. m2m_pair_resume: resume function of pair get_output_fifo_size: get remaining data size in FIFO Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_asrc.c| 126

[RFC PATCH v6 00/11] Add audio support in v4l2 framework

2023-10-13 Thread Shengjiu Wang
dio m2m case. - with modification in v4l-utils, pass v4l2-compliance test. changes in v2: - decouple the implementation in v4l2 and ALSA - implement the memory to memory driver as a platfrom driver and move it to driver/media - move fsl_asrc_common.h to include/sound folder Shengjiu Wang (11): AS

Re: [PATCH] ASoC: fsl: Fix PM disable depth imbalance in fsl_easrc_probe

2023-10-08 Thread Shengjiu Wang
On Wed, Oct 4, 2023 at 3:12 PM Zhang Shurong wrote: > > The pm_runtime_enable will increase power disable depth. Thus > a pairing decrement is needed on the error handling path to > keep it balanced according to context. We fix it by calling > pm_runtime_disable when error returns. > Please add

Re: [RFC PATCH v5 01/11] ASoC: fsl_asrc: define functions for memory to memory usage

2023-10-07 Thread Shengjiu Wang
Hi On Mon, Oct 2, 2023 at 11:08 PM Mark Brown wrote: > > On Thu, Sep 28, 2023 at 05:00:09PM +0800, Shengjiu Wang wrote: > > > m2m_start_part_one: first part of the start steps > > m2m_start_part_two: second part of the start steps > > m2m_stop_part_on

[RFC PATCH v5 11/11] media: audm2m: add virtual driver for audio memory to memory

2023-09-28 Thread Shengjiu Wang
to output buffer. Signed-off-by: Shengjiu Wang --- drivers/media/test-drivers/Kconfig | 9 + drivers/media/test-drivers/Makefile | 1 + drivers/media/test-drivers/audm2m.c | 808 3 files changed, 818 insertions(+) create mode 100644 drivers/media/test-drivers/audm2m.c

[RFC PATCH v5 10/11] media: imx-asrc: Add memory to memory driver

2023-09-28 Thread Shengjiu Wang
-off-by: Shengjiu Wang --- drivers/media/platform/nxp/Kconfig| 12 + drivers/media/platform/nxp/Makefile |1 + drivers/media/platform/nxp/imx-asrc.c | 1251 + 3 files changed, 1264 insertions(+) create mode 100644 drivers/media/platform/nxp/imx-asrc.c diff --git

[RFC PATCH v5 09/11] media: uapi: define audio sample format fourcc type

2023-09-28 Thread Shengjiu Wang
till use the fourcc format. Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/pixfmt-audio.rst | 277 ++ .../userspace-api/media/v4l/pixfmt.rst| 1 + drivers/media/v4l2-core/v4l2-ioctl.c | 51 include/uapi/linux/videodev2.h|

[RFC PATCH v5 08/11] media: uapi: Add audio rate controls support

2023-09-28 Thread Shengjiu Wang
Audio rate controls is used for user to configure the audio sample rate to driver. Add V4L2_CID_ASRC_SOURCE_RATE and V4L2_CID_ASRC_DEST_RATE new ID for ASRC rate control. Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/common.rst| 1 + .../media/v4l/ext-ctrls-asrc

[RFC PATCH v5 07/11] media: v4l2: Add audio capture and output support

2023-09-28 Thread Shengjiu Wang
device is named "/dev/v4l-audioX". Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/buffer.rst| 6 ++ .../media/v4l/dev-audio-mem2mem.rst | 71 +++ .../userspace-api/media/v4l/devices.rst | 1 + .../media/v4l/vidioc-en

[RFC PATCH v5 06/11] media: uapi: Add V4L2_CAP_AUDIO_M2M capability flag

2023-09-28 Thread Shengjiu Wang
V4L2_CAP_AUDIO_M2M is similar to V4L2_CAP_VIDEO_M2M flag. It is used for audio memory to memory case. Signed-off-by: Shengjiu Wang --- Documentation/userspace-api/media/v4l/vidioc-querycap.rst| 3 +++ Documentation/userspace-api/media/videodev2.h.rst.exceptions | 1 + include/uapi/linux

[RFC PATCH v5 05/11] ASoC: fsl_easrc: register m2m platform device

2023-09-28 Thread Shengjiu Wang
Register m2m platform device,that user can use M2M feature. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index 50aee04e7915..cf1f559e825c 100644

[RFC PATCH v5 04/11] ASoC: fsl_asrc: register m2m platform device

2023-09-28 Thread Shengjiu Wang
Register m2m platform device, that user can use M2M feature. Defined platform data structure and platform driver name. Signed-off-by: Shengjiu Wang --- include/sound/fsl_asrc_common.h | 23 +++ sound/soc/fsl/fsl_asrc.c| 18 ++ 2 files changed, 41

[RFC PATCH v5 03/11] ASoC: fsl_asrc: move fsl_asrc_common.h to include/sound

2023-09-28 Thread Shengjiu Wang
Move fsl_asrc_common.h to include/sound that it can be included from other drivers. Signed-off-by: Shengjiu Wang --- {sound/soc/fsl => include/sound}/fsl_asrc_common.h | 0 sound/soc/fsl/fsl_asrc.h | 2 +- sound/soc/fsl/fsl_asrc_dma.c

[RFC PATCH v5 02/11] ASoC: fsl_easrc: define functions for memory to memory usage

2023-09-28 Thread Shengjiu Wang
ASRC can be used on memory to memory case, define several functions for m2m usage and export them as function pointer. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 195 ++ sound/soc/fsl/fsl_easrc.h | 6 ++ 2 files changed, 201 insertions

[RFC PATCH v5 01/11] ASoC: fsl_asrc: define functions for memory to memory usage

2023-09-28 Thread Shengjiu Wang
-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_asrc.c| 118 sound/soc/fsl/fsl_asrc.h| 2 + sound/soc/fsl/fsl_asrc_common.h | 35 ++ 3 files changed, 155 insertions(+) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index

[RFC PATCH v5 00/11] Add audio support in v4l2 framework

2023-09-28 Thread Shengjiu Wang
ges in v2: - decouple the implementation in v4l2 and ALSA - implement the memory to memory driver as a platfrom driver and move it to driver/media - move fsl_asrc_common.h to include/sound folder Shengjiu Wang (11): ASoC: fsl_asrc: define functions for memory to memory usage ASoC: fsl_easrc: def

Re: [RFC PATCH v4 09/11] media: uapi: Add V4L2_CID_USER_IMX_ASRC_RATIO_MOD control

2023-09-22 Thread Shengjiu Wang
On Fri, Sep 22, 2023 at 4:54 PM Hans Verkuil wrote: > > Hi Shengjiu, > > On 22/09/2023 04:51, Shengjiu Wang wrote: > > On Thu, Sep 21, 2023 at 10:09 PM Hans Verkuil wrote: > >> > >> On 21/09/2023 13:13, Shengjiu Wang wrote: > >>> On

Re: [RFC PATCH v3 6/9] media: v4l2: Add audio capture and output support

2023-09-22 Thread Shengjiu Wang
On Wed, Sep 20, 2023 at 6:12 PM Hans Verkuil wrote: > > Hi Shengjiu, > > I just noticed you posted a v4, but I expect that my comments below are still > valid... > > On 14/09/2023 07:54, Shengjiu Wang wrote: > > Audio signal processing has the requirement for m

Re: [RFC PATCH v4 09/11] media: uapi: Add V4L2_CID_USER_IMX_ASRC_RATIO_MOD control

2023-09-21 Thread Shengjiu Wang
On Thu, Sep 21, 2023 at 10:09 PM Hans Verkuil wrote: > > On 21/09/2023 13:13, Shengjiu Wang wrote: > > On Thu, Sep 21, 2023 at 3:11 PM Hans Verkuil wrote: > >> > >> On 21/09/2023 08:55, Shengjiu Wang wrote: > >>> On Wed, Sep 20, 2023 at 6:19 PM Hans Verk

Re: [RFC PATCH v4 09/11] media: uapi: Add V4L2_CID_USER_IMX_ASRC_RATIO_MOD control

2023-09-21 Thread Shengjiu Wang
On Thu, Sep 21, 2023 at 3:11 PM Hans Verkuil wrote: > > On 21/09/2023 08:55, Shengjiu Wang wrote: > > On Wed, Sep 20, 2023 at 6:19 PM Hans Verkuil wrote: > >> > >> On 20/09/2023 11:32, Shengjiu Wang wrote: > >>> The input clock and output clock may no

Re: [RFC PATCH v4 09/11] media: uapi: Add V4L2_CID_USER_IMX_ASRC_RATIO_MOD control

2023-09-21 Thread Shengjiu Wang
On Wed, Sep 20, 2023 at 6:19 PM Hans Verkuil wrote: > > On 20/09/2023 11:32, Shengjiu Wang wrote: > > The input clock and output clock may not be the accurate > > rate as the sample rate, there is some drift, so the convert > > ratio of i.MX ASRC module need to be changed

[PATCH] ASoC: fsl-asoc-card: use integer type for fll_id and pll_id

2023-09-20 Thread Shengjiu Wang
d at probe, the output sound frequency is wrong. So change the fll_id and pll_id initial value, still keep machine driver's behavior same as before. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl-asoc-card.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sound/s

[RFC PATCH v4 11/11] media: imx-asrc: Add memory to memory driver

2023-09-20 Thread Shengjiu Wang
-off-by: Shengjiu Wang --- drivers/media/platform/nxp/Kconfig| 12 + drivers/media/platform/nxp/Makefile |1 + drivers/media/platform/nxp/imx-asrc.c | 1058 + 3 files changed, 1071 insertions(+) create mode 100644 drivers/media/platform/nxp/imx-asrc.c diff --git

[RFC PATCH v4 10/11] media: audm2m: add virtual driver for audio memory to memory

2023-09-20 Thread Shengjiu Wang
to output buffer. Signed-off-by: Shengjiu Wang --- drivers/media/test-drivers/Kconfig | 9 + drivers/media/test-drivers/Makefile | 1 + drivers/media/test-drivers/audm2m.c | 767 3 files changed, 777 insertions(+) create mode 100644 drivers/media/test-drivers/audm2m.c

[RFC PATCH v4 09/11] media: uapi: Add V4L2_CID_USER_IMX_ASRC_RATIO_MOD control

2023-09-20 Thread Shengjiu Wang
The input clock and output clock may not be the accurate rate as the sample rate, there is some drift, so the convert ratio of i.MX ASRC module need to be changed according to actual clock rate. Add V4L2_CID_USER_IMX_ASRC_RATIO_MOD control for user to adjust the ratio. Signed-off-by: Shengjiu

[RFC PATCH v4 08/11] media: v4l2: Add audio capture and output support

2023-09-20 Thread Shengjiu Wang
device is named "/dev/v4l-audioX". Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/buffer.rst| 6 ++ .../userspace-api/media/v4l/dev-audio.rst | 63 +++ .../userspace-api/media/v4l/devices.rst | 1 + .../media/v4l/vidioc-en

[RFC PATCH v4 07/11] media: uapi: Add V4L2_AUDIO_FMT_LPCM fourcc format

2023-09-20 Thread Shengjiu Wang
Linear Pulse-Code Modulation is used to represent audio samples in buffer, the samples for each channel are interleaved. Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/audio-formats.rst | 15 + .../media/v4l/pixfmt-aud-lpcm.rst | 61

[RFC PATCH v4 06/11] media: uapi: Add V4L2_CAP_AUDIO_M2M capability flag

2023-09-20 Thread Shengjiu Wang
V4L2_CAP_AUDIO_M2M is similar to V4L2_CAP_VIDEO_M2M flag. It is used for audio memory to memory case. Signed-off-by: Shengjiu Wang --- Documentation/userspace-api/media/v4l/vidioc-querycap.rst| 3 +++ Documentation/userspace-api/media/videodev2.h.rst.exceptions | 1 + include/uapi/linux

[RFC PATCH v4 05/11] ASoC: fsl_easrc: register m2m platform device

2023-09-20 Thread Shengjiu Wang
Register m2m platform device,that user can use M2M feature. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 13 + 1 file changed, 13 insertions(+) diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index f517b407672d..b719d517f9b4 100644 --- a/sound/soc

[RFC PATCH v4 04/11] ASoC: fsl_asrc: register m2m platform device

2023-09-20 Thread Shengjiu Wang
Register m2m platform device, that user can use M2M feature. Defined platform data structure and platform driver name. Signed-off-by: Shengjiu Wang --- include/sound/fsl_asrc_common.h | 12 sound/soc/fsl/fsl_asrc.c| 12 2 files changed, 24 insertions(+) diff

[RFC PATCH v4 03/11] ASoC: fsl_asrc: move fsl_asrc_common.h to include/sound

2023-09-20 Thread Shengjiu Wang
Move fsl_asrc_common.h to include/sound that it can be included from other drivers. Signed-off-by: Shengjiu Wang --- {sound/soc/fsl => include/sound}/fsl_asrc_common.h | 0 sound/soc/fsl/fsl_asrc.h | 2 +- sound/soc/fsl/fsl_asrc_dma.c

[RFC PATCH v4 02/11] ASoC: fsl_easrc: define functions for memory to memory usage

2023-09-20 Thread Shengjiu Wang
ASRC can be used on memory to memory case, define several functions for m2m usage and export them as function pointer. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 226 ++ sound/soc/fsl/fsl_easrc.h | 6 + 2 files changed, 232 insertions

[RFC PATCH v4 01/11] ASoC: fsl_asrc: define functions for memory to memory usage

2023-09-20 Thread Shengjiu Wang
-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_asrc.c| 150 sound/soc/fsl/fsl_asrc.h| 2 + sound/soc/fsl/fsl_asrc_common.h | 42 + 3 files changed, 194 insertions(+) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index

[RFC PATCH v4 00/11] Add audio support in v4l2 framework

2023-09-20 Thread Shengjiu Wang
n in v4l-utils, pass v4l2-compliance test. changes in v2: - decouple the implementation in v4l2 and ALSA - implement the memory to memory driver as a platfrom driver and move it to driver/media - move fsl_asrc_common.h to include/sound folder Shengjiu Wang (11): ASoC: fsl_asrc: define functions for m

Re: [RFC PATCH v3 6/9] media: v4l2: Add audio capture and output support

2023-09-19 Thread Shengjiu Wang
On Thu, Sep 14, 2023 at 6:17 PM Sakari Ailus wrote: > > Hi Shenjiu, > > Thanks for the update. > > On Thu, Sep 14, 2023 at 01:54:02PM +0800, Shengjiu Wang wrote: > > Audio signal processing has the requirement for memory to > > memory similar as Video. > > &

[PATCH] ASoC: fsl_sai: Don't disable bitclock for i.MX8MP

2023-09-19 Thread Shengjiu Wang
clock with transmitter") Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_sai.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 1e4020fae05a..8a9a30dd31e2 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sou

[PATCH] ASoC: imx-audmix: Fix return error with devm_clk_get()

2023-09-15 Thread Shengjiu Wang
Signed-off-by: Shengjiu Wang --- sound/soc/fsl/imx-audmix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/fsl/imx-audmix.c b/sound/soc/fsl/imx-audmix.c index 0b58df56f4da..aeb81aa61184 100644 --- a/sound/soc/fsl/imx-audmix.c +++ b/sound/soc/fsl/imx-audmix.c @@ -315,7 +315,7

[RFC PATCH v3 9/9] media: imx-asrc: Add memory to memory driver

2023-09-14 Thread Shengjiu Wang
-off-by: Shengjiu Wang --- drivers/media/platform/nxp/Kconfig| 12 + drivers/media/platform/nxp/Makefile |1 + drivers/media/platform/nxp/imx-asrc.c | 1058 + 3 files changed, 1071 insertions(+) create mode 100644 drivers/media/platform/nxp/imx-asrc.c diff --git

[RFC PATCH v3 8/9] media: audm2m: add virtual driver for audio memory to memory

2023-09-14 Thread Shengjiu Wang
to output buffer. Signed-off-by: Shengjiu Wang --- drivers/media/test-drivers/Kconfig | 9 + drivers/media/test-drivers/Makefile | 1 + drivers/media/test-drivers/audm2m.c | 767 3 files changed, 777 insertions(+) create mode 100644 drivers/media/test-drivers/audm2m.c

[RFC PATCH v3 7/9] media: uapi: Add V4L2_CID_USER_IMX_ASRC_RATIO_MOD control

2023-09-14 Thread Shengjiu Wang
The input clock and output clock may not be the accurate rate as the sample rate, there is some drift, so the convert ratio of i.MX ASRC module need to be changed according to actual clock rate. Add V4L2_CID_USER_IMX_ASRC_RATIO_MOD control for user to adjust the ratio. Signed-off-by: Shengjiu

[RFC PATCH v3 6/9] media: v4l2: Add audio capture and output support

2023-09-14 Thread Shengjiu Wang
V4L2_AUDIO_FMT_LPCM format type for audio. Defined V4L2_CAP_AUDIO_M2M capability type for audio memory to memory case. The created audio device is named "/dev/v4l-audioX". Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/audio-formats.rst | 15 + .../userspace-api/media/v4l/

[RFC PATCH v3 5/9] ASoC: fsl_easrc: register m2m platform device

2023-09-14 Thread Shengjiu Wang
Register m2m platform device,that user can use M2M feature. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 13 + 1 file changed, 13 insertions(+) diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index f517b407672d..b719d517f9b4 100644 --- a/sound/soc

[RFC PATCH v3 4/9] ASoC: fsl_asrc: register m2m platform device

2023-09-14 Thread Shengjiu Wang
Register m2m platform device, that user can use M2M feature. Defined platform data structure and platform driver name. Signed-off-by: Shengjiu Wang --- include/sound/fsl_asrc_common.h | 12 sound/soc/fsl/fsl_asrc.c| 12 2 files changed, 24 insertions(+) diff

[RFC PATCH v3 3/9] ASoC: fsl_asrc: move fsl_asrc_common.h to include/sound

2023-09-14 Thread Shengjiu Wang
Move fsl_asrc_common.h to include/sound that it can be included from other drivers. Signed-off-by: Shengjiu Wang --- {sound/soc/fsl => include/sound}/fsl_asrc_common.h | 0 sound/soc/fsl/fsl_asrc.h | 2 +- sound/soc/fsl/fsl_asrc_dma.c

[RFC PATCH v3 1/9] ASoC: fsl_asrc: define functions for memory to memory usage

2023-09-14 Thread Shengjiu Wang
-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_asrc.c| 150 sound/soc/fsl/fsl_asrc.h| 2 + sound/soc/fsl/fsl_asrc_common.h | 42 + 3 files changed, 194 insertions(+) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index

[RFC PATCH v3 2/9] ASoC: fsl_easrc: define functions for memory to memory usage

2023-09-14 Thread Shengjiu Wang
ASRC can be used on memory to memory case, define several functions for m2m usage and export them as function pointer. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 226 ++ sound/soc/fsl/fsl_easrc.h | 6 + 2 files changed, 232 insertions

[RFC PATCH v3 0/9] Add audio support in v4l2 framework

2023-09-14 Thread Shengjiu Wang
e memory to memory driver as a platfrom driver and move it to driver/media - move fsl_asrc_common.h to include/sound folder Shengjiu Wang (9): ASoC: fsl_asrc: define functions for memory to memory usage ASoC: fsl_easrc: define functions for memory to memory usage ASoC: fsl_asrc: move fsl_

Re: [PATCH v2] ASoC: imx-rpmsg: Set ignore_pmdown_time for dai_link

2023-09-13 Thread Shengjiu Wang
ediately before MCLK is turned off. > > Take WM8962 as an example, if MCLK is disabled before DAPM power down > playback stream, FIFO error will arise in WM8962 which will have bad > impact on playback next. > > Signed-off-by: Chancel Liu Acked-by: Shengjiu Wang Best regards Wan

Re: [PATCH] ASoC: imx-rpmsg: Set ignore_pmdown_time for dai_link

2023-09-12 Thread Shengjiu Wang
On Tue, Sep 12, 2023 at 2:34 PM Chancel Liu wrote: > > i.MX rpmsg sound cards work on codec slave mode. MCLK will be disabled > by CPU DAI driver in hw_free(). Some codec requires MCLK present at > power up/down sequence. So need to set ignore_pmdown_time to power down > codec immediately before

[PATCH] ASoC: fsl: imx-pcm-rpmsg: Add SNDRV_PCM_INFO_BATCH flag

2023-09-11 Thread Shengjiu Wang
on time. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/imx-pcm-rpmsg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c index d63782b8bdef..bb736d45c9e0 100644 --- a/sound/soc/fsl/imx-pcm-rpmsg.c +++ b/sound/soc/fsl/imx-pcm-rpmsg.c @@ -1

Re: [RFC PATCH v2 0/7] Add audio support in v4l2 framework

2023-08-29 Thread Shengjiu Wang
On Fri, Aug 25, 2023 at 10:15 PM Hans Verkuil wrote: > > On 25/08/2023 15:54, Takashi Iwai wrote: > > On Fri, 25 Aug 2023 05:46:43 +0200, > > Shengjiu Wang wrote: > >> > >> On Fri, Aug 25, 2023 at 4:21 AM Mark Brown wrote: > >>> > >>>

Re: [RFC PATCH v2 0/7] Add audio support in v4l2 framework

2023-08-24 Thread Shengjiu Wang
On Fri, Aug 25, 2023 at 4:21 AM Mark Brown wrote: > > On Thu, Aug 24, 2023 at 07:03:09PM +0200, Takashi Iwai wrote: > > Shengjiu Wang wrote: > > > > But there are several issues: > > > 1. Need to create sound cards. ASRC module support multi instances, then >

Re: [RFC PATCH v2 0/7] Add audio support in v4l2 framework

2023-08-23 Thread Shengjiu Wang
On Fri, Aug 11, 2023 at 7:05 PM Shengjiu Wang wrote: > > Hi Mark, Takashi > > On Thu, Aug 3, 2023 at 9:11 PM Shengjiu Wang wrote: > > > > On Thu, Aug 3, 2023 at 1:28 AM Mark Brown wrote: > > > > > > On Wed, Aug 02, 2023 at 10:41:43PM +0800, Shengjiu Wa

Re: [RFC PATCH v2 0/7] Add audio support in v4l2 framework

2023-08-11 Thread Shengjiu Wang
Hi Mark, Takashi On Thu, Aug 3, 2023 at 9:11 PM Shengjiu Wang wrote: > > On Thu, Aug 3, 2023 at 1:28 AM Mark Brown wrote: > > > > On Wed, Aug 02, 2023 at 10:41:43PM +0800, Shengjiu Wang wrote: > > > > > Currently the ASRC in ALSA is to connect to another

Re: [RFC PATCH v2 0/7] Add audio support in v4l2 framework

2023-08-04 Thread Shengjiu Wang
On Wed, Aug 2, 2023 at 8:28 PM Hans Verkuil wrote: > > On 02/08/2023 14:02, Shengjiu Wang wrote: > > On Wed, Aug 2, 2023 at 7:22 PM Takashi Iwai wrote: > >> > >> On Wed, 02 Aug 2023 09:32:37 +0200, > >> Hans Verkuil wrote: > >>> > >>&g

Re: [RFC PATCH v2 0/7] Add audio support in v4l2 framework

2023-08-03 Thread Shengjiu Wang
On Thu, Aug 3, 2023 at 1:28 AM Mark Brown wrote: > > On Wed, Aug 02, 2023 at 10:41:43PM +0800, Shengjiu Wang wrote: > > > Currently the ASRC in ALSA is to connect to another I2S device as > > a sound card. But we'd like to the ASRC can be used by user space directl

Re: [RFC PATCH v2 0/7] Add audio support in v4l2 framework

2023-08-02 Thread Shengjiu Wang
On Wed, Aug 2, 2023 at 8:08 PM Takashi Iwai wrote: > > On Wed, 02 Aug 2023 14:02:29 +0200, > Shengjiu Wang wrote: > > > > On Wed, Aug 2, 2023 at 7:22 PM Takashi Iwai wrote: > > > > > > On Wed, 02 Aug 2023 09:32:37 +0200, > > > Hans Verkuil wrote:

Re: [RFC PATCH v2 0/7] Add audio support in v4l2 framework

2023-08-02 Thread Shengjiu Wang
On Wed, Aug 2, 2023 at 7:22 PM Takashi Iwai wrote: > > On Wed, 02 Aug 2023 09:32:37 +0200, > Hans Verkuil wrote: > > > > Hi all, > > > > On 25/07/2023 08:12, Shengjiu Wang wrote: > > > Audio signal processing has the requirement for memory to > > &

Re: [PATCH v2 0/3] Update the register list of MICFIL

2023-08-02 Thread Shengjiu Wang
e_verid > > > Chancel Liu (3): > ASoC: fsl_micfil: Add new registers and new bit definition > ASoC: fsl_micfil: Add fsl_micfil_use_verid function > ASoC: fsl_micfil: Use SET_SYSTEM_SLEEP_PM_OPS to simplify PM > Acked-by: Shengjiu Wang Best regards Wang She

Re: [RFC PATCH v2 4/7] media: v4l2: Add audio capture and output support

2023-08-01 Thread Shengjiu Wang
On Fri, Jul 28, 2023 at 3:59 PM Tomasz Figa wrote: > > Hi Shengjiu, > > On Tue, Jul 25, 2023 at 02:12:17PM +0800, Shengjiu Wang wrote: > > Audio signal processing has the requirement for memory to > > memory similar as Video. > > > > This patch is to add thi

Re: [RFC PATCH v2 4/7] media: v4l2: Add audio capture and output support

2023-07-31 Thread Shengjiu Wang
On Fri, Jul 28, 2023 at 3:59 PM Tomasz Figa wrote: > Hi Shengjiu, > > On Tue, Jul 25, 2023 at 02:12:17PM +0800, Shengjiu Wang wrote: > > Audio signal processing has the requirement for memory to > > memory similar as Video. > > > > This patch is to add this s

Re: [PATCH] ASoC: fsl_micfil: refactor deprecated strncpy

2023-07-28 Thread Shengjiu Wang
mem_pad` amongst others. > > [1]: > www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings > [2]: manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html > [3]: https://elixir.bootlin.com/linux/v6.3/source/lib/string.c#L183 > > Link: https://gi

Re: [PATCH 2/3] ASoC: fsl_micfil: Add fsl_micfil_check_version function

2023-07-28 Thread Shengjiu Wang
On Thu, Jul 27, 2023 at 11:15 AM Chancel Liu wrote: > fsl_micfil_check_version can help to parse the version info in VERID > and PARAM registers. Since the two registers are added only on i.MX93 > platform, a member flag called check_version is introduced to soc data > structure which indicates

Re: [PATCH v2 1/1] ASoC: imx-audmux: fix return value checks of clk_prepare_enable()

2023-07-28 Thread Shengjiu Wang
On Sat, Jul 22, 2023 at 8:38 PM Yuanjun Gong wrote: > check the return value of clk_prepare_enable(), and if > clk_prepare_enable() gets an unexpected return value, > imx_audmux_suspend() and imx_audmux_resume() should return > the error value. > > please use the ./scripts/get_maintainer.pl to

[RFC PATCH v2 7/7] ASoC: fsl_easrc: register m2m platform device

2023-07-25 Thread Shengjiu Wang
Register m2m platform device,that user can use M2M feature. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 13 + 1 file changed, 13 insertions(+) diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index b735b24badc2..b5befefa8fbe 100644 --- a/sound/soc

[RFC PATCH v2 6/7] ASoC: fsl_asrc: register m2m platform device

2023-07-25 Thread Shengjiu Wang
Register m2m platform device, that user can use M2M feature. Signed-off-by: Shengjiu Wang --- include/sound/fsl_asrc_common.h | 2 ++ sound/soc/fsl/fsl_asrc.c| 12 2 files changed, 14 insertions(+) diff --git a/include/sound/fsl_asrc_common.h b/include/sound

[RFC PATCH v2 5/7] media: imx: fsl_asrc: Add memory to memory driver

2023-07-25 Thread Shengjiu Wang
-off-by: Shengjiu Wang --- drivers/media/platform/nxp/Kconfig| 12 + drivers/media/platform/nxp/Makefile | 1 + drivers/media/platform/nxp/fsl_asrc_m2m.c | 962 ++ include/sound/fsl_asrc_common.h | 9 + 4 files changed, 984 insertions(+) create mode

[RFC PATCH v2 4/7] media: v4l2: Add audio capture and output support

2023-07-25 Thread Shengjiu Wang
device is named "/dev/audioX". Signed-off-by: Shengjiu Wang --- .../media/common/videobuf2/videobuf2-v4l2.c | 4 ++ drivers/media/v4l2-core/v4l2-dev.c| 17 ++ drivers/media/v4l2-core/v4l2-ioctl.c | 52 +++ include/media/

[RFC PATCH v2 3/7] ASoC: fsl_asrc: move fsl_asrc_common.h to include/sound

2023-07-25 Thread Shengjiu Wang
Move fsl_asrc_common.h to include/sound that it can be included from other drivers. Signed-off-by: Shengjiu Wang --- {sound/soc/fsl => include/sound}/fsl_asrc_common.h | 0 sound/soc/fsl/fsl_asrc.h | 2 +- sound/soc/fsl/fsl_asrc_dma.c

[RFC PATCH v2 2/7] ASoC: fsl_easrc: define functions for memory to memory usage

2023-07-25 Thread Shengjiu Wang
ASRC can be used on memory to memory case, define several functions for m2m usage and export them as function pointer. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 214 ++ sound/soc/fsl/fsl_easrc.h | 6 ++ 2 files changed, 220 insertions

[RFC PATCH v2 1/7] ASoC: fsl_asrc: define functions for memory to memory usage

2023-07-25 Thread Shengjiu Wang
format is supported or not m2m_calc_out_len: calculate output length according to input length m2m_get_maxburst: burst size for dma m2m_pair_suspend: suspend function of pair m2m_pair_resume: resume function of pair get_output_fifo_size: get remaining data size in FIFO Signed-off-by: Shengjiu Wang

[RFC PATCH v2 0/7] Add audio support in v4l2 framework

2023-07-25 Thread Shengjiu Wang
lude/sound folder Shengjiu Wang (7): ASoC: fsl_asrc: define functions for memory to memory usage ASoC: fsl_easrc: define functions for memory to memory usage ASoC: fsl_asrc: move fsl_asrc_common.h to include/sound media: v4l2: Add audio capture and output support media: imx: fsl_asrc:

<    1   2   3   4   5   6   7   >