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> (&quot;v4l2 vs omx for camera&quot; 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">&lt;<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>&gt;</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>
&gt; On Thursday, February 10, 2011 08:17:31 Linus Walleij wrote:<br>
</div><div><div></div><div class="h5">&gt; &gt; On Wed, Feb 9, 2011 at 8:44 PM, Harald Gustafsson wrote:<br>
&gt; &gt; &gt; OMX main purpose is to handle multimedia hardware and offer an<br>
&gt; &gt; &gt; interface to that HW that looks identical indenpendent of the vendor<br>
&gt; &gt; &gt; delivering that hardware, much like the v4l2 or USB subsystems tries to<br>
&gt; &gt; &gt; do. And yes optimally it should be implemented in drivers/omx in Linux<br>
&gt; &gt; &gt; and a user space library on top of that.<br>
&gt; &gt;<br>
&gt; &gt; Thanks for clarifying this part, it was unclear to me. The reason being<br>
&gt; &gt; that it seems OMX does not imply userspace/kernelspace separation, and<br>
&gt; &gt; I was thinking more of it as a userspace lib. Now my understanding is<br>
&gt; &gt; that if e.g. OpenMAX defines a certain data structure, say for a PCM<br>
&gt; &gt; frame or whatever, then that exact struct is supposed to be used by the<br>
&gt; &gt; kernelspace/userspace interface, and defined in the include file exported<br>
&gt; &gt; by the kernel.<br>
&gt; &gt;<br>
&gt; &gt; &gt; It might be that some alignment also needs to be made between 4vl2 and<br>
&gt; &gt; &gt; other OS&#39;s implementation, to ease developing drivers for many OSs<br>
&gt; &gt; &gt; (sorry I don&#39;t know these details, but you ST-E guys should know).<br>
&gt; &gt;<br>
&gt; &gt; The basic conflict I would say is that Linux has its own API+ABI, which<br>
&gt; &gt; is defined by V4L and ALSA through a community process without much<br>
&gt; &gt; thought about any existing standard APIs. (In some cases also predating<br>
&gt; &gt; them.)<br>
&gt; &gt;<br>
&gt; &gt; &gt; By the way IL is about to finalize version 1.2 of OpenMAX IL which is<br>
&gt; &gt; &gt; more than a years work of aligning all vendors and fixing unclear and<br>
&gt; &gt; &gt; buggy parts.<br>
&gt; &gt;<br>
&gt; &gt; I suspect that the basic problem with Khronos OpenMAX right now is<br>
&gt; &gt; how to handle communities - for example the X consortium had<br>
&gt; &gt; something like the same problem a while back, only member companies<br>
&gt; &gt; could partake in the standard process, and they need of course to pay<br>
&gt; &gt; an upfront fee for that, and the majority of these companies didn&#39;t<br>
&gt; &gt; exactly send Linux community members to the meetings.<br>
&gt; &gt;<br>
&gt; &gt; And now all the companies who took part in OpenMAX somehow<br>
&gt; &gt; end up having to do a lot of upfront community work if they want<br>
&gt; &gt; to drive the API:s in a certain direction, discuss it again with the V4L<br>
&gt; &gt; and ALSA maintainers and so on. Which takes a lot of time and<br>
&gt; &gt; patience with uncertain outcome, since this process is autonomous<br>
&gt; &gt; from Khronos. Nobody seems to be doing this, I javen&#39;t seen a single<br>
&gt; &gt; patch aimed at trying to unify the APIs so far. I don&#39;t know if it&#39;d be<br>
&gt; &gt; welcome.<br>
&gt; &gt;<br>
&gt; &gt; This coupled with strict delivery deadlines and a marketing will<br>
&gt; &gt; to state conformance to OpenMAX of course leads companies into<br>
&gt; &gt; solutions breaking the Linux kernelspace API to be able to present<br>
&gt; &gt; 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&#39;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>
&gt; &gt; Now I think we have a pretty clear view of the problem, I don&#39;t<br>
&gt; &gt; know what could be done about it though :-/<br>
&gt;<br>
&gt; One option might be to create a OMX wrapper library around the V4L2 API.<br>
&gt; Something similar is already available for the old V4L1 API (now removed<br>
&gt; from the kernel) that allows apps that still speak V4L1 only to use the<br>
&gt; V4L2 API. This is done in the libv4l1 library. The various v4l libraries<br>
&gt; are maintained here: <a href="http://git.linuxtv.org/v4l-utils.git" target="_blank">http://git.linuxtv.org/v4l-utils.git</a><br>
&gt;<br>
&gt; Adding a libomx might not be such a bad idea. Linaro might be the<br>
&gt; appropriate organization to look into this. Any missing pieces in V4L2<br>
&gt; needed to create a fully functioning omx API can be discussed and solved.<br>
&gt;<br>
&gt; Making this part of v4l-utils means that it is centrally maintained and<br>
&gt; automatically picked up by distros.<br>
&gt;<br>
&gt; It will certainly be a non-trivial exercise, but it is a one-time job that<br>
&gt; should solve a lot of problems. But someone has to do it...<br>
<br>
</div>It&#39;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">
&gt; Regarding using V4L to communicate with DSPs/other processors: that too<br>
&gt; could be something for Linaro to pick up: experiment with it for one<br>
&gt; particular board, see what (if anything) is needed to make this work. I<br>
&gt; expect it to be pretty easy, but again, nobody has actually done the<br>
&gt; 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>
&gt; Once you have an example driver, then it should be much easier for others<br>
&gt; to follow.<br>
&gt;<br>
&gt; As Linus said, companies are unlikely to start doing this by themselves,<br>
&gt; but it seems that this work would exactly fit the Linaro purpose. From the<br>
&gt; Linaro homepage:<br>
&gt;<br>
&gt; &quot;Linaro™ brings together the open source community and the electronics<br>
&gt; industry to work on key projects, deliver great tools, reduce industry<br>
&gt; wide fragmentation and provide common foundations for Linux software<br>
&gt; distributions and stacks to land on.&quot;<br>
&gt;<br>
&gt; Spot on, I&#39;d say :-)<br>
&gt;<br>
&gt; Just for the record, let me say again they the V4L2 community will be very<br>
&gt; happy to assist with this when it comes to extending/improving the V4L2 API<br>
&gt; to make all this possible.<br>
<br>
</div>The first step would probably be to decide what Linux needs. Then I&#39;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>