public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Dennis Noordsij <dennis.noordsij@movial.fi>
To: linux-dvb@linuxtv.org
Subject: [linux-dvb] Driver TerraTec Piranha functional, need some advice to finish up
Date: Mon, 02 Jun 2008 11:03:24 +0200	[thread overview]
Message-ID: <4843B75C.7090505@movial.fi> (raw)


Dear List,

I am finishing up the last stages of a new driver for the TerraTec
Piranha DVB-T adapter (Sanio SMS-100x chipset), and I have some general
questions some of the more experienced driver writers could perhaps
provide some advice on.

First of all, because of some odd USB interfacing (see my previous mail
about endpoints) I do not use the dvb-usb framework, but used the
ttusb-budget driver as my main example.

The device scans, tunes, filters PIDs etc correctly. With Kaffeine, one
can do all the usual watching-TV stuff. Some details such as reporting
signal quality are missing (so far).


* All TS data comes in from a bulk endpoint, and always in quantities of
exactly 21 TS packets (plus 8 byte header, so always exactly 3956 bytes,
never more, never less). Occasionally a command-response is received on
the same endpoint, about 12-60 bytes.

How many urbs should I have doing the reading ? Does having multiple
urbs help also for bulk transfers ? I allocate the memory with
pci_alloc_consistent, one large block of "how-many-urbs * 3965" bytes
and distribute this over the urbs.


* When receiving a TS packet (so in the urb completion irq handler) I
feed the TS data to dvb_dmx_swfilter(..). Is it OK to do that in the irq
handler? (i.e. from a performance point of view the rule is to do as
little as possbible in the completion function).


* Can usb urb read completion callbacks come back concurrently, i.e. do
I need to lock the call to dvb_dmx_swfilter(...) ?


* When loading the module, and plugging in the device, the module
becomes in-use and can not be unloaded until the device is unplugged. Is
it possible to change this, so that the module will "close" the device
and allow itself to be unloaded, event when the device is still plugged in ?


* When unplugging the device during playback, the tv app stops
(obviously), but the module gets stuck, i.e. can not be unloaded anymore
and may or may not be in some kind of sane state where replugging the
device will work. Can this be handled gracefully ?


* Some applications request the frontend status very often (many times
per second), to really ask the status from the device needs a round-trip
request. Is it common to cache the results and only ask the device for
an update occasionally, or is it normal to just ask every time ? (it
just logs a lot of debug messages so it looks like a lot, don't know if
it is really an issue)


* The only locking I am doing currently is in sending a request and
reading a response from the device (the whole routine, including the
completion wait at the read step). This is similar to the "semusb" lock
of the ttusb-budget driver. Where else should I be careful with locking ?


* Any common gotchas I should keep in mind? :-)

Thanks!

Dennis





_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

             reply	other threads:[~2008-06-02  9:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-02  9:03 Dennis Noordsij [this message]
2008-06-02 15:38 ` [linux-dvb] Driver TerraTec Piranha functional, need some advice to finish up Michael Krufky
2008-06-02 16:36   ` Dennis Noordsij
2008-06-02 18:37     ` Michael Krufky
2008-06-02 18:55       ` Dennis Noordsij

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=4843B75C.7090505@movial.fi \
    --to=dennis.noordsij@movial.fi \
    --cc=linux-dvb@linuxtv.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