Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp327621lqt; Mon, 18 Mar 2024 08:57:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUIbrQlD3zUAlY5+RyzbzhWfpJaSwoDq8Wktbjort6A9Rps8MKMbyTZfeblRydNnf0dgbrUunEKFqMMpUtkGeqgTfg4QiEahcDt59WrIQ== X-Google-Smtp-Source: AGHT+IEk85dXbkspFooVSqm5I9GpFv/0m6oyEto5m8YaYlEMieVaesZV8N4V1o7ljkRLE/x/MnQk X-Received: by 2002:ac8:7fcf:0:b0:430:ce90:5704 with SMTP id b15-20020ac87fcf000000b00430ce905704mr4256455qtk.51.1710777423480; Mon, 18 Mar 2024 08:57:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710777423; cv=pass; d=google.com; s=arc-20160816; b=0zVfH7eHj1IHiwQy1DvWHYTQ/RxfgY167Eh0GHsVHw1HRPu1ATT6Ib+bFrdC4PrrQJ 0Nx8MfUUGkBJ3t583lBNw95wSFdJkc2YXVafaFmJBKzlZP16YBm0mZRxLdflkkFiivEB icTKtJp2krhQFMLnphlo837b9zNoc1VA+3Du3Phg3yYhHxfGXTAODTm4e0SHlHuL1Ve5 vJgoMKWLiimfK/I9/dx/TZgkuj34nuETBdGy/FeN64Fm2Eh7XinkukoEWiZ5vjrEI/9Z 151byYqyfm3uTT5Yr0zxo/wFl5nDEcz39I6siCyk/tZsQJMPTkzmCkZxFVt7kEOLbDPw aEsw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=YVfj9aXZdhjYn+bZyVP6Hz8jiABSc3HZI/ATpvAOsEg=; fh=xwO30vKhxPRRQG8HdZoJT6Bq3DaafZI8qtZCpJ3NFPI=; b=yQKyr71vVGSt9G7pfn2ruAQa2gkoMCRj6X8HhB82Eqzr1iqRACTgzyr7SZVC1N+h+U xuohbay243yNnnxBqFBY69h5EglrNBXoH2wFQQhUnsXTUOmJMJcmUJ476FJ+KEFGJqzs QZVCQYEn5y0tACZo6iaR5QknTGwxfVF4fvtz3meqf2vUtWffgsVqdNdvcd8uYbjEpGI+ mwL3m8ocOoshuSFtXmboqTN+uGgv/zdPCihrX8oKNsZh1lZIvQzHs3mHXLbkaDidkiGB s4PT/HcokXDEGsS+IOiA7sU8FXTQWDcfN4Wb5ayZQ1um9dHFoU5OlpM+ynwUJT+dF8aV POww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-106346-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106346-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o19-20020ac87c53000000b0042ed5a12961si6404647qtv.82.2024.03.18.08.57.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 08:57:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-106346-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-106346-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106346-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 16E071C20ADE for ; Mon, 18 Mar 2024 15:57:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0367552F8F; Mon, 18 Mar 2024 15:56:54 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 294A8535A0; Mon, 18 Mar 2024 15:56:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710777413; cv=none; b=Zwdg3eZSo+5ILDgMLO3mwBHHhIBA7BA+bsLRdIbVOVe3RxkbiVbvOI1t7UCPecgfG+SXvaL2LWs6Sxt3aCb4K9NqPQkb5cRahGMXE4ZEucomAyVoJDiADB7rroEGBW/tMHUA5vCm1u9K6id3vFidlbGxrrO89zGLYDt390l/Kis= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710777413; c=relaxed/simple; bh=dhU7lbEPRS7rgkeUiGG4fgz12gnpXnRqB/7ee+HWw7o=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=kvdyh1mKI21/9mGTn5JUO40aQwSjXjrKnklgq8n7eEwUUSwHKlQdYLK6ujh8R5a1EmIuFD0MPGh2XfVHcqeTWVyBwwXlUn9M40mCvBGLlywy2aNEWkFv7VmwdCHB4GmVp1l7Ae5/sV8fnHxV6OM2ePpGJdR2CzS38x+ge8JY2ag= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B86FC433C7; Mon, 18 Mar 2024 15:56:48 +0000 (UTC) Message-ID: <399da377-c2b6-4226-9108-8a1e776b6f3b@xs4all.nl> Date: Mon, 18 Mar 2024 16:56:47 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v14 00/16] Add audio support in v4l2 framework Content-Language: en-US, nl To: Shengjiu Wang , sakari.ailus@iki.fi, tfiga@chromium.org, m.szyprowski@samsung.com, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org References: <1710150841-26991-1-git-send-email-shengjiu.wang@nxp.com> From: Hans Verkuil Autocrypt: addr=hverkuil@xs4all.nl; keydata= xsFNBFQ84W0BEAC7EF1iL4s3tY8cRTVkJT/297h0Hz0ypA+ByVM4CdU9sN6ua/YoFlr9k0K4 BFUlg7JzJoUuRbKxkYb8mmqOe722j7N3HO8+ofnio5cAP5W0WwDpM0kM84BeHU0aPSTsWiGR yw55SOK2JBSq7hueotWLfJLobMWhQii0Zd83hGT9SIt9uHaHjgwmtTH7MSTIiaY6N14nw2Ud C6Uykc1va0Wqqc2ov5ihgk/2k2SKa02ookQI3e79laOrbZl5BOXNKR9LguuOZdX4XYR3Zi6/ BsJ7pVCK9xkiVf8svlEl94IHb+sa1KrlgGv3fn5xgzDw8Z222TfFceDL/2EzUyTdWc4GaPMC E/c1B4UOle6ZHg02+I8tZicjzj5+yffv1lB5A1btG+AmoZrgf0X2O1B96fqgHx8w9PIpVERN YsmkfxvhfP3MO3oHh8UY1OLKdlKamMneCLk2up1Zlli347KMjHAVjBAiy8qOguKF9k7HOjif JCLYTkggrRiEiE1xg4tblBNj8WGyKH+u/hw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EJFEkdy8C81WRhMdPvHkAIh3RoY1SGcdB7rB3wCzfYkAuCBqaF7Zgfw8xkad KEiQTexRbM1sc/I8ACpla3N26SfQwrfg6V7TIoweP0RwDrcf5PVvwSWsRQp2LxFCkwnCXOra gYmkrmv0duG1FStpY+IIQn1TOkuXrciTVfZY1cZD0aVxwlxXBnUNZZNslldvXFtndxR0SFat sflovhDxKyhFwXOP0Rv8H378/+14TaykknRBIKEc0+lcr+EMOSUR5eg4aURb8Gc3Uc7fgQ6q UssTXzHPyj1hAyDpfu8DzAwlh4kKFTodxSsKAjI45SLjadSc94/5Gy8645Y1KgBzBPTH7Q== In-Reply-To: <1710150841-26991-1-git-send-email-shengjiu.wang@nxp.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Shengjiu, I was about to prepare a pull request for this when I realized that entries for the new drivers need to be added to the MAINTAINERS file. Can you post patches 'v14 17/16' and 'v14/18/16' adding entries for each new driver? Thank you, Hans On 11/03/2024 10:53 am, Shengjiu Wang wrote: > Audio signal processing also has the requirement for memory to > memory similar as Video. > > This asrc memory to memory (memory ->asrc->memory) case is a non > real time use case. > > User fills the input buffer to the asrc module, after conversion, then asrc > sends back the output buffer to user. So it is not a traditional ALSA playback > and capture case. > > It is a specific use case, there is no reference in current kernel. > v4l2 memory to memory is the closed implementation, v4l2 current > support video, image, radio, tuner, touch devices, so it is not > complicated to add support for this specific audio case. > > Because we had implemented the "memory -> asrc ->i2s device-> codec" > use case in ALSA. Now the "memory->asrc->memory" needs > to reuse the code in asrc driver, so the first 3 patches is for refining > the code to make it can be shared by the "memory->asrc->memory" > driver. > > The main change is in the v4l2 side, A /dev/vl4-audioX will be created, > user applications only use the ioctl of v4l2 framework. > > Other change is to add memory to memory support for two kinds of i.MX ASRC > module. > > changes in v14: > - document the reservation of 'AUXX' fourcc format. > - add v4l2_audfmt_to_fourcc() definition. > > changes in v13 > - change 'pixelformat' to 'audioformat' in dev-audio-mem2mem.rst > - add more description for clock drift in ext-ctrls-audio-m2m.rst > - Add "media: v4l2-ctrls: add support for fraction_bits" from Hans > to avoid build issue for kernel test robot > > changes in v12 > - minor changes according to comments > - drop min_buffers_needed = 1 and V4L2_CTRL_FLAG_UPDATE flag > - drop bus_info > > changes in v11 > - add add-fixed-point-test-controls in vivid. > - add v4l2_ctrl_fp_compose() helper function for min and max > > changes in v10 > - remove FIXED_POINT type > - change code base on media: v4l2-ctrls: add support for fraction_bits > - fix issue reported by kernel test robot > - remove module_alias > > changes in v9: > - add MEDIA_ENT_F_PROC_AUDIO_RESAMPLER. > - add MEDIA_INTF_T_V4L_AUDIO > - add media controller support > - refine the vim2m-audio to support 8k<->16k conversion. > > changes in v8: > - refine V4L2_CAP_AUDIO_M2M to be 0x00000008 > - update doc for FIXED_POINT > - address comments for imx-asrc > > changes in v7: > - add acked-by from Mark > - separate commit for fixed point, m2m audio class, audio rate controls > - use INTEGER_MENU for rate, FIXED_POINT for rate offset > - remove used fmts > - address other comments for Hans > > changes in v6: > - use m2m_prepare/m2m_unprepare/m2m_start/m2m_stop to replace > m2m_start_part_one/m2m_stop_part_one, m2m_start_part_two/m2m_stop_part_two. > - change V4L2_CTRL_TYPE_ASRC_RATE to V4L2_CTRL_TYPE_FIXED_POINT > - fix warning by kernel test rebot > - remove some unused format V4L2_AUDIO_FMT_XX > - Get SNDRV_PCM_FORMAT from V4L2_AUDIO_FMT in driver. > - rename audm2m to viaudm2m. > > changes in v5: > - remove V4L2_AUDIO_FMT_LPCM > - define audio pixel format like V4L2_AUDIO_FMT_S8... > - remove rate and format in struct v4l2_audio_format. > - Add V4L2_CID_ASRC_SOURCE_RATE and V4L2_CID_ASRC_DEST_RATE controls > - updata document accordingly. > > changes in v4: > - update document style > - separate V4L2_AUDIO_FMT_LPCM and V4L2_CAP_AUDIO_M2M in separate commit > > changes in v3: > - Modify documents for adding audio m2m support > - Add audio virtual m2m driver > - Defined V4L2_AUDIO_FMT_LPCM format type for audio. > - Defined V4L2_CAP_AUDIO_M2M capability type for audio 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 > > Hans Verkuil (1): > media: v4l2-ctrls: add support for fraction_bits > > Shengjiu Wang (15): > 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 > ASoC: fsl_asrc: register m2m platform device > ASoC: fsl_easrc: register m2m platform device > media: uapi: Add V4L2_CAP_AUDIO_M2M capability flag > media: v4l2: Add audio capture and output support > media: uapi: Define audio sample format fourcc type > media: uapi: Add V4L2_CTRL_CLASS_M2M_AUDIO > media: uapi: Add audio rate controls support > media: uapi: Declare interface types for Audio > media: uapi: Add an entity type for audio resampler > media: vivid: add fixed point test controls > media: imx-asrc: Add memory to memory driver > media: vim2m-audio: add virtual driver for audio memory to memory > > .../media/mediactl/media-types.rst | 11 + > .../userspace-api/media/v4l/buffer.rst | 6 + > .../userspace-api/media/v4l/common.rst | 1 + > .../media/v4l/dev-audio-mem2mem.rst | 71 + > .../userspace-api/media/v4l/devices.rst | 1 + > .../media/v4l/ext-ctrls-audio-m2m.rst | 59 + > .../userspace-api/media/v4l/pixfmt-audio.rst | 100 ++ > .../userspace-api/media/v4l/pixfmt.rst | 1 + > .../media/v4l/vidioc-enum-fmt.rst | 2 + > .../media/v4l/vidioc-g-ext-ctrls.rst | 4 + > .../userspace-api/media/v4l/vidioc-g-fmt.rst | 4 + > .../media/v4l/vidioc-querycap.rst | 3 + > .../media/v4l/vidioc-queryctrl.rst | 11 +- > .../media/videodev2.h.rst.exceptions | 3 + > .../media/common/videobuf2/videobuf2-v4l2.c | 4 + > drivers/media/platform/nxp/Kconfig | 13 + > drivers/media/platform/nxp/Makefile | 1 + > drivers/media/platform/nxp/imx-asrc.c | 1256 +++++++++++++++++ > drivers/media/test-drivers/Kconfig | 10 + > drivers/media/test-drivers/Makefile | 1 + > drivers/media/test-drivers/vim2m-audio.c | 793 +++++++++++ > drivers/media/test-drivers/vivid/vivid-core.h | 2 + > .../media/test-drivers/vivid/vivid-ctrls.c | 26 + > drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 9 + > drivers/media/v4l2-core/v4l2-ctrls-api.c | 1 + > drivers/media/v4l2-core/v4l2-ctrls-core.c | 93 +- > drivers/media/v4l2-core/v4l2-ctrls-defs.c | 10 + > drivers/media/v4l2-core/v4l2-dev.c | 21 + > drivers/media/v4l2-core/v4l2-ioctl.c | 66 + > drivers/media/v4l2-core/v4l2-mem2mem.c | 13 +- > include/media/v4l2-ctrls.h | 13 +- > include/media/v4l2-dev.h | 2 + > include/media/v4l2-ioctl.h | 34 + > .../fsl => include/sound}/fsl_asrc_common.h | 60 + > include/uapi/linux/media.h | 2 + > include/uapi/linux/v4l2-controls.h | 9 + > include/uapi/linux/videodev2.h | 50 +- > sound/soc/fsl/fsl_asrc.c | 144 ++ > sound/soc/fsl/fsl_asrc.h | 4 +- > sound/soc/fsl/fsl_asrc_dma.c | 2 +- > sound/soc/fsl/fsl_easrc.c | 233 +++ > sound/soc/fsl/fsl_easrc.h | 6 +- > 42 files changed, 3128 insertions(+), 27 deletions(-) > create mode 100644 Documentation/userspace-api/media/v4l/dev-audio-mem2mem.rst > create mode 100644 Documentation/userspace-api/media/v4l/ext-ctrls-audio-m2m.rst > create mode 100644 Documentation/userspace-api/media/v4l/pixfmt-audio.rst > create mode 100644 drivers/media/platform/nxp/imx-asrc.c > create mode 100644 drivers/media/test-drivers/vim2m-audio.c > rename {sound/soc/fsl => include/sound}/fsl_asrc_common.h (60%) >