TDA18271c2 RF Calibration fixes & updates

I’ve applied a few patches to the tda18271 driver that may improve tuning in certain channel ranges.

  • tda18271: fix calculation bug in tda18271_rf_tracking_filters_init

There was a misplaced parenthesis in the tda18271_rf_tracking_filters_init function, causing improper calibration. This has potential to improve tuning on some channels, and possibly reduce the time it takes for the RF tracking filter calibration to take place.

  • tda18271: prog_cal and prog_tab variables should be s32, not u8

Changeset name speaks for itself

  • tda18271: fix bad calculation of main post divider byte

There was unnecessary manipulation of the main post divider byte in the tda18271_calc_main_pll function. Get rid of that and use the retrieved value from the main_pll table.

  • tda18271: update tda18271_rf_band as per NXP’s rev.04 datasheet
  • tda18271: update tda18271c2_rf_cal as per NXP’s rev.04 datasheet

Updates to match the latest datasheet.

Thanks to Stefan Sibiga for pointing out some of these driver bugs earlier this year. I don’t know how noticeable the improvements will be, but I’d like to hear your comments if these make any difference to your tuning performance.

Please feel free to test the development repository while waiting for these fixes to get merged. The patches are located at:

8 thoughts on “TDA18271c2 RF Calibration fixes & updates

  1. I believe this also affects the hvr-1800? I have two, and they definitely have issues tuning using anything other than tvtime. To use the cards in a slave mythtv-backend, I was using which I was merging with the hg tree on until they switched to git. Now I produced a patch from the cx23885-api which I have to merge into the git tree every time I upgrade the kernel. The patch doesn’t apply cleanly. I have to manually add in the .rej’s. Do you think your patches would help? I won’t have time to patch the various trees together and try it out until next weekend. If it should help, I would definitely like to try it.

    • This does indeed also affect the analog tuner of the hvr1800 (or the digital tuner when invoking the module option alt_tuner=1)

      These patches might help with tuning and rf calibration related issues, but they’re unlikely to help with whatever functionality you’re missing from that cx23885-api tree.

  2. Michael,
    I’ve been experiencing a strange lockup of an ethernet card (Broadcom tg3 driver) that is induced by re-tunning a 2250.
    Cards do not share interrupts.
    Do you know if tunning does disable interrupts for a possibly long time ?
    (i.e. any interrupt time code can potentially get stalled longer than would be safe ?)

  3. Broadcom has confirmed that the lockup is a consequence of interrupts being disabled for longer than 5 seconds. A watchdog in the NIC firmware is timing out and that is causing
    the network failure. As this is directly related to changing channels/retuning, I have strong indication that the driver is disabling interrupts for way longer than safe to do.


  4. Hi, I’m from Argentina where PAL-N is used. I was never able to make this tuner work in analog mode so I can only use Windows to watch TV.

    Can you give me any hints about this? The tuner is not working in PAL-N? If it is working, please… HELP!

    Thanks, Matias

  5. Matias, The TDA18271c2 is a silicon tuner chip. It is used in *many* devices, some pci, pci-e, usb, etc. This tuner supports digital and analog modes of operation. I’m not sure what capture product you are using, but I recommend taking a look at for a list of supported devices. If you need some help, it might be best to ask on the linux-media mailing list. If you are using a device like the HVR2200, then kernellabs is a good place to look for help, but you’ll have to provide more information, such as the exact product you are using, along with it’s model number and rev. If you are indeed using an HVR2200, then the appropriate article to post on would be in in the HVR2200 section (saa7164 driver)

  6. Hi Michael, thanks for your quick reply. I have a Hauppauge 2250. lspci output for it is:

    03:00.0 Multimedia controller: Philips Semiconductors SAA7164 (rev 81)
    Subsystem: Hauppauge computer works Inc. WinTV HVR-2250

    Now I’m using it on a clean ubuntu 11.04 installation. I’ve tried using it with the newest kernel compiled with the patches for it but I could never make the analog tuner work here in Argentina.

    I’ll post my problems in the saa7164 section as you say, thanks again for your answer. If you have any tips you want to share with me, I’ll appreciate it.

Leave a Reply