All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Ning A" <ning.a.zhang@intel.com>
To: "tfiga@chromium.org" <tfiga@chromium.org>
Cc: "Zhang, Ning A" <ning.a.zhang@intel.com>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: Re: is it possible to use single IOCTL to setup media pipeline?
Date: Thu, 22 Nov 2018 08:59:44 +0000	[thread overview]
Message-ID: <1542877183.1288.34.camel@intel.com> (raw)
In-Reply-To: <CAAFQd5CSXQw2Nk7TMij4qQx6V5diLg8LpuSKOrZG86cWo3vKxg@mail.gmail.com>

Tomasz, Thank you for your answers.

learned a lot.

BR.
Ning.

在 2018-11-22四的 16:06 +0900,Tomasz Figa写道:
> Hi Ning,
> 
> On Thu, Nov 22, 2018 at 11:52 AM Zhang, Ning A <ning.a.zhang@intel.co
> m> wrote:
> > 
> > Hello everyone
> > 
> > when we need to setup media pipeline, eg, for camera capture,
> > media-ctl
> > needs to be called multiple time to setup media link and subdev
> > formats, or similar code in a single application. this will use
> > multiple IOCTLs on "/dev/mediaX" and "/dev/v4l2-subdevY".
> > 
> > to setup media pipeline in userspace requires to fully
> > understanding
> > the topology of the media stack. but the fact is only media driver
> > developer could know how to setup media pipeline. each time driver
> > updates, this would break userspace application if application
> > engineers don't know this change.
> 
> That's obviously a bug in the driver. Kernel interfaces must not
> change in a way that are not compatible with the userspace.

I met this issue :(

> 
> > In this case, if a IOCTL is designed
> > to setup media pipeline, no need to update applications, after
> > driver
> > is updated.
> > 
> > this will not only benefit for design a single IOCTL, this also
> > helps
> > to hide the detail of media pipeline, by load a binary blob which
> > holds
> > information about how to setup pipeline, or hide it in
> > bootloader/ACPI
> > tables/device tree, etc.
> 
> Media pipeline configuration is specific to the use case. If you
> hardcode it in the driver or bootloader, the user will not be able to
> use any other use case than the hardcoded blob, which is unacceptable
> for Linux drivers.
> 
> Instead, it sounds like your userspace should be designed in a way
> that the media topology configuration is loaded from a configuration
> file that you could either get from your kernel driver developer or
> just maintain yourself based on any changes the media developers do.
> Of course that's unrelated to the backwards compatibility issue,
> which
> should not happen normally. The configuration file would be helpful
> for handling future extensions and new hardware platforms.

yes, if there are multiple user cases, then this is not optional.

> 
> > 
> > another benefit is save time for setup media pipeline, if there is
> > a
> > PKI like "time for open camera". as my test, this will saves
> > hundreds
> > of milliseconds.
> 
> For this problem, the proper solution would be to create an ioctl
> that
> can aggregate setting multiple parts of the topology in one go. For
> example, V4L2 has VIDIOC_S_CTRL for setting a control, but there is
> also VIDIOC_S_EXT_CTRLS, which lets you set multiple controls in one
> call. Something like VIDIOC_S_EXT_CTRLS for configuring the media
> topology would solve the performance problem.

this may be alternative choice.

> 
> 
> Best regards,
> Tomasz

  reply	other threads:[~2018-11-22 19:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22  2:51 is it possible to use single IOCTL to setup media pipeline? Zhang, Ning A
2018-11-22  7:06 ` Tomasz Figa
2018-11-22  8:59   ` Zhang, Ning A [this message]
2018-11-22 13:46   ` Sakari Ailus
2018-11-22 13:56     ` Tomasz Figa

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=1542877183.1288.34.camel@intel.com \
    --to=ning.a.zhang@intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=tfiga@chromium.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.