public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Oberritter <obi@linuxtv.org>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: HoP <jpetrous@gmail.com>, Florian Fainelli <f.fainelli@gmail.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] vtunerc: virtual DVB device - is it ok to NACK driver because of worrying about possible misusage?
Date: Tue, 06 Dec 2011 14:49:11 +0100	[thread overview]
Message-ID: <4EDE1D57.90307@linuxtv.org> (raw)
In-Reply-To: <4EDE1733.8060409@redhat.com>

On 06.12.2011 14:22, Mauro Carvalho Chehab wrote:
> On 05-12-2011 22:07, HoP wrote:
>>> I doubt that scan or w_scan would support it. Even if it supports, that
>>> would mean that,
>>> for each ioctl that would be sent to the remote server, the error
>>> code would
>>> take 480 ms
>>> to return. Try to calculate how many time w_scan would work with
>>> that. The
>>> calculus is easy:
>>> see how many ioctl's are called by each frequency and multiply by the
>>> number
>>> of frequencies
>>> that it would be seek. You should then add the delay introduced over
>>> streaming the data
>>> from the demux, using the same calculus. This is the additional time
>>> over a
>>> local w_scan.
>>>
>>> A grouch calculus with scandvb: to tune into a single DVB-C
>>> frequency, it
>>> used 45 ioctls.
>>> Each taking 480 ms round trip would mean an extra delay of 21.6 seconds.
>>> There are 155
>>> possible frequencies here. So, imagining that scan could deal with 21.6
>>> seconds of delay
>>> for each channel (with it doesn't), the extra delay added by it is 1
>>> hour
>>> (45 * 0.48 * 155).
>>>
>>> On the other hand, a solution like the one described by Florian would
>>> introduce a delay of
>>> 480 ms for the entire scan to happen, as only one data packet would be
>>> needed to send a
>>> scan request, and one one stream of packets traveling at 10GB/s would
>>> bring
>>> the answer
>>> back.
>>
>> Andreas was excited by your imaginations and calculations, but not me.
>> Now you again manifested you are not treating me as partner for
>> discussion.
>> Otherwise you should try to understand how-that-ugly-hack works.
>> But you surelly didn't try to do it at all.
>>
>> How do you find those 45 ioctls for DVB-C tune?
> 
> With strace. See how many ioctl's are called for each tune. Ok, perhaps
> scandvb
> is badly written, but if your idea is to support 100% of the
> applications, you
> should be prepared for badly written applications.
> 
> $strace -e ioctl scandvb dvbc-teste
> scanning dvbc-teste
> using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
> ioctl(3, FE_GET_INFO, 0x60a640)         = 0
> initial transponder 573000000 5217000 0 5
>>>> tune to: 573000000:INVERSION_AUTO:5217000:FEC_NONE:QAM_256
> ioctl(3, FE_SET_FRONTEND, 0x7fff5f7f2cd0) = 0
> ioctl(3, FE_READ_STATUS, 0x7fff5f7f2cfc) = 0
> ioctl(3, FE_READ_STATUS, 0x7fff5f7f2cfc) = 0
> ioctl(3, FE_READ_STATUS, 0x7fff5f7f2cfc) = 0
> ioctl(4, DMX_SET_FILTER, 0x7fff5f7f1ad0) = 0
> ioctl(5, DMX_SET_FILTER, 0x7fff5f7f1ad0) = 0
> ioctl(6, DMX_SET_FILTER, 0x7fff5f7f1ad0) = 0
> ioctl(7, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(8, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(9, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(10, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(11, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(12, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(13, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(14, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(15, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(16, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(17, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(18, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(19, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(20, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(21, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(22, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(23, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(24, DMX_SET_FILTER, 0x7fff5f7f1910) = 0
> ioctl(4, DMX_STOP, 0x1)                 = 0
> ioctl(15, DMX_STOP, 0x1)                = 0
> ioctl(11, DMX_STOP, 0x1)                = 0
> ioctl(22, DMX_STOP, 0x1)                = 0
> ioctl(17, DMX_STOP, 0x1)                = 0
> ioctl(16, DMX_STOP, 0x1)                = 0

You don't need to wait for write-only operations. Basically all demux
ioctls are write-only. Since vtunerc is using dvb-core's software demux
*locally*, errors for invalid arguments etc. will be returned as usual.

What's left is one call to FE_SET_FRONTEND for each frequency to tune
to, and one FE_READ_STATUS for each time the lock status is queried.
Note that one may use FE_GET_EVENT instead of FE_READ_STATUS to get
notified of status changes asynchronously if desired.

Btw.: FE_SET_FRONTEND doesn't block either, because the driver callback
is called from a dvb_frontend's *local* kernel thread.

Regards,
Andreas

  reply	other threads:[~2011-12-06 13:49 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-30 21:38 [RFC] vtunerc: virtual DVB device - is it ok to NACK driver because of worrying about possible misusage? HoP
2011-11-30 21:52 ` Michael Krufky
2011-12-01  0:09 ` Andreas Oberritter
2011-12-01 11:04   ` Mauro Carvalho Chehab
2011-12-01 14:58     ` HoP
2011-12-01 17:38       ` Mauro Carvalho Chehab
2011-12-01 19:59         ` HoP
2011-12-01 20:38           ` Mauro Carvalho Chehab
2011-12-01 22:55             ` Andreas Oberritter
2011-12-02 11:14               ` Mauro Carvalho Chehab
2011-12-02 11:48                 ` Andreas Oberritter
2011-12-02 11:57                 ` HoP
2011-12-02 17:33                   ` Mauro Carvalho Chehab
2011-12-02 17:49           ` Rémi Denis-Courmont
2011-12-02 18:16             ` Andreas Oberritter
2011-12-02 18:28               ` Andreas Oberritter
2011-12-02 23:19       ` Alan Cox
2011-12-03  0:37         ` HoP
2011-12-05 10:21           ` Florian Fainelli
2011-12-05 14:28             ` HoP
2011-12-05 15:16               ` Alan Cox
2011-12-05 15:18               ` Michael Krufky
2011-12-06  0:16                 ` HoP
2011-12-05 17:39               ` Mauro Carvalho Chehab
2011-12-05 20:41                 ` Andreas Oberritter
2011-12-05 20:55                   ` Alan Cox
2011-12-05 21:20                     ` Andreas Oberritter
2011-12-05 21:54                       ` Alan Cox
2011-12-06 11:18                       ` Mark Brown
2011-12-06 12:01                         ` Andreas Oberritter
2011-12-06 13:10                           ` Mauro Carvalho Chehab
2011-12-06 13:35                             ` Andreas Oberritter
2011-12-06 14:13                               ` Mauro Carvalho Chehab
2011-12-06 14:38                                 ` Andreas Oberritter
2011-12-06 15:06                                   ` Mauro Carvalho Chehab
2011-12-06 15:36                                     ` Manu Abraham
2011-12-06 11:21                   ` Mark Brown
2011-12-06 12:01                     ` Andreas Oberritter
2011-12-06 14:19                       ` Mark Brown
2011-12-06 14:48                         ` Andreas Oberritter
2011-12-07 13:49                           ` Mark Brown
2011-12-07 14:01                             ` Andreas Oberritter
2011-12-07 16:10                               ` Mark Brown
2011-12-07 16:56                                 ` Andreas Oberritter
2011-12-07 16:58                                 ` Andreas Oberritter
2011-12-07 21:48                               ` Patrick Dickey
2011-12-07 22:53                                 ` Honza Petrouš
2011-12-07 23:24                                   ` Peter Kolta
2011-12-07 23:55                                 ` Andreas Oberritter
2011-12-11 18:45                               ` Peter martin
2011-12-12 10:31                                 ` Alan Cox
2011-12-06 17:19                         ` Manu Abraham
2011-12-06  0:07                 ` HoP
2011-12-06 13:22                   ` Mauro Carvalho Chehab
2011-12-06 13:49                     ` Andreas Oberritter [this message]
2011-12-06 14:19                       ` Rémi Denis-Courmont
2011-12-06 15:05                         ` Andreas Oberritter
2011-12-06 14:20                       ` Mauro Carvalho Chehab
2011-12-06 15:00                         ` Andreas Oberritter
2011-12-06 17:35                           ` HoP
2011-12-03 16:13         ` Andreas Oberritter
2011-12-03 16:42           ` Alan Cox
2011-12-03 17:38             ` Andreas Oberritter
2011-12-03 17:21           ` VDR User
2011-12-03 17:42             ` Alan Cox
2011-12-03 17:48               ` Devin Heitmueller
2011-12-04 23:54                 ` HoP
2011-12-03 18:13               ` Hans Petter Selasky
2011-12-05  0:05                 ` HoP
2011-12-03 18:17               ` Andreas Oberritter
2011-12-03 23:30             ` Walter Van Eetvelt
2011-12-04  0:14               ` VDR User
2011-12-04 14:44                 ` Alan Cox
2011-12-04 23:22             ` HoP
2011-12-05  1:45               ` VDR User
2011-12-05  6:20                 ` HoP
2011-12-02 18:32 ` VDR User

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=4EDE1D57.90307@linuxtv.org \
    --to=obi@linuxtv.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=f.fainelli@gmail.com \
    --cc=jpetrous@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox