public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Antti Palosaari <crope@iki.fi>,
	Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH RFC] libv4lconvert: SDR conversion from U8 to FLOAT
Date: Sat, 16 Nov 2013 18:28:28 +0100	[thread overview]
Message-ID: <5287AB3C.90109@redhat.com> (raw)
In-Reply-To: <52877D05.4020604@iki.fi>

Hi,

On 11/16/2013 03:11 PM, Antti Palosaari wrote:
> On 15.11.2013 21:17, Antti Palosaari wrote:
>> On 15.11.2013 21:13, Devin Heitmueller wrote:
>>> On Fri, Nov 15, 2013 at 2:11 PM, Antti Palosaari <crope@iki.fi> wrote:
>>>> When I do it inside Kernel, in URB completion handler at the same
>>>> time when
>>>> copying data to videobuf2, using pre-calculated LUTs and using mmap
>>>> it eats
>>>> 0.5% CPU to transfer stream to app.
>>>>
>>>> When I do same but using libv4lconvert as that patch, it takes ~11% CPU.
>>>
>>> How are you measuring?  Interrupt handlers typically don't count
>>> toward the CPU performance counters.  It's possible that the cost is
>>> the same but you're just not seeing it in "top".
>>
>> Yes, using top and it is URB interrupt handler where I do conversion. So
>> any idea how to measure? I think I can still switch LUT to float and see
>> if it makes difference.
>
> I did some more tests. I added LUT to libv4lconvert and CPU usage of process dropped to ~3.5%. It is very simple app that just feeds data from device using mmap and conversion is done by libv4lconvert. Output is feed to standard out which I dumped to /dev/null on tests.
>
> So it is quite clear that runtime float conversion is CPU hungry when conversion rate goes that high (up to 30M conversions per sec).
>
> It is still not very much when compared to CPU needed for average signal processing after that, but it will increase directly CPU usage of that application. So is there idea to add threads for libv4lconvert in order to get conversion out from application context ?

I do not want to start using threads for libv4lconvert, if an app wants to do
the conversion in another thread, it can simply do all the v4l stuff in a
separate capture thread, like gstreamer does for example.

Regards,

Hans

  reply	other threads:[~2013-11-16 17:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-10 17:16 [PATCH RFC] libv4lconvert: SDR conversion from U8 to FLOAT Antti Palosaari
2013-11-11 13:14 ` Hans Verkuil
2013-11-11 13:40   ` Antti Palosaari
2013-11-11 13:52     ` Hans Verkuil
2013-11-15 19:11     ` Antti Palosaari
2013-11-15 19:13       ` Devin Heitmueller
2013-11-15 19:17         ` Antti Palosaari
2013-11-16 14:11           ` Antti Palosaari
2013-11-16 17:28             ` Hans de Goede [this message]
2013-11-11 14:19 ` Andy Walls
2013-11-11 14:38   ` Hans Verkuil
2013-11-14 13:45     ` Antti Palosaari
2013-11-14 13:50       ` Hans Verkuil
2013-11-18 17:43   ` Antti Palosaari
2013-11-16 17:27 ` Hans de Goede
2013-11-16 17:34   ` Antti Palosaari

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=5287AB3C.90109@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=crope@iki.fi \
    --cc=dheitmueller@kernellabs.com \
    --cc=hverkuil@xs4all.nl \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox