Closed Bug 978196 Opened 6 years ago Closed 6 years ago

[camera] Camcorder doesn't work on KK

Categories

(Firefox OS Graveyard :: Gaia::Camera, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(blocking-b2g:-)

RESOLVED WORKSFORME
blocking-b2g -

People

(Reporter: ikumar, Assigned: vliu)

References

Details

Attachments

(6 files)

Camcorder doesn't work on the KitKat based build.
Blocks: 960372
blocking-b2g: --- → 1.4?
Whiteboard: [CR 621219]
blocking-b2g: 1.4? → 1.4+
Hey Preeti, can you please help move this bug along?
Flags: needinfo?(praghunath)
I'll find a KitKat-compatible device and take a first-pass look at this to see if there's anything obviously wrong.

In the meantime, can someone who actually has one post a logcat of what's going on? Bonus points if it's a DEBUG build with |export NSPR_LOG_MODULES=Camera:4| set in b2g.sh.
Assignee: nobody → mhabicher
Hi! Vincent,

Could you help to provide the logcat? Thanks

--
Keven
Flags: needinfo?(vliu)
Sure. I can work on it.
Flags: needinfo?(vliu)
Attached file camcordingFail.log
The logs for camcording fail is attached. As I know, this problem should be the same when I ported camera for kk. Please see bug 946241 Comment 9 to know the detail. From gdb log message, it seems OMXCodce got unrecognized eColorFormat(OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m). I'd checked with Michael Vines by mail and he said they may run into the same issue when looking at Gecko/kk camera bringup on the other board. Maybe Michael Mives can has Comment for it. 

$1 = {nSize = 96, nVersion = {s = {nVersionMajor = 1 '\001', nVersionMinor = 1 '\001', nRevision = 0 '\000', nStep = 0 '\000'}, nVersion = 257}, nPortIndex = 0, eDir = OMX_DirInput,
  nBufferCountActual = 5, nBufferCountMin = 5, nBufferSize = 152064, bEnabled = OMX_TRUE, bPopulated = OMX_FALSE, eDomain = OMX_PortDomainVideo, format = {audio = {
      cMIMEType = 0xada02594 <Address 0xada02594 out of bounds>, pNativeRender = 0x0, bFlagErrorConcealment = 176, eEncoding = 144}, video = {
      cMIMEType = 0xada02594 <Address 0xada02594 out of bounds>, pNativeRender = 0x0, nFrameWidth = 176, nFrameHeight = 144, nStride = 176, nSliceHeight = 144, nBitrate = 64000,
      xFramerate = 983040, bFlagErrorConcealment = OMX_FALSE, eCompressionFormat = OMX_VIDEO_CodingUnused, eColorFormat = OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m,
      pNativeWindow = 0x0}, image = {cMIMEType = 0xada02594 <Address 0xada02594 out of bounds>, pNativeRender = 0x0, nFrameWidth = 176, nFrameHeight = 144, nStride = 176,
      nSliceHeight = 144, bFlagErrorConcealment = 64000, eCompressionFormat = 983040, eColorFormat = OMX_COLOR_FormatUnused, pNativeWindow = 0x0}, other = {eFormat = 2912953748}},
  bBuffersContiguous = OMX_FALSE, nBufferAlignment = 0}

Actually I can get recorded file after the recording. But the thumbnail of this file can't be parsed into the upper left side of the screen. It also got the splashed image when I played it on PC. Another relative to eColorFormat is bug 961627.
I see this in the logcat:
E/GeckoConsole( 1652): [JavaScript Error: "NS_ERROR_NOT_AVAILABLE: " {file: "app://camera.gaiamobile.org/js/main.js" line: 3052}]

Not sure what's going on here--main.js, as far as I can see, only has ~74 lines: https://github.com/mozilla-b2g/gaia/blob/master/apps/camera/js/main.js
Flags: needinfo?(dmarcos)
CJ/Marco

We need help from your team to take this on and investigate. 

Mike's nexus4 is not back from MWC and he is swamped with other madai camera work. If we can get a debug build with camera logging enabled, mike can look at the logs and help with identifying the issue. 

+ Joe Cheng since he is tracking kit-kat work happening in Taipei

Thank you!

Hema
Flags: needinfo?(mchen)
Flags: needinfo?(jcheng)
Flags: needinfo?(cku)
Running a recent master build on a Nexus 4, when I switch to video mode and press the record button, I get an error pop-up and the logcat shows this:

03-04 18:24:31.058   180   180 E GeckoConsole: [JavaScript Error: "Content Security Policy: Can't use 'self' if self data is not provided"]
03-04 18:24:31.058   180   180 E GeckoConsole: [JavaScript Warning: "Content Security Policy: Failed to parse unrecognized source app://camera.gaiamobile.org"]
03-04 18:24:31.058   180   180 E GeckoConsole: [JavaScript Error: "Content Security Policy: Can't use 'self' if self data is not provided"]
03-04 18:24:31.058   180   180 E GeckoConsole: [JavaScript Warning: "Content Security Policy: Failed to parse unrecognized source app://camera.gaiamobile.org"]
03-04 18:24:31.108   180   180 E GeckoConsole: [JavaScript Error: "Content Security Policy: Can't use 'self' if self data is not provided"]
03-04 18:24:31.108   180   180 E GeckoConsole: [JavaScript Warning: "Content Security Policy: Failed to parse unrecognized source app://camera.gaiamobile.org"]
03-04 18:24:31.108   180   180 E GeckoConsole: [JavaScript Error: "Content Security Policy: Can't use 'self' if self data is not provided"]
03-04 18:24:31.108   180   180 E GeckoConsole: [JavaScript Warning: "Content Security Policy: Failed to parse unrecognized source app://camera.gaiamobile.org"]
03-04 18:24:31.138   180   180 E GeckoConsole: [JavaScript Error: "Content Security Policy: Can't use 'self' if self data is not provided"]
03-04 18:24:31.138   180   180 E GeckoConsole: [JavaScript Warning: "Content Security Policy: Failed to parse unrecognized source app://camera.gaiamobile.org"]
03-04 18:24:31.138   180   180 E GeckoConsole: [JavaScript Error: "Content Security Policy: Can't use 'self' if self data is not provided"]
03-04 18:24:31.138   180   180 E GeckoConsole: [JavaScript Warning: "Content Security Policy: Failed to parse unrecognized source app://camera.gaiamobile.org"]
03-04 18:24:31.148   180   180 E GeckoConsole: [JavaScript Error: "Content Security Policy: Can't use 'self' if self data is not provided"]
03-04 18:24:31.148   180   180 E GeckoConsole: [JavaScript Warning: "Content Security Policy: Failed to parse unrecognized source app://camera.gaiamobile.org"]
03-04 18:24:31.148   180   180 E GeckoConsole: [JavaScript Error: "Content Security Policy: Can't use 'self' if self data is not provided"]
03-04 18:24:31.148   180   180 E GeckoConsole: [JavaScript Warning: "Content Security Policy: Failed to parse unrecognized source app://camera.gaiamobile.org"]
Oh, and process 180 isn't the Camera app, it's the b2g parent:

18:24:51 ➜  ~  adb shell b2g-ps
APPLICATION      USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAME
b2g              root      180   1     230772 81592 ffffffff b6f49408 S /system/b2g/b2g
(Nuwa)           root      597   180   50700  20296 ffffffff b6e65408 S /system/b2g/plugin-container
Usage            u0_a638   638   597   63444  21660 ffffffff b6e65408 S /system/b2g/plugin-container
Homescreen       u0_a806   806   597   77268  30720 ffffffff b6e65408 S /system/b2g/plugin-container
Camera           u0_a898   898   597   79472  23764 ffffffff b6e65408 S /system/b2g/plugin-container
(Preallocated a  root      994   597   59916  16912 ffffffff b6e65408 S /system/b2g/plugin-container
(In reply to Hema Koka [:hema] from comment #7)
> CJ/Marco
> 
> We need help from your team to take this on and investigate. 
> 
> Mike's nexus4 is not back from MWC and he is swamped with other madai camera
> work. If we can get a debug build with camera logging enabled, mike can look
> at the logs and help with identifying the issue. 
> 
> + Joe Cheng since he is tracking kit-kat work happening in Taipei
> 
> Thank you!
> 
> Hema

I can take this bug for the following investigation
Assignee: mhabicher → vliu
Flags: needinfo?(cku)
(In reply to Vincent Liu[:vliu] from comment #10)
> (In reply to Hema Koka [:hema] from comment #7)
> > CJ/Marco
> > 
> > We need help from your team to take this on and investigate. 
> > 
> > Mike's nexus4 is not back from MWC and he is swamped with other madai camera
> > work. If we can get a debug build with camera logging enabled, mike can look
> > at the logs and help with identifying the issue. 
> > 
> > + Joe Cheng since he is tracking kit-kat work happening in Taipei
> > 
> > Thank you!
> > 
> > Hema
> 
> I can take this bug for the following investigation

thank you!
(In reply to Michael Vines [:m1] [:evilmachines] from comment #1)
> Hey Preeti, can you please help move this bug along?

Michael

Awaiting Vincent's investigation on the same.
Flags: needinfo?(praghunath)
Attached video VID_0016.3gp
Hi mvines,

From gdb output, I got the eColorFormat setting to OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m for Input port definition in OMXCodec::setVideoInputFormat(). Does it should be the expected value for OMXCodec?
I'd remember we had discussions by mail mentioning about this problem. You said it may run into the same issue when looking at Gecko/kk camera bringup on the other board. Does the issue you said relative to this?

I tried to add the patch of Bug 961627. After that, camera app can show the thumbnail of recorded video file on the right-up corner of screen. But even so,  the image contains in it still got splashed. It might some wrong parameters set to OMX component cause this. The recorded file was attached for reference. I will still try to investigate it. Any hint would be appreciate. Thanks.
Flags: needinfo?(mvines)
Flags: needinfo?(mchen)
Flags: needinfo?(jcheng)
I see |eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar| on my device.  Do you have a QRD8x28 :vliu?  Would be good to try to replicate your setup there then we can debug on the same hardware/gonk.  Ref: bug 961246.
Flags: needinfo?(mvines)
(In reply to Michael Vines [:m1] [:evilmachines] from comment #14)
> I see |eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar| on my device.  Do
> you have a QRD8x28 :vliu?  Would be good to try to replicate your setup
> there then we can debug on the same hardware/gonk.  Ref: bug 961246.

Does the camera hal driver for QRD8x28 the same with Nexus-5? Currently I got QRD8x26 on my hand. Based on the bug 961246 Comment 5, does it means the hardware/gonk for QRD8x26 is compatible with QRD8x28. I will then catch the environment for QRD8x26 from CAF. 

Meanwhile, I sill working on Nexus-5. The idea is I want to check the yuv data from the callback function GonkCameraSource::dataCallbackTimestamp(). It might be a good way to do it in between Nexus-4 and Nexus-5 to compare the result. Although they have different camera hal, it is still a good way to figure out the issue.
Attached file yuv-data.zip
I tried to dump yuv data from GonkCameraSource::dataCallbackTimestamp() and found got the different result.

Using the yuvplayer (catched from Internet) to play both video-n4.yuv and video-n5.yuv, video-n4.yuv contains valid data like preview saw. But for video-n5.yuv, there is totally green and seems no valid VUV data in it.

Currently my QRD8x26 build met build break so I can't try the same thing. I will than figure out the build issue.
AFAIK, the thing you got from IMemory->pointer() in GonkCameraSource::dataCallbackTimestamp() should be a "metadata" buffer (as defined in http://androidxref.com/4.4.2_r1/xref/frameworks/native/include/media/hardware/MetadataBufferType.h). The real YUV data is allocated in media_server and is not available to content process.
Attached image screenshot-1080p
:mvines, does video encoder require input frame width and height be multiple of 64?

I tried hardcoding video resolution as 720p and 1080p in gecko and got video (attached) with correct width. I wonder whether video encoder has some requirement on input frame dimension since both 1920 and 1280 are multiple of 64 but 1080, 720, and 352 are not.
Flags: needinfo?(mvines)
Attached video VID_0008-720p.3gp
Attached video VID_0009-1080p.3gp
(In reply to Ben Tian [:btian] from comment #18)
> Created attachment 8389097 [details]
> screenshot-1080p
> 
> :mvines, does video encoder require input frame width and height be multiple
> of 64?

Hey Diego, could you please check with folks on this?
Flags: needinfo?(mvines) → needinfo?(dwilson)
(In reply to Ben Tian [:btian] from comment #18)
> I tried hardcoding video resolution as 720p and 1080p in gecko and got video
> (attached) with correct width. 

Can you please share your patch for this, I'll try it on my device here to see if I get the same result.
Flags: needinfo?(btian)
(In reply to Michael Vines [:m1] [:evilmachines] from comment #22)
> (In reply to Ben Tian [:btian] from comment #18)
> > I tried hardcoding video resolution as 720p and 1080p in gecko and got video
> > (attached) with correct width. 
> 
> Can you please share your patch for this, I'll try it on my device here to
> see if I get the same result.

Ben did hardcording in the following function.

http://lxr.mozilla.org/mozilla-central/source/dom/camera/GonkRecorder.cpp#162

Assigned width(1280)/height(720) for example.
Flags: needinfo?(btian)
I had a hard time forcing 720p in gecko on QRD 8x26. I did notice it is defaulting to 352x288, when we want 720p. I believe video resolution selection regressed in bug 960611 [1].

> does video encoder require input frame width and height be multiple of 64?

Some formats do require alignment, but it looks like the root cause of this issue the the resolution selection at the gaia level. In v1.3 QRD 8x26 defaults to 720p which works fine. Let's focus on this first and maybe later decide if we want to support 352x288 (if at all).

[1] https://github.com/mozilla-b2g/gaia/blob/03acb10bdb7808b32212777c23b132bfd7e2c399/apps/camera/js/config/app.js#L70-L76
Flags: needinfo?(dwilson)
(In reply to Diego Wilson [:diego] from comment #24)
> In v1.3 QRD 8x26
> defaults to 720p which works fine. Let's focus on this first and maybe later
> decide if we want to support 352x288 (if at all).

352x288 is undesired.  Encoding should done at 1020p.
I don't think the issue at the moment is related to the encoding size.  Regardless of what size I use, mediaserver crashes after ~9 frames during recording at https://www.codeaurora.org/cgit/quic/la/platform/frameworks/av/tree/media/libstagefright/TimedEventQueue.cpp?h=b2g_kk_3.5#n358
So there's a bug in CAF TimedEventQueue.cpp that once fixed enables Camcorder to WORKSFORME on kk.
No longer blocks: 960372
Whiteboard: [CR 621219]
Status: NEW → RESOLVED
blocking-b2g: 1.4+ → -
Closed: 6 years ago
Resolution: --- → WORKSFORME
Flags: needinfo?(dmarcos)
You need to log in before you can comment on or make changes to this bug.