
$Id: notes.txt 2274 2009-04-06 00:34:42Z isely $

CHANGES

TODO

  o Is there an activity LED we can light up for OnAir?

  o Investigate Terratec grabster port (14-Mar-2009)

  o Fix FM radio on HVR-1950 - this requires updated cx25840 firmware,
    a fix in the v4l-dvb tuner module and some means to cause the
    cx25840 to issue a command to the hardware in order to get it to
    change its IF.  This issue is specific to HVR-1950.

  o Use v4l2_device_disconnect, once it gets into mainline

  o Printk devattr description field upon detection

  o Include devattr description debuginfo output

  o Investigate LIRC developer complaints (pvrusb2-list 12-Jan) for
    how this device's I2C controller identifies itself.

  o See pvrusb2-list e-mail during the week of 10-Jan about
    implementing raw mode, finally.

  o Do we need to implement isochronous I/O for raw mode?

  o Finally implement the other V4L I/O methods

  o Examine feasibility of an ALSA interface for audio while in raw
    mode

  o With raw mode implemented, can we start supporting devices with
    cx25843 chips?  (There no mpeg encoder, see e-mail from
    13-Jan-2009.)

  o Examine e-mail from storkus on 11-Dec regarding an mpeg firmare
    upload hang.  Odds are the entire device is jamming.  He triggered
    this through repeated analog <-> digital mode switching.

  o Can we completely turn off video encoding when in radio mode?
    Right now the cx23416 is probably wasting a lot of bandwidth and
    cycles generating blank video frames.

  o Examine cx23885-i2c.c for some additional tidbits to properly
    screen the I2C bus from poisonous 8/16 bit access conflicts.

  o Need to tell V4L about our parent device so that Hans' controller
    mechanism can work.  Unfortunately we're a hotplug driver and I
    don't know if I can safely "untell" V4L when the device gets
    unplugged.

  o Make cx2341x defaults here match actual defaults.  Better still,
    stop using our defaults and adopt what cx2341x is doing.

  o Implement use of video_ioctl2.

  o Examine and deal with situation involving v4l chips being touched
    at inappropriate times.

  o Examine possibility of proxying tuner and demod through pvrusb2
    core.

  o Fix warnings from cx25840 about having an impossible input

  o V4L low level drivers needs to be synchronized against core analog
    / digital state.  Either that or we can't switch away from analog
    while those pieces are still doing things!

  o When streaming is stopped, put the tuner into standby
    (TUNER_SET_STANDBY).  When not selecting television or radio, put
    the tuner into standby and KEEP it there until radio or television
    is selected again.  That will require forcibly preventing the
    sending of tuning commands.

  o Adaptec AVC-3610 support (Nick Rodgers)

  o Terratec Grabster integration (Andrea Venturi).

  o TEST corner cases of driver reinsertion / rapid hot plugging.  One
    report of a kernel oops (Andrea Venturi).

  o Select time problem in mythtv observed by phillong69 - NOBODY else
    is seeing this.  Not sure if it is a real problem, but when it
    happens to him it is persistent.  He reports that reinserting the
    driver clears the problem.  Perhaps we should implement a function
    in the driver to hard-reinitialize the device (e.g. force into
    reset, reload the firmware, let it reconnect).  However that will
    also cause us to lose communication with the device and cause the
    user app to lose contact as well.

  o Need to define default benign behavior for each chip handler when
    input is set to something, e.g. dtv, where the chip isn't needed.

  o Experiment with trying to get MPEG-TS to work on cx23416.

  o Fix comma-after-space everywhere and audit code against anal and
    overbroad checkpatch.pl script.  (sigh...)

  o Follow Mike Krufky's info and see if we can finally get
    uncompressed video working.

  o Implement mpeg-ps vs mpeg-ts stream types as actual configuration
    types.  We'll need this for DVB support.

  o Consider making the driver buffers deeper

  o Suspend the encoder when we're not using it.  Perhaps this will
    reduce the heat generation when the device is idle.

  o Email from Chris Mosier (was posted to ivtv-users, subject "bug(?)
    in reporting / setting pvrusb2 controls"

    On Sun, 19 Nov 2006, Chris Mosier wrote:

    > The definition of 0/1 appear flipped for the pvrusb2 "sample_rate"
    > control.
    >
    > Using v4l2-ctl -d /dev/video1 -L, I see
    >
    >                     sample_rate (menu) : min=0 max=1 default=0 value=1
    >                               0: 48KHz
    >                               1: 44.1KHz
    >
    > But, mplayer reports an mpeg recorded with this setting as 48KHz:
    >
    > Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
    > AUDIO: 48000 Hz, 2 ch, s16le, 384.0 kbit/25.00% (ratio: 48000->192000)
    > Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
    >
    > If I set 0, then mplayer reports 44.1
    >

  o Implement new web pages for distro-specific installation info.

  o Update controls.txt

  o Need new, brief, ascii documentation for inclusion into the kernel.

  o Rework pvrui.sh.

  o Rework FAQ.

  o Implement filter controls for the non-cx2341x mode encoder
    operation (make compatible with cx2341x case).

  o FAQ item about what to do if "No decoder present" shows up in the
    system log.

  o Document what it looks like if the wrong FX2 firmware is loaded.

  o Probably update the ivtv directory of the source snapshot (and
    rename it to v4l).

  o Pull in Java based control app

  o Use usb_buffer_alloc() / usb_buffer_free().

  o Make all debug trace printing functions use the run-time created
    name for the device.

  o FAQ item (or something) warning that mplayer with win32 codecs
    loaded might fail to read the device.

  o Make debug variable controllable in each instance (but not
    necessarily per instance); then we can provide more intelligent
    ways to query / set it.

  o Experiment with VDR - investigate reports of hangs / black screen
    issues still happening.

  o Pull in Mark's frequency table & channel searching stuff into the
    driver sources.

  o When a device gets rendered useless, how about we unregister the
    v4l interface?

  o Write a script to program a frequency table into the driver via
    sysfs.  Create several candidate frequency tables that may be used
    with the script.


VIDIOC_ENCODER_CMD:

  The use of VIDIOC_ENCODER_CMD is intended to replace not supplement
  VIDIOC_STREAMON / VIDIOC_STREAMOFF, the idea being that
  VIDIOC_ENCODER_CMD provides for additional control for
  hardware-encoding devices that the older API didn't have.  In
  particular, VIDIOC_ENCODER_CMD allows for pause / resume (as opposed
  to stop / start), and it's possible with this API to ask for a
  stream end / drain at a reasonable point (end of GOP) instead of
  just truncating whatever was in the pipeline at the point when the
  stop would otherwise take place.  The pvrusb2 driver does not
  currently support this API.  It might be nice to fix this.  The
  following issues exist:

  o The driver core needs to issue the right kind of stop command to
    the encoder to make an end-of-GOP stop work.  (This should be
    easy, just a piece of 1 bit state to pass into the state machine
    as an "option" to the shut down action.)

  o Implementing pause / resume should just be a matter of feeding the
    corresponding commands to the encoder - this should not impact the
    driver core's state machine (except we should make sure to clear
    any "pause" state we might have if the stream is stopped instead
    of being resumed).  But what use-case is there for this?  Nobody
    has ever asked for pause / resume and PVR apps (the main use for
    this driver) should never need it.

  o The V4L2 docs specify that if a STOP is issued through
    VIDIOC_ENCODER_CMD that we must not truncate the stream but rather
    drain the pipeline first.  This might be difficult, perhaps
    impossible - part of the pipeline is inside the device hardware
    behind the FX2 microcontroller and I know of know way for the FX2
    to tell us when the upstream part of that pipe is empty.  Thus we
    have no way to know when to finally shut down the downstream part
    of the pipeline.  The ivtv driver doesn't really have this problem
    because it controls the entire pipeline itself; there's no FX2
    microcontroller sitting in the middle.

  o The V4L2 docs also specify that the next read after the pipeline
    is finally drained should return 0 (EOF), AND that the next read
    after that should restart the pipeline.  We *want* new data after
    an end-of-file?  Yuck.  This may be a non-trivial amount of work,
    and it isn't even feasible unless we figure out how to correctly
    drain the pipeline in the first place (see previous point).

  For now, I'm not going to implement this.  It's an optional API
  anyway, and is not required to maintain reasonable control of the
  device.  I also fail to see a reasonable use-case for pause/resume -
  and right now I do not have a solution to implementing the required
  proper draining of the video pipeline.


DOCUMENTATION REWORK:

  o Rework driver faq.html page.

  o Remove or rewrite eeprom.html page.

  o Do something about tda9887.html.

  o Create theory of operation document and link to it.


ISSUES

  o Pulling the cable while a USB transaction is underway seems to
    leave the device in a screwed up state that can only be cleared by
    power cycling it.

  o What is up with V4L2_PIX_FMT_MPEG?  When tried with xawtv,
    everything failed.

  o Do we want to implement mmap and user-pointer I/O methods?  These
    make more sense for real frame buffer oriented I/O, but we are not
    dealing with frame buffers here.

Some test frequencies (Chicago broadcast NTSC):

Channel   Frequency  Station
   7	  175250000  WLS-TV
   9      187250000  WGN-TV
  32      579250000  WFLD-TV

Possible new emacs config settings:
 * c-basic-offset: 8
 * End:
 * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off

