All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Tony IBM-MAIN <v1i9v6a6@gmail.com>, linux-media@vger.kernel.org
Subject: Re: Fwd: Re: tw68 fails with motion package running more than 4 cameras on 8 channel card
Date: Sun, 13 Mar 2016 20:34:36 +0100	[thread overview]
Message-ID: <56E5C0CC.3070908@xs4all.nl> (raw)
In-Reply-To: <56E57C01.8070906@gmail.com>

On 03/13/2016 03:41 PM, Tony IBM-MAIN wrote:
> Hans,
> 
> Sorry for the long delay in responding. Only just got around to testing
> qv4l2.
> 
> All was well with qv4l2 on 4 camera's each capturing 25fps. Then when I
> activated the 5th camera it all went pear shaped.
> One camera dies, the image on its screen freezes on the last good frame.
> All the other cameras get corrupt screens like line sync is missing.
> Horizontal lines everywhere. See
> http://www.doom.talktalk.net/2016-03-13-124047_1152x864_scrot.png.
> 
> I have seen this effect 4 years ago using zoneminder. I had two camera
> working fine in zoneminder with motion detect recording. Adding two more
> caused the effect in the screen capture. Eventually I put it down to
> Zoneminder being very CPU hungry event at the lowest framerate. I
> switched to motion and it would happily run motion detect on 6 cameras
> using about 15% on one CPU (Dual core AMD Athlon(tm) II X2 270u
> Processor 1600Mhz). Both zoneminder and motion were using the same old
> tw68 module from github.

I think I know what the problem is. The default pixelformat that the driver
choses is RGB24 (3 bytes per pixel). One stream of 720x576p25 then takes
30 MB/s, so 5 streams is 150 MB/s which is more than the max bandwidth of
a PCI device (133 MB/s).

I suspect that the default format of the old driver was probably YUYV, which
is only 20 MB/s, so 120 MB/s for 6 streams.

The solution would be to set the format to YUYV before streaming. I don't
know if that's possible with the software you're using, but you can always
use qv4l2 or v4l2-ctl (v4l2-ctl -d /dev/videoX -v pixelformat=YUYV) for this.

Another option is to scale down the image and reduce the bandwidth that
way.

> I have set up motion to capture at a relative low 2fps, it is all I
> need. Can I set qv4l2 to capture at a lower rate to see if it resolves
> the problem?

No, that's not possible. But changing the format to YUYV should fix the
issue for you.

Regards,

	Hans

      reply	other threads:[~2016-03-13 19:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <56E57B89.70406@gmail.com>
2016-03-13 14:41 ` Fwd: Re: tw68 fails with motion package running more than 4 cameras on 8 channel card Tony IBM-MAIN
2016-03-13 19:34   ` Hans Verkuil [this message]

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=56E5C0CC.3070908@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=v1i9v6a6@gmail.com \
    /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.