AnsweredAssumed Answered

DMA related crash when capturing hi-res video while storing to SSD

Question asked by ofer.livny on Nov 7, 2012

Hi all

 

I'm using an iMX6 processor in a setup that includes Sabrelite board, a custom MIPI-CSI 5MP camera, and an SSD SATA hard drive.

I'm running the latest linux 3.0.35 downloaded from the extranet.

 

I have my own custom camera driver which sits on the existing V4L2 infrastructure.

I am able to successfully run my own tests that use the V4L2 interface for capturing frames, and store them to disk or send them via TCP/IP.

 

My problems begin when I'm trying to capture a 5MP RGB888 7fps video and store over 1GB of data directly to an SSD (ext4 fs) HD.

 

The details:

- I am able to capture 5MP video and save it to an SD card. Then I get low frame rate since SD card is obviously much slower than an SSD.

- However when attempting to store the video to an SSD HD I get the following results:

  * If I capture over 1GB using my test, stop capturing, and then attempt to capture again, I get a "page allocation failure" error (attached).

  * In different attempts, the backtrace of the error is sometimes different, however usually V4L2 functions are somewhere in the stack.

  * Sometimes the error appears while storing over 1GB during the first attempt to capture.

  * When I capture less than 1GB, and then restart the test - all goes well.

- My machine has 1GB RAM. This makes me wonder if the 1GB "virtual threshold" of my crashes might be related to the memory caching linux does automatically for files using free RAM.

- I tried more than one SSD drive, tried replacing Sabrelite board, camera module, etc... It doesn't appear to be hardware related.

 

As I'm not so familiar with the DMA allocation mechanism, and I'm not so familiar with driver differences between SSD and SD card.

My next steps will be to take the simplest v4l capture test and add recording to it. Perhaps it'll work and I'll be able to understand what went wrong by the code differences. However, since I know my code is already very similar to the mxc_v4l2_capture unit test and since capturing work well when I'm NOT attempting to record more than 1GB HD - I'm not so sure it'll help.

 

Can anyone help me understand what goes wrong?

Original Attachment has been moved to: crash.log.zip

Outcomes