All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: "Rémi Denis-Courmont" <remi@remlab.net>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [RFC] vtunerc - virtual DVB device driver
Date: Wed, 22 Jun 2011 19:24:36 -0300	[thread overview]
Message-ID: <4E026BA4.9010905@redhat.com> (raw)
In-Reply-To: <201106222218.14268.remi@remlab.net>

Em 22-06-2011 16:18, Rémi Denis-Courmont escreveu:
> Le mercredi 22 juin 2011 15:17:27 Mauro Carvalho Chehab, vous avez écrit :
>>> My very little opinion is that waving GPL is way to the hell. Nobody told
>>> me why similar technologies, in different kernel parts are acceptable,
>>> but not here.
>>
>> If you want to do the networking code at userspace, why do you need a
>> kernel driver after all?
> 
> Are you seriously asking why people write tunneling drivers in user-space? Or 
> why they want to use the kernel-space socket API and protocol stack?
> 
>> The proper solution is to write an userspace
>> library for that, and either enclose such library inside the applications,
>> or use LD_PRELOAD to bind the library to handle the open/close/ioctl glibc
>> calls. libv4l does that. As it proofed to be a good library, now almost
>> all V4L applications are using it.
> 
> No. Set aside the problem of licensing, the correct way is to reuse existing 
> code, which means the layer-3/4 stacks and the socket API in net/*. That 
> avoids duplicating efforts (and bugs) and allows socket API apps to run 
> unchanged and without brittle hacks like LD_PRELOAD.
> 
> And indeed, that's what the Linux ecosystem does, thanks to the tuntap network 
> device driver.

Rémi,

Using the Kernel network layer is the right thing to do, but you don't need to add
a new driver for it: it is already there. All that userspace needs to do is to use
glibc socket's support.

It could make sense to have some sort of virtualization driver that would allow 
passing DVB API calls via, for example, the network socket API, to allow accessing
a physical DVB driver (or a remote machine DVB driver)from a VM machine. That was 
my original understanding.

Instead, the proposal is wrapper, that will be a sort of kernelspace implementation for
"LD_PRELOAD" that just returns the DVB commands back to some other application
in userspace. The real code to transmit DVB commands will be in userspace.

Technically speaking, this is a hack.

If I would code something like that, I would write it as a library with some functions like:
	connect_to_dvb()
	get_dvb_properties()
	get_frontend_parameters()
	set_frontend_parameters()
	get_dvb_ts()
And write a few patches for the userspace applications I would care.

If I wanted to provide transparent access to it, I would simply implement a LD_PRELOAD
schema, in order to help the new library deployment.

With such approach, at the initial stages (the worse case, e. g. using LD_PRELOAD), it will
be equivalent to have a kernel wrapper code, but, at long term, it will allow important
optimizations, like avoiding the need of copying data from/to the wrapper, supporting the extra
delays introducing by the network and allowing the applications to implement themselves the
dialog windows to control the network properties.

Thanks,
Mauro.

  reply	other threads:[~2011-06-22 22:24 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-19  0:10 [RFC] vtunerc - virtual DVB device driver HoP
2011-06-20 17:37 ` Rémi Denis-Courmont
2011-06-20 17:41   ` Devin Heitmueller
2011-06-20 18:17     ` HoP
2011-06-20 18:24       ` Devin Heitmueller
2011-06-20 19:10         ` Sébastien RAILLARD (COEXSI)
2011-06-20 19:36           ` Devin Heitmueller
2011-06-20 19:56             ` HoP
2011-06-20 20:02               ` Devin Heitmueller
2011-06-20 20:24                 ` HoP
2011-06-20 20:47                   ` Mauro Carvalho Chehab
2011-06-20 21:31                     ` HoP
2011-06-21  1:35                       ` Mauro Carvalho Chehab
2011-06-21 11:04                         ` Andreas Oberritter
2011-06-21 12:05                           ` Mauro Carvalho Chehab
2011-06-21 12:34                             ` Andreas Oberritter
2011-06-21 12:54                               ` Issa Gorissen
2011-06-21 12:34                             ` HoP
2011-06-21 12:59                               ` Mauro Carvalho Chehab
2011-06-21 13:44                           ` Devin Heitmueller
2011-06-21 14:15                             ` Andreas Oberritter
2011-06-21 14:34                               ` Devin Heitmueller
2011-06-21 14:35                               ` Mauro Carvalho Chehab
2011-06-21 15:09                                 ` Andreas Oberritter
2011-06-21 17:10                                   ` Mauro Carvalho Chehab
2011-06-21 17:38                                     ` HoP
2011-06-22  1:06                                       ` Markus Rechberger
2011-06-22  6:08                                         ` HoP
2011-06-22 12:17                                       ` Mauro Carvalho Chehab
2011-06-22 12:30                                         ` Andreas Oberritter
2011-06-22 12:55                                           ` Mauro Carvalho Chehab
2011-06-22 13:07                                             ` Andreas Oberritter
2011-06-22 13:21                                             ` HoP
2011-06-22 12:37                                         ` HoP
2011-06-22 13:03                                           ` Mauro Carvalho Chehab
2011-06-22 13:13                                             ` Andreas Oberritter
2011-06-22 13:45                                               ` Mauro Carvalho Chehab
2011-06-22 14:03                                                 ` HoP
2011-06-22 14:23                                                   ` Mauro Carvalho Chehab
2011-06-22 14:24                                                 ` Andreas Oberritter
2011-06-22 15:19                                                   ` Mauro Carvalho Chehab
2011-06-22 15:45                                                     ` Andreas Oberritter
2011-06-22 19:18                                         ` Rémi Denis-Courmont
2011-06-22 22:24                                           ` Mauro Carvalho Chehab [this message]
2011-06-21 14:56                             ` Bjørn Mork
2011-06-21 15:06                               ` Mauro Carvalho Chehab
2011-06-21 14:59                             ` Mauro Carvalho Chehab
2011-06-21 17:12                               ` Markus Rechberger
2011-06-21 11:41                         ` HoP
2011-06-22 16:20                       ` Steven Toth
2011-06-20 22:11             ` Bjørn Mork
2011-06-20 22:36               ` HoP
2011-06-20 22:43               ` Devin Heitmueller
2011-06-20 19:40     ` Rémi Denis-Courmont
2011-06-22 17:08 ` Michael Krufky

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=4E026BA4.9010905@redhat.com \
    --to=mchehab@redhat.com \
    --cc=linux-media@vger.kernel.org \
    --cc=remi@remlab.net \
    /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.