Re: Digital-tv card drivers and API discussion

Teemu.Parkkinen_at_patria.fi
Date: 04/15/04

  • Next message: Jari Kirma: "Digital-tv card drivers and API discussion"
    To: freebsd-arch@freebsd.org
    Date: Thu, 15 Apr 2004 12:36:38 +0300
    
    

    Implementation in userspace would be quite interesting, as it does not need
    any modifications to the kernel. I have no idea if this is feasible with
    PCI-devices
    though. Linux-compatibility using libraries could probably be made, but
    needs
    some extra work when compared to direct support of linux-api. If you have
    ideas on this, I'm interested to hear them.

    As most digital-tv receivers are PCI-cards, I think it's important to have
    some
    kind of elegant mechanism to use them that is:

    a) sufficient for most (all) PCI, USB, Firewire etc digital tv-cards to use
    them
       for watching, recording and using other dvb-services.
    b) easy to add new drivers to it
    c) compatible to linux (as it is desired)

    The cards vary greatly with different options, some have decoders, some
    not,
    some use satellite antenna motors, ci-modules etc, etc. To be sufficient
    for all
    dvb-cards, the API is very important. Therefore I prefer linux-api as it
    seems to
    be rather complete. Designing completely new api takes some time and I
    don't
    know if it will be any better than linux-api, because they have been
    working on it
    for some time.

    I don't have enough experience to decide if it is ok for FreeBSD, as Jari
    said
    that it may not be OS-independent enough. I would appreciate some feedback
    on this matter, especially which is the best way to go when considering the
    long-term dvb-support in FreeBSD.

    -Teemu

                                                                                                                          
                          Jari Kirma
                          <kirma@cs.hut.fi> To: freebsd-arch@freebsd.org
                          Sent by: cc:
                          owner-freebsd-arch@ Subject: Digital-tv card drivers and API discussion
                          freebsd.org
                                                                                                                          
                                                                                                                          
                          04/15/04 10:11 AM
                                                                                                                          
                                                                                                                          

    > I am about to write a digital tv-driver for my dvb-c -card. Because
    > FreeBSD does not yet have any dvb-devices and I don't have any prior
    > driver development experience, I have a couple of questions for you.
    >
    > 1) Should we use Linux-DVB API as a reference, or should we consider
    > some changes to it? The API seems to be constantly changing and
    > improving. Version 3 is available here:
    > http://www.linuxtv.org/download/dvb/linux-dvb-api-1.0.0.pdf
    > but they are currently working on version 4. In my opinion, the API
    > should be minimal, but complete, so there is no need to constantly add
    > new features to it.
    >
    > 2) As linux kernel is GPL-licensed, I cannot just port the linux driver
    > to FreeBSD, right? In other words, we have to write the driver from
    > scratch. In this case we don't have to stick with the Linux DVB-API and
    > therefore I suggest that we give think the api through before
    > deciding how we implement it (do we follow linux api or not).
    >
    > 3) Do you have any pointers to good books or other documentation on how
    > to write device drivers for UNIX (BSD)? I already have read those from
    > FreeBSD documentation, but a decent book would be handy.

    I received my TechnoTrend USB DVB-C box couple weeks ago and pondered the
    same issues. I got same suggestions in freebsd-multimedia (like,
    compability with Linux is nice). I was also suggested to take a look at
    early work at VideoBSD <http://people.freebsd.org/~jmg/videobsd.html>. I
    haven't made any decisions on the interface yet, but I have had some
    thoughts.

    The biggest problem with Linux DVB API is that its interface is at
    device/ioctl level. I consider that a poison for reasonable OS
    independence. There's also libdvb <http://freshmeat.net/projects/libdvb/>
    which supposedly abstracts away some OS-specific parts, but based on a
    very quick glance, it might not cover whole set of operations required to
    operate DVB sensibly.

    In my case, I've been able to prototype my "driver" completely in
    userspace as it is a USB device. I use ugen device bulk pipe for device
    control, ugen isochronous pipe provides stream transport. I have had some
    problems because ugen isn't really tried and tested on (relatively)
    high-bandwith isochronous transfers, but most of those have been solved.
    I'm able to watch DVB programs converted from MPEG TS substreams to MPEG
    PS stream and piped to mplayer, completely in userland. Of course, this
    isn't really doable with devices in PCI bus, but in USB or Firewire, it
    should be pretty easy. It can also nicely separate the parts that may be
    "poisoned" by GPL outside the kernel.

    Even with this design, it would be possible to design "fake" devices
    emulating Linux DVB interface and actually redirect the operations to
    userland daemon. Extra copying of the MPEG TS stream can be avoided (I'm
    planning to write a mmapped, properly synchronised, zero-copy usb
    isochronous device driver), and testing is reasonably easy. Biggest
    problem with this approach is obviously that you have to choose either
    long latency or extra context switches...

    Please note that I have not given thought on MPEG decoding, because my
    device exports only MPEG stream. MPEG decoders should be handled in some
    intelligent, modular way, because those two parts may well be operated
    separately although they may be bundled on the same card.

    -kirma
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"

    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"


  • Next message: Jari Kirma: "Digital-tv card drivers and API discussion"

    Relevant Pages

    • Digital-tv card drivers and API discussion
      ... > FreeBSD does not yet have any dvb-devices and I don't have any prior ... > driver development experience, I have a couple of questions for you. ... > 2) As linux kernel is GPL-licensed, I cannot just port the linux driver ... I'm able to watch DVB programs converted from MPEG TS substreams to MPEG ...
      (freebsd-arch)
    • Re: Linux drivers management
      ... The kernel code base changes. ... does it usually also updates all users of the given API. ... If kernel has stable ABI, basic/default driver is included on installation CD, and all you need to do ... Do you want every Linux user going for shopping to nearest WalMart carry full linux hardware compatibility list printed out? ...
      (Linux-Kernel)
    • Re: [PATCH] Image capturing driver for Basler eXcite smart camera
      ... It provides a common API for video and thus image capture. ... The eXcite platform using it is a smart camera running linux, and the driver is for a very special piece of hardware designed into this camera. ... Its purpose is grabbing single image frames for processing within the camera itself, which is quite different from what the v4l2 API has been designed for. ...
      (Linux-Kernel)
    • Digital-tv card drivers and API discussion
      ... Because FreeBSD ... any dvb-devices and I don't have any prior driver development experience, ... The API seems to be constantly changing and improving. ... As linux kernel is GPL-licensed, I cannot just port the linux driver to ...
      (freebsd-arch)
    • Re: Fedora 5 - Intel Pro/Wireless LAN 2100 3B Mini PCI adapter woes.
      ... Intel PRO/Wireless 2100 Network Connection Adapter ... IMPORTANT INFORMATION BEFORE USING THIS DRIVER ... Intel PRO/Wireless 2100 Network Connection driver for Linux available ...
      (comp.os.linux.networking)