From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Sakari Ailus <sakari.ailus@iki.fi>,
Sylwester Nawrocki <snjw23@gmail.com>,
Sylwester Nawrocki <s.nawrocki@samsung.com>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
Hans de Goede <hdegoede@redhat.com>
Subject: Re: Embedded device and the V4L2 API support - Was: [GIT PATCHES FOR 3.1] s5p-fimc and noon010pc30 driver updates
Date: Fri, 26 Aug 2011 12:09:02 -0300 [thread overview]
Message-ID: <4E57B70E.9010103@redhat.com> (raw)
In-Reply-To: <201108261616.02417.hverkuil@xs4all.nl>
Em 26-08-2011 11:16, Hans Verkuil escreveu:
> On Friday, August 26, 2011 15:45:30 Laurent Pinchart wrote:
>> Hi Mauro,
>>
>> On Thursday 25 August 2011 14:43:56 Mauro Carvalho Chehab wrote:
>>> Em 24-08-2011 19:29, Sakari Ailus escreveu:
>>
>> [snip]
>>
>>>> The question I still have on this is that how should the user know which
>>>> video node to access on an embedded system with a camera: the OMAP 3 ISP,
>>>> for example, contains some eight video nodes which have different ISP
>>>> blocks connected to them. Likely two of these nodes are useful for a
>>>> general purpose application based on which image format it requests. It
>>>> would make sense to provide generic applications information only on
>>>> those devices they may meaningfully use.
>>>
>>> IMO, we should create a namespace device mapping for video devices. What I
>>> mean is that we should keep the "raw" V4L2 devices as:
>>> /dev/video??
>>> But also recommend the creation of a new userspace map, like:
>>> /dev/webcam??
>>> /dev/tv??
>>> ...
>>> with is an alias for the actual device.
>>>
>>> Something similar to dvd/cdrom aliases that already happen on most distros:
>>>
>>> lrwxrwxrwx 1 root root 3 Ago 24 12:14 cdrom -> sr0
>>> lrwxrwxrwx 1 root root 3 Ago 24 12:14 cdrw -> sr0
>>> lrwxrwxrwx 1 root root 3 Ago 24 12:14 dvd -> sr0
>>> lrwxrwxrwx 1 root root 3 Ago 24 12:14 dvdrw -> sr0
>>
>> I've been toying with a similar idea. libv4l currently wraps /dev/video*
>> device nodes and assumes a 1:1 relationship between a video device node and a
>> video device. Should this assumption be somehow removed, replaced by a video
>> device concept that wouldn't be tied to a single video device node ?
>
> Just as background information: the original idea was always that all v4l
> drivers would have a MC and that libv4l would use the information contained
> there as a helper (such as deciding which nodes would be the 'default' nodes
> for generic applications).
This is something that libv4l won't do: it is up to the userspace application
to choose the device node to open. Ok, libv4l can have helper APIs for
that, like the one I wrote, but even adding MC support on it may not solve
the issues.
> Since there is only one MC device node for each piece of video hardware that
> would make it much easier to discover what hardware there is and what video
> nodes to use.
>
> I always liked that idea, although I know Mauro is opposed to having a MC
> for all v4l drivers.
It doesn't make sense to add MC for all V4L drivers. Not all devices are like
ivtv with lots of device drivers. In a matter of fact, most supported devices
create just one video node. Adding MC support for those devices will just
increase the drivers complexity without _any_ reason, as those devices are
fully configurable using the existing ioctl's.
Also, as I said before, and implemented at xawtv and at a v4l-utils library,
the code may use sysfs for simpler devices. It shouldn't be hard to implement
a mc aware code there, although I don't think that MC API is useful to discover
what nodes are meant to be used for TV, encoder, decoder, webcams, etc.
The only type information it currently provides is:
#define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1)
#define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2)
#define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3)
#define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4)
So, a MC aware application also needs to be a hardware-dependent application,
as it will need to use something else, like the media entity name, to discover
for what purpose a media node is meant to be used.
> While I am not opposed to creating such userspace maps I also think it is
> a bit of a poor-man's solution.
The creation of per-type devices is part of the current API: radio
and vbi nodes are examples of that (except that they aren't aliases, but
real devices, but the idea is the same: different names for different
types of usage).
> In particular I am worried that we get a
> lot of those mappings (just think of ivtv with its 8 or 9 devices).
>
> I can think of: webcam, tv, compressed (mpeg), tv-out, compressed-out, mem2mem.
>
> But a 'tv' node might also be able to handle compressed video (depending
> on how the hardware is organized), so how do you handle that?
Well, What you've called as "compressed" is, in IMO, "encoder". It probably makes
sense to have, also "decoder". I'm in doubt about "webcam", as there are some
grabber devices with analog camera inputs for video surveillance. Maybe "camera"
is a better name for it.
> It can all
> be solved, I'm sure, but I'm not sure if such userspace mappings will scale
> that well with the increasing hardware complexity.
Not all video nodes would need an alias. Just the ones where it makes sense for
an application to open it.
Regards,
Mauro
next prev parent reply other threads:[~2011-08-26 15:09 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-27 16:35 [GIT PATCHES FOR 3.1] s5p-fimc and noon010pc30 driver updates Sylwester Nawrocki
2011-07-28 2:55 ` Mauro Carvalho Chehab
2011-07-28 10:09 ` Sylwester Nawrocki
2011-07-28 13:20 ` Mauro Carvalho Chehab
2011-07-28 22:57 ` Sylwester Nawrocki
2011-07-29 4:02 ` Mauro Carvalho Chehab
2011-07-29 8:36 ` Laurent Pinchart
2011-08-09 20:05 ` Mauro Carvalho Chehab
2011-08-09 23:18 ` Sakari Ailus
2011-08-10 0:22 ` Mauro Carvalho Chehab
2011-08-10 8:41 ` Sylwester Nawrocki
2011-08-10 12:52 ` Mauro Carvalho Chehab
2011-08-15 12:45 ` Laurent Pinchart
2011-08-16 0:21 ` Mauro Carvalho Chehab
2011-08-16 8:59 ` Laurent Pinchart
2011-08-16 15:07 ` Mauro Carvalho Chehab
2011-08-15 12:30 ` Laurent Pinchart
2011-08-16 0:13 ` Mauro Carvalho Chehab
2011-08-16 8:57 ` Laurent Pinchart
2011-08-16 15:30 ` Mauro Carvalho Chehab
2011-08-16 15:44 ` Laurent Pinchart
2011-08-16 22:36 ` Mauro Carvalho Chehab
2011-08-17 7:57 ` Laurent Pinchart
2011-08-17 12:25 ` Mauro Carvalho Chehab
2011-08-17 12:37 ` Ivan T. Ivanov
2011-08-17 13:27 ` Mauro Carvalho Chehab
2011-08-17 12:33 ` Sakari Ailus
2011-08-16 21:47 ` Sylwester Nawrocki
2011-08-17 6:13 ` Embedded device and the V4L2 API support - Was: " Mauro Carvalho Chehab
2011-08-20 11:27 ` Sylwester Nawrocki
2011-08-20 12:12 ` Mauro Carvalho Chehab
2011-08-24 22:29 ` Sakari Ailus
2011-08-25 12:43 ` Mauro Carvalho Chehab
2011-08-26 13:45 ` Laurent Pinchart
2011-08-26 14:16 ` Hans Verkuil
2011-08-26 15:09 ` Mauro Carvalho Chehab [this message]
2011-08-26 15:29 ` Hans Verkuil
2011-08-26 17:32 ` Mauro Carvalho Chehab
2011-08-29 9:24 ` Laurent Pinchart
2011-08-29 14:53 ` Mauro Carvalho Chehab
2011-08-29 9:12 ` Laurent Pinchart
2011-08-30 20:34 ` Sakari Ailus
2011-08-03 14:28 ` Sylwester Nawrocki
2011-07-29 8:17 ` Sakari Ailus
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=4E57B70E.9010103@redhat.com \
--to=mchehab@redhat.com \
--cc=hdegoede@redhat.com \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=s.nawrocki@samsung.com \
--cc=sakari.ailus@iki.fi \
--cc=snjw23@gmail.com \
/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