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
Hi,
on x86 the be problem may appear too, but x86 is really not comparable here. It is different architecture with tons of different hardware/controllers/drivers.
Try the attached patch for 3.0.35 kernel. It is supposed to pre-allocate 128 MiB pool on boot time and to assign it exclusively to the mxc capture driver. When this driver will allocate its DMA buffers, the allocation should happen from the reserved pool. The memory fragmentation shouldn't affect this area since it is exclusively assigned to the capture device and only mxc driver can allocate from this pool. Note that this patch is only for capture driver and only for testing, it may be incomplete. Other IPU submodules (frame buffer, overlay, viewfinder, etc.) may be affected by fragmentation problem, too.