Hi,<br><br>In order to expand this knowledge outside of Linaro I took the Liberty of inviting both <a href="mailto:linux-media@vger.kernel.org">linux-media@vger.kernel.org</a> and <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>. For any newcomer I really recommend to do some catch-up reading on <a href="http://lists.linaro.org/pipermail/linaro-dev/2011-February/thread.html">http://lists.linaro.org/pipermail/linaro-dev/2011-February/thread.html</a> ("v4l2 vs omx for camera" thread) before making any comments. And sign up for Linaro-dev while you are at it :-)<br>
<br>To make a long story short:<br>Different vendors provide custom OpenMax solutions for say Camera/ISP. In the Linux eco-system there is V4L2 doing much of this work already and is evolving with mediacontroller as well. Then there is the integration in Gstreamer...Which solution is the best way forward. Current discussions so far puts V4L2 greatly in favor of OMX.<br>
Please have in mind that OpenMAX as a concept is more like GStreamer in many senses. The question is whether Camera drivers should have OMX or V4L2 as the driver front end? This may perhaps apply to video codecs as well. Then there is how to in best of ways make use of this in GStreamer in order to achieve no copy highly efficient multimedia pipelines. Is gst-omx the way forward?<br>
<br>Let the discussion continue...<br><br><br><div class="gmail_quote">On 17 February 2011 14:48, Laurent Pinchart <span dir="ltr"><<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On Thursday 10 February 2011 08:47:15 Hans Verkuil wrote:<br>
> On Thursday, February 10, 2011 08:17:31 Linus Walleij wrote:<br>
</div><div><div></div><div class="h5">> > On Wed, Feb 9, 2011 at 8:44 PM, Harald Gustafsson wrote:<br>
> > > OMX main purpose is to handle multimedia hardware and offer an<br>
> > > interface to that HW that looks identical indenpendent of the vendor<br>
> > > delivering that hardware, much like the v4l2 or USB subsystems tries to<br>
> > > do. And yes optimally it should be implemented in drivers/omx in Linux<br>
> > > and a user space library on top of that.<br>
> ><br>
> > Thanks for clarifying this part, it was unclear to me. The reason being<br>
> > that it seems OMX does not imply userspace/kernelspace separation, and<br>
> > I was thinking more of it as a userspace lib. Now my understanding is<br>
> > that if e.g. OpenMAX defines a certain data structure, say for a PCM<br>
> > frame or whatever, then that exact struct is supposed to be used by the<br>
> > kernelspace/userspace interface, and defined in the include file exported<br>
> > by the kernel.<br>
> ><br>
> > > It might be that some alignment also needs to be made between 4vl2 and<br>
> > > other OS's implementation, to ease developing drivers for many OSs<br>
> > > (sorry I don't know these details, but you ST-E guys should know).<br>
> ><br>
> > The basic conflict I would say is that Linux has its own API+ABI, which<br>
> > is defined by V4L and ALSA through a community process without much<br>
> > thought about any existing standard APIs. (In some cases also predating<br>
> > them.)<br>
> ><br>
> > > By the way IL is about to finalize version 1.2 of OpenMAX IL which is<br>
> > > more than a years work of aligning all vendors and fixing unclear and<br>
> > > buggy parts.<br>
> ><br>
> > I suspect that the basic problem with Khronos OpenMAX right now is<br>
> > how to handle communities - for example the X consortium had<br>
> > something like the same problem a while back, only member companies<br>
> > could partake in the standard process, and they need of course to pay<br>
> > an upfront fee for that, and the majority of these companies didn't<br>
> > exactly send Linux community members to the meetings.<br>
> ><br>
> > And now all the companies who took part in OpenMAX somehow<br>
> > end up having to do a lot of upfront community work if they want<br>
> > to drive the API:s in a certain direction, discuss it again with the V4L<br>
> > and ALSA maintainers and so on. Which takes a lot of time and<br>
> > patience with uncertain outcome, since this process is autonomous<br>
> > from Khronos. Nobody seems to be doing this, I javen't seen a single<br>
> > patch aimed at trying to unify the APIs so far. I don't know if it'd be<br>
> > welcome.<br>
> ><br>
> > This coupled with strict delivery deadlines and a marketing will<br>
> > to state conformance to OpenMAX of course leads companies into<br>
> > solutions breaking the Linux kernelspace API to be able to present<br>
> > this.<br>
<br>
</div></div>From my experience with OMX, one of the issues is that companies usually<br>
extend the API to fullfill their platform's needs, without going through any<br>
standardization process. Coupled with the lack of open and free reference<br>
implementation and test tools, this more or less means that OMX<br>
implementations are not really compatible with eachother, making OMX-based<br>
solution not better than proprietary solutions.<br>
<div class="im"><br>
> > Now I think we have a pretty clear view of the problem, I don't<br>
> > know what could be done about it though :-/<br>
><br>
> One option might be to create a OMX wrapper library around the V4L2 API.<br>
> Something similar is already available for the old V4L1 API (now removed<br>
> from the kernel) that allows apps that still speak V4L1 only to use the<br>
> V4L2 API. This is done in the libv4l1 library. The various v4l libraries<br>
> are maintained here: <a href="http://git.linuxtv.org/v4l-utils.git" target="_blank">http://git.linuxtv.org/v4l-utils.git</a><br>
><br>
> Adding a libomx might not be such a bad idea. Linaro might be the<br>
> appropriate organization to look into this. Any missing pieces in V4L2<br>
> needed to create a fully functioning omx API can be discussed and solved.<br>
><br>
> Making this part of v4l-utils means that it is centrally maintained and<br>
> automatically picked up by distros.<br>
><br>
> It will certainly be a non-trivial exercise, but it is a one-time job that<br>
> should solve a lot of problems. But someone has to do it...<br>
<br>
</div>It's an option, but why would that be needed ? Again from my (probably<br>
limited) OMX experience, platforms expose higher-level APIs to applications,<br>
implemented on top of OMX. If the OMX layer is itself implemented on top of<br>
V4L2, it would just be an extraneous useless internal layer that could (should<br>
?) be removed completely.<br>
<div class="im"><br></div></blockquote><div><br>[Robert F]<br>This would be the case in a GStreamer driven multimedia, i.e. Implement GStreamer elements using V4L2 directly(or camerabin using v4l2 directly). Perhaps some vendors would provide a library in between as well but that could be libv4l in that case. If someone would have an OpenMAX AL/IL media framework an OMX component would make sense to have but in this case it would be a thinner OMX component which in turn is implemented using V4L2. But it might be that Khronos provides OS independent components that by vendors gets implemented as the actual HW driver forgetting that there is a big difference in the driver model of an RTOS system compared to Linux(user/kernel space) or any OS...never mind.<br>
<br>The question is if the Linux kernel and V4L2 is ready to incorporate several HW(DSP, CPU, ISP, xxHW) in an imaging pipeline for instance. The reason Embedded Vendors provide custom solutions is to implement low power non(or minimal) CPU intervention pipelines where dedicated HW does the work most of the time(like full screen Video Playback).<br>
<br>A common way of managing memory would of course also be necessary as well, like hwmem(search for hwmem in Linux-mm) handles to pass buffers in between different drivers and processes all the way from sources(camera, video parser/decode) to sinks(display, hdmi, video encoders(record))<br>
<br>Perhaps GStreamer experts would like to comment on the future plans ahead for zero copying/IPC and low power HW use cases? Could Gstreamer adapt some ideas from OMX IL making OMX IL obsolete? Answering these questions could be improved guidelines on what embedded device vendors in the future would provide as hw-driver front-ends. OMX is just one of these. Perhaps we could do better to fit and evolve the Linux eco-system?<br>
<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
> Regarding using V4L to communicate with DSPs/other processors: that too<br>
> could be something for Linaro to pick up: experiment with it for one<br>
> particular board, see what (if anything) is needed to make this work. I<br>
> expect it to be pretty easy, but again, nobody has actually done the<br>
> initial work.<br>
<br>
</div>The main issue with the V4L2 API compared with the OMX API is that V4L2 is a<br>
kernelspace/userspace API only, while OMX can live in userspace. When the need<br>
to communicate with other processors (CPUs, DSP, dedicated image processing<br>
hardware blocks, ...) arises, platforms usually ship with a thin kernel layer<br>
to handle low-level communication protocols, and a userspace OMX library that<br>
does the bulk of the work. We would need to be able to do something similar<br>
with V4L2.<br></blockquote><div><br>[Robert F]<br>Ok, doesn.t mediacontroller/subdevices solve many of these issues?<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im"><br>
> Once you have an example driver, then it should be much easier for others<br>
> to follow.<br>
><br>
> As Linus said, companies are unlikely to start doing this by themselves,<br>
> but it seems that this work would exactly fit the Linaro purpose. From the<br>
> Linaro homepage:<br>
><br>
> "Linaro™ brings together the open source community and the electronics<br>
> industry to work on key projects, deliver great tools, reduce industry<br>
> wide fragmentation and provide common foundations for Linux software<br>
> distributions and stacks to land on."<br>
><br>
> Spot on, I'd say :-)<br>
><br>
> Just for the record, let me say again they the V4L2 community will be very<br>
> happy to assist with this when it comes to extending/improving the V4L2 API<br>
> to make all this possible.<br>
<br>
</div>The first step would probably be to decide what Linux needs. Then I'll also be<br>
happy to assist with the implementation phase :-)<br>
<br>
--<br>
Regards,<br>
<br>
Laurent Pinchart<br>
<br>
_______________________________________________<br>
linaro-dev mailing list<br>
<a href="mailto:linaro-dev@lists.linaro.org">linaro-dev@lists.linaro.org</a><br>
<a href="http://lists.linaro.org/mailman/listinfo/linaro-dev" target="_blank">http://lists.linaro.org/mailman/listinfo/linaro-dev</a><br></blockquote><div><br>BR<br>/Robert Fekete <br></div></div><br>