All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Müller" <dave.mueller@gmx.ch>
To: Linux Media <linux-media@vger.kernel.org>
Subject: Unable to write V4L2 capture buffers to O_DIRECT file
Date: Sat, 27 Feb 2016 10:48:39 +0100	[thread overview]
Message-ID: <56D170F7.9030200@gmx.ch> (raw)

Hello

I'm trying to store data received from a V4L2 capture device to a SATA
storage device.

For performance reasons, i would like to do the writing using a file
opened with the O_DIRECT flag.


As a test, I have modified the v4lcap example code to support writing
output files directly (-F option) and to select IO mode (-B option).

Running this code results in a -EFAULT error returned by the write()
function used to write to the output file as shown below:

/ # v4lcap -c 2 -o -F /dev/sda1 -Bd
IO: O_DIRECT mode
error writing file: Bad address
        buf: 0x76ac8000, size: 0x2DC800
.error writing file: Bad address
        buf: 0x767eb000, size: 0x2DC800


Without "O_DIRECT", the v4lcap tool works ok but the overall performance
is pretty bad.

/ # v4lcap -c 2 -o -F /dev/sda1 -Bb
IO: normal mode
..


Any ideas/hints how to fix this?


HW: i.MX6Q based custom board
SW: kernel 4.2.0 + some patches (mainly CSI capture related)


Dave

                 reply	other threads:[~2016-02-27  9:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56D170F7.9030200@gmx.ch \
    --to=dave.mueller@gmx.ch \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.