linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Shengjiu Wang <shengjiu.wang@gmail.com>, Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com,
	Xiubo.Lee@gmail.com, linux-kernel@vger.kernel.org,
	Shengjiu Wang <shengjiu.wang@nxp.com>,
	tiwai@suse.com, linux-media@vger.kernel.org, tfiga@chromium.org,
	nicoleotsuka@gmail.com, linuxppc-dev@lists.ozlabs.org,
	broonie@kernel.org, sakari.ailus@iki.fi, perex@perex.cz,
	mchehab@kernel.org, festevam@gmail.com, m.szyprowski@samsung.com
Subject: Re: [RFC PATCH v2 0/7] Add audio support in v4l2 framework
Date: Wed, 2 Aug 2023 14:28:13 +0200	[thread overview]
Message-ID: <d038360b-22a2-3869-cd64-2da827736faa@xs4all.nl> (raw)
In-Reply-To: <CAA+D8ANmBKMp_L2GS=Lp-saMQKja6L4E6No3yP-e=a5YQBD_jQ@mail.gmail.com>

On 02/08/2023 14:02, Shengjiu Wang wrote:
> On Wed, Aug 2, 2023 at 7:22 PM Takashi Iwai <tiwai@suse.de> 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
>>>> memory similar as Video.
>>>>
>>>> This patch is to add this support in v4l2 framework, defined
>>>> new buffer type V4L2_BUF_TYPE_AUDIO_CAPTURE and
>>>> V4L2_BUF_TYPE_AUDIO_OUTPUT, defined new format v4l2_audio_format
>>>> for audio case usage.
>>>>
>>>> The created audio device is named "/dev/audioX".
>>>>
>>>> And add memory to memory support for two kinds of i.MX ASRC
>>>> module
>>>
>>> Before I spend time on this: are the audio maintainers OK with doing
>>> this in V4L2?
>>>
>>> I do want to have a clear statement on this as it is not something I
>>> can decide.
>>
>> Well, I personally don't mind to have some audio capability in v4l2
>> layer.  But, the only uncertain thing for now is whether this is a
>> must-have or not.
>>
> 
> Thanks,  I am also not sure about this.  I am also confused that why
> there is no m2m implementation for audio in the kernel.  Audio also
> has similar decoder encoder post-processing as video.
> 
>>
>> IIRC, the implementation in the sound driver side was never done just
>> because there was no similar implementation?  If so, and if the
>> extension to the v4l2 core layer is needed, shouldn't it be more
>> considered for the possible other route?
>>
> 
> Actually I'd like someone could point me to the other route. I'd like to
> try.
> 
> The reason why I select to extend v4l2 for such audio usage is that v4l2
> looks best for this audio m2m implementation.  v4l2 is designed for m2m
> usage.  if we need implement another 'route',  I don't think it can do better
> that v4l2.
> 
> I appreciate that someone can share his ideas or doable solutions.
> And please don't ignore my request, ignore my patch.

To give a bit more background: if it is decided to use the v4l API for this
(and I have no objection to this from my side since API/framework-wise it is a
good fit for this), then there are a number of things that need to be done to
get this into the media subsystem:

- documentation for the new uAPI
- add support for this to v4l2-ctl
- add v4l2-compliance tests for the new device
- highly desirable: have a virtual driver (similar to vim2m) that supports this:
  it could be as simple as just copy input to output. This helps regression
  testing.
- it might need media controller support as well. TBD.

None of this is particularly complex, but taken all together it is a fair
amount of work that also needs a lot of review time from our side.

I want to add one more option to the mix: drivers/media/core/v4l2-mem2mem.c is
the main m2m framework, but it relies heavily on the videobuf2 framework for
the capture and output queues.

The core vb2 implementation in drivers/media/common/videobuf2/videobuf2-core.c
is independent of V4L2 and can be used by other subsystems (in our case, it is
also used by the DVB API). It is a possibility to create an alsa version of
v4l2-mem2mem.c that uses the core vb2 code with an ALSA uAPI on top.

So in drivers/media/common/videobuf2/ you would have a videobuf2-alsa.c besides
the already existing videobuf2-v4l2.c and -dvb.c.

Perhaps parts of v4l2-mem2mem.c can be reused as well in that case, but I am
not sure if it is worth the effort. I suspect copying it to an alsa-mem2mem.c
and adapting it for alsa is easiest if you want to go that way.

Regards,

	Hans

  parent reply	other threads:[~2023-08-02 12:28 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25  6:12 [RFC PATCH v2 0/7] Add audio support in v4l2 framework Shengjiu Wang
2023-07-25  6:12 ` [RFC PATCH v2 1/7] ASoC: fsl_asrc: define functions for memory to memory usage Shengjiu Wang
2023-08-01 13:58   ` Daniel Baluta
2023-07-25  6:12 ` [RFC PATCH v2 2/7] ASoC: fsl_easrc: " Shengjiu Wang
2023-07-25  6:12 ` [RFC PATCH v2 3/7] ASoC: fsl_asrc: move fsl_asrc_common.h to include/sound Shengjiu Wang
2023-07-25  6:12 ` [RFC PATCH v2 4/7] media: v4l2: Add audio capture and output support Shengjiu Wang
2023-07-28  7:59   ` Tomasz Figa
2023-07-28 15:24     ` Mark Brown
2023-07-31  8:05     ` Shengjiu Wang
2023-08-01  9:47     ` Shengjiu Wang
2023-08-02  7:19       ` Tomasz Figa
2023-07-25  6:12 ` [RFC PATCH v2 5/7] media: imx: fsl_asrc: Add memory to memory driver Shengjiu Wang
2023-08-01 14:15   ` Daniel Baluta
2023-07-25  6:12 ` [RFC PATCH v2 6/7] ASoC: fsl_asrc: register m2m platform device Shengjiu Wang
2023-07-25  6:12 ` [RFC PATCH v2 7/7] ASoC: fsl_easrc: " Shengjiu Wang
2023-08-02  7:32 ` [RFC PATCH v2 0/7] Add audio support in v4l2 framework Hans Verkuil
2023-08-02 11:22   ` Takashi Iwai
2023-08-02 12:02     ` Shengjiu Wang
2023-08-02 12:08       ` Takashi Iwai
2023-08-02 14:41         ` Shengjiu Wang
2023-08-02 17:28           ` Mark Brown
2023-08-03 13:11             ` Shengjiu Wang
2023-08-11 11:05               ` Shengjiu Wang
2023-08-23 14:33                 ` Shengjiu Wang
2023-08-24 17:03                   ` Takashi Iwai
2023-08-24 20:21                     ` Mark Brown
2023-08-25  3:46                       ` Shengjiu Wang
2023-08-25 13:54                         ` Takashi Iwai
2023-08-25 14:15                           ` Hans Verkuil
2023-08-30  3:11                             ` Shengjiu Wang
2023-08-31 20:41                     ` Nicolas Dufresne
2023-08-02 12:09       ` Mark Brown
2023-08-02 12:28       ` Hans Verkuil [this message]
2023-08-04 12:19         ` Shengjiu Wang
2023-08-04 12:34           ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d038360b-22a2-3869-cd64-2da827736faa@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=festevam@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@kernel.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=perex@perex.cz \
    --cc=sakari.ailus@iki.fi \
    --cc=shengjiu.wang@gmail.com \
    --cc=shengjiu.wang@nxp.com \
    --cc=tfiga@chromium.org \
    --cc=tiwai@suse.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).