<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Adding custom mipi camera for Android (Timeouts) in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Adding-custom-mipi-camera-for-Android-Timeouts/m-p/890382#M134641</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, yes I did verify that. &amp;nbsp;I was able to get streaming to work by changing the media formats in the libcamera addition for my camera. &amp;nbsp;I originally put YUYV as the format because that is what our camera can produce. &amp;nbsp;I since learned the format here (libcamera HAL) isn't necessarily what the camera can produce but also includes what the IPU can produce. &amp;nbsp;Since the IPU can convert YUYV to NV12 et. al., those are what actually needed listed because Android must have the NV12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, at least that's my understanding of the problem. &amp;nbsp;There may be parts I don't understand correctly or haven't completely implemented but it's working for me at this time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Apr 2019 21:10:45 GMT</pubDate>
    <dc:creator>dennis3</dc:creator>
    <dc:date>2019-04-24T21:10:45Z</dc:date>
    <item>
      <title>Adding custom mipi camera for Android (Timeouts)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Adding-custom-mipi-camera-for-Android-Timeouts/m-p/890380#M134639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a custom MIPI camera that I've written a driver for. &amp;nbsp;I've integrated this camera into Linux w/ the Yocto build and can successfully stream and display camera images.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The driver is the same for Android 8. &amp;nbsp;(Similar kernel version and camera module, DTS is the same.) &amp;nbsp;In addition, I've followed the guide to customize the init.rc to set the back_camera_name property accordingly to my custom camera and I've created an libcamera3 Camera implementation for my camera in the vendor library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Android, when the camera app is launched, I see all the correct dmesg output to suggest our driver and library are successfully called but the actual data fails to stream:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I've checked mipi phy status and err1/2 registers and they suggest mipi is streaming as expected. &amp;nbsp;(Again on Linux at this point the camera can stream images fine.. same hardware/driver).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone suggest how I might debug further on Android why it is failing to stream?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our data format is YUYV (YUV422). &amp;nbsp;On linux, gstreamer can take this format directly to the IPU and from there we can convert to to a format available for display. &amp;nbsp;I don't know if the fact that we can't support NV12 is a problem or not on Android or if that would cause the timeout we're seeing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a snippet of the Android logcat output for the FslCameraHAL layer:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:00:15.481 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 I FslCameraHAL: Camera fourcc to format code is: 0x14 -&amp;gt;(&lt;SPAN style="color: #ff6600;"&gt;HAL_PIXEL_FORMAT_YCBCR_422_I&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:00:15.481 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 I FslCameraHAL: enum frame size w:1920, h:1080&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:00:15.481 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 I FslCameraHAL: SupportedPictureSizes: 1920 x 1080&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:00:15.481 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 I FslCameraHAL: SupportedPreviewSizes: 1920 x 1080&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:00:15.481 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 I FslCameraHAL: FrameDuration is 33331760, 30000000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:00:15.481 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 I FslCameraHAL: mMaxWidth:1920, mMaxHeight:1080&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:00:15.481 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 I FslCameraHAL: Thine, mFocalLength:3.370000, mPhysicalWidth:2.772000, mPhysicalHeight 1.512000&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:05:03.771 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;352 I FslCameraHAL: openDev:0: Opening camera device&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:05:03.771 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;352 I FslCameraHAL: openDev&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:05:04.409 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 I FslCameraHAL: configureStreams:0: stream_config 0xbeff0430, num 2, streams 0xb3f191d8, mode 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:05:04.409 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 I FslCameraHAL: config 0, type 0, res 1920x1080, fmt &lt;SPAN style="color: #ff0000;"&gt;0x21&lt;/SPAN&gt;, usage 0x3, maxbufs 0, priv 0x0, rotation 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:05:04.409 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 I FslCameraHAL: config 1, type 0, res 1920x1080, fmt &lt;SPAN style="color: #ff0000;"&gt;0x22&lt;/SPAN&gt;, usage 0x100, maxbufs 0, priv 0x0, rotation 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:05:04.409 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 I FslCameraHAL: Stream create capture stream&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:05:04.409 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 I FslCameraHAL: stream: w:1920, h:1080, format:0x21, usage:0x20303, buffers:2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:05:04.409 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 I FslCameraHAL: Stream create preview stream&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:05:04.409 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 I FslCameraHAL: stream: w:1920, h:1080, format:0x0, usage:0x20302, buffers:3&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:05:04.578 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;352 I FslCameraHAL: constructDefaultRequestSettings:0: type=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:05:04.672 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 E FslCameraHAL: configure: invalid stream parameters&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:05:04.673 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;309 E FslCameraHAL: invalid state:0x201 go into start state&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;01-01 00:05:14.716 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;246 &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;309 E FslCameraHAL: onFrameAcquireLocked: VIDIOC_DQBUF Failed&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2019 02:39:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Adding-custom-mipi-camera-for-Android-Timeouts/m-p/890380#M134639</guid>
      <dc:creator>dennis3</dc:creator>
      <dc:date>2019-04-10T02:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom mipi camera for Android (Timeouts)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Adding-custom-mipi-camera-for-Android-Timeouts/m-p/890381#M134640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you verify if you have access to the camera at kernel level?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, it can be due that the application is not recognizing your new hardware. Please see the below guide, probably it could help you:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.android.com/guide/topics/media/camera"&gt;https://developer.android.com/guide/topics/media/camera&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Diego.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2019 20:57:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Adding-custom-mipi-camera-for-Android-Timeouts/m-p/890381#M134640</guid>
      <dc:creator>diegoadrian</dc:creator>
      <dc:date>2019-04-24T20:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom mipi camera for Android (Timeouts)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Adding-custom-mipi-camera-for-Android-Timeouts/m-p/890382#M134641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, yes I did verify that. &amp;nbsp;I was able to get streaming to work by changing the media formats in the libcamera addition for my camera. &amp;nbsp;I originally put YUYV as the format because that is what our camera can produce. &amp;nbsp;I since learned the format here (libcamera HAL) isn't necessarily what the camera can produce but also includes what the IPU can produce. &amp;nbsp;Since the IPU can convert YUYV to NV12 et. al., those are what actually needed listed because Android must have the NV12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, at least that's my understanding of the problem. &amp;nbsp;There may be parts I don't understand correctly or haven't completely implemented but it's working for me at this time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2019 21:10:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Adding-custom-mipi-camera-for-Android-Timeouts/m-p/890382#M134641</guid>
      <dc:creator>dennis3</dc:creator>
      <dc:date>2019-04-24T21:10:45Z</dc:date>
    </item>
  </channel>
</rss>

