LWN.net Logo

Vtunerc and software acceptance politics

By Jonathan Corbet
December 14, 2011
The kernel development process prides itself on being driven exclusively by technical concerns. Ideally, all decisions with regard to the merging of code would be based on whether that code makes technical sense or not; decisions based on "political" concerns are seen as being rather less ideal. But, as a recent discussion shows, even a seemingly "political" decision can have technical reasoning behind it.

In June 2011, Honza Petrous posted a patch to the linux-media list containing an implementation of a virtual DVB (digital video broadcast) device driver. DVB drivers normally talk to devices that tune in and capture video streams - television tuners, in other words. Honza's "vtunerc" driver, instead, drives no physical hardware at all. Instead, it serves as a sort of loopback device. One side looks like a normal DVB device; it handles all the usual DVB system calls. The other side, which shows up as /dev/vtunercN, passes a processed form of those DVB system calls back to user space. The intended use is for a user-space process to receive those operations and pass them to a remote peer elsewhere on the network; that peer would then perform the operations on a real DVB device. Using this mechanism, DVB devices could be hosted on a network in a manner that is entirely transparent to DVB applications. Honza has posted a diagram showing how the pieces fit together.

Virtual devices of this type are not unprecedented in the Linux (and Unix) tradition; the venerable virtual terminal devices work in much the same way. This type of mechanism is also sometimes used to make devices available within virtualized guest systems. But this patch was not accepted into the DVB subsystem for a number of reasons, one of which being that it would facilitate the creation of proprietary user-space drivers for DVB devices. That was the reason Honza picked up on when he went to the linux-kernel list in an attempt to gain support in November, saying that, while he didn't discount the possibility of "bad guys" abusing the interface to create closed-source drivers, he was not convinced that it justified the "aggressive NACK" the code received.

As the subsequent discussion made clear, some developers do, indeed, believe that the potential for abuse in this way is sufficient reason to keep an interface out of the mainline kernel. That is the same reasoning that has, for example, blocked the merging of graphics drivers that have proprietary user-space components. But it also turns out that there is rather more than that to this particular decision. Reasons for keeping vtunerc out include:

  • The same ABI that enables proprietary drivers also exposes a fair amount of internal information about the DVB layer. That ABI would have to remain unchanged even as DVB evolves, leading to maintenance burdens in the future.

  • There appears to be little advantage to routing all that video data through the kernel and immediately back to user space; it would make more sense for DVB applications to use a network video protocol directly and avoid the cost of routing data through the kernel.

  • DVB applications tend to work with tight timing constraints. Adding a network connection into the mix will create latencies that may well confuse these applications. Working across a network requires a different approach than talking to a device directly; operations that may be done synchronously on a local device may need to happen asynchronously with a remote device. By hiding the network link, vtunerc makes it impossible for applications to drive the device appropriately.

  • If the creation of this type of loopback device absolutely cannot be avoided, it can be done with the CUSE (char drivers in user space) interface instead of adding a new ABI.

In the discussion, it seems that much of the motivation for vtunerc comes from the fact that it would require no changes to applications at all, while a user-space approach might require such changes. In fact, it seems that there is a political problem at that level: the maintainer of the Video Disk Recorder (VDR) tool is evidently uninterested in adding real network client support. Needless to say, adding an interface to the kernel to get around an uncooperative application maintainer is not an idea that gains a lot of sympathy on the kernel side.

It is easy to see politics in decisions that do not go one's way. As the old saying goes: just because you're paranoid doesn't mean that they aren't out to get you; in some cases non-technical agendas almost certainly play a part. But it may also be that the proposed code simply is not acceptable in its current form and needs work. Going back to the mailing lists and crying "politics" is an almost certain way to turn it into a political issue, though, and with an almost certainly undesirable result.


(Log in to post comments)

Vtunerc and software acceptance politics

Posted Dec 15, 2011 7:44 UTC (Thu) by Anssi (subscriber, #52242) [Link]

This would also be easily solvable in userspace if we had a DVB library that all DVB programs used (like ALSA has). That would also have other benefits, like DVB apps not necessarily having to do all the complex parsing of event/service/etc information tables themselves, which is a lot of code.
This could maybe be part of libv4l...

BTW, regarding the VDR part of the article: A network client for VDR already exists as a plugin (e.g. streamdev), so that is not the problem.

From what I've seen, people (including me) only have an issue with the fact that VDR is designed to run on a standalone HTPC with a single display output, and setting up multiple clients running VDR relying on one "server" instance of VDR is somewhat tricky (e.g. timers/recordings/channel lists of which every VDR instance has its own idea, unless using more hacks). Changing that would be a lot of work, but I don't think the VDR maintainer would refuse integrating good patches (like the article seems to suggest).

However, the above problem is not solvable by this vtunerc driver. One still needs to have some server application serving the vtunerc DVB device. If one uses VDR, one could just develop such a server application to serve some VDR client plugins directly, which would work just as well, and without kernel involvement.

Vtunerc and software acceptance politics

Posted Dec 19, 2011 14:26 UTC (Mon) by incase (subscriber, #37115) [Link]

With regards to the VDR issue: As far as I know Klaus (the primary VDR developer) only said that he won't implement a server-client architecture for VDR. (And that he probably won't be able to do support for the implementation someone else might have done).
And to be honest: As much as I like the VDR way (the GUI, the way recordings can be programmed with vdradmin and the like,...), I really grew to like mythtv at home. Apart from two "HTPCs" (actually both ION2 based diskless clients booting of our router/firewall/homeserver), we can also watch TV on our desktops,...

Anyhow, the vtunerc approach has its drawbacks, there is no point denying that, but the technical points brought up in the discussion were at least in part ridiculous (like wanting to use a DVB device on the other side of the planet, via network), or also connected with other setups (USB DVB devices for example - in the case of sudden disconnection and also in the case of possible bandwidth problems).
Ob the political side, I think the argument of "bad" companies implementing drivers via vtunerc is taken far to serious. With the same argument, we should remove tun/tap from the kernel, because that could be used by network equipment manufacturers to implement drivers for their hardware in userspace instead of kernel modules. And, if what vtunerc does can also be achieved with CUSE, why is CUSE in the kernel, it could be used to implement.....
There are also arguments against vtunerc which are valid: It would introduce a new ABI (or at least extend an existing ABI) which would probably need to be kept basically forever.
And I personally think that distributing vtunerc as a bundle of the userspace component and the kernel module source makes more sense: If the userspace interface of the vtunerc kernel module needs to be changed, it can be changed in both parts simultaneously. On the other hand, if the kernel side interface of the module needs changes, it is "a bit" more complex (you probably need to keep all used kernel side interfaces in the source, unless you only want to support a very specific range of kernel versions).

A nice library that takes most of the DVB stuff into its hands and introduces network capabilities on the go would be good anyhow. What I would love to have was some way to provide a pool of DVB devices on various hosts as the source, with the library automatically picking the most suitable one (i.e. take an in-use tuner if it already listens to the requested multiplexer and if it doesn't have more than X channels tuned to already, most PCI-DVB cards can easily be used to stream three channels at the same time).

Vtunerc and software acceptance politics

Posted Dec 17, 2011 17:43 UTC (Sat) by Baylink (subscriber, #755) [Link]

The version I've always preferred is

"Just because people say you're paranoid, it doesn't mean there *aren't* people out to get you."

Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds