Resetting Broken DVBT Cards

From MythTV Official Wiki
Jump to: navigation, search

Overview

Sometimes my DiBcom 3000MC/P compatible tv-cards cannot tune channels. It seems to be a bug within the driver or firmware. So it needed to test, if the card fails.

This problem might be related to Troubleshooting:The_file_for_this_recording_can_not_be_found. This error accoures after a recording failed.

My first solution was to reset the MythTV server every day. This solved the problem first, but after two months the computer hang up after the bios was passed. So i missed a recording for my wife and i needed a better workaround.

Then after hours of googling i noticed that you can reset the cards by reloading the kernel modules.

Reset?

This resets the cards.

/sbin/rmmod dvb_usb_dib0700 dib7000p dib7000m dib3000mc dib0070 dibx000_common dvb_usb dvb_core
/sbin/rmmod mt2060
sleep 2
/sbin/modprobe dvb_usb_dib0700
/sbin/modprobe mt2060

Problem solved?

Because all this should work unmaintained, we need a test.

function testTvCard() {
  result=`(tzap -a "$1" "$2" -t "$TUNING_TIMEOUT" -H  2>&1; echo) | grep 'FE_HAS_LOCK' | tail -n 1`
  if [ "$result" == "" ]; then
    echo "false"
  else
    echo "true"
  fi
}
for adapter in /dev/dvb/*; do
  adapter=$(echo $adapter | rev | cut -b1 | rev)
  failcount=0
  for channel in RTL\ Television ProSieben phoenix MDR\ Sachsen ZDF Euronews; do
    if [ "$(testTvCard "$adapter" "$channel")" != "true" ]; then
      failcount=$[failcount+1]
      if [ $failcount -ge 2 ]; then
        failed=$[failed+3]
        break
      fi
    fi
  done
  failed=$[failed+failcount]
  if [ $failcount -ge 3 ]; then
    # big trouble, go reset the cards
    break
  fi

Can this test start?

In order to run this test, you have to shutdown the mythbackend. At this point things getting a little bit ugly and complicated. You have to find out when the next recording is planed, if a frontend is using the backend, if the test will complete until the next recoding starts and if your script does restart the mythbackend all day long.

For now the script is not completely tested and thats why it is not attached to this document. I'll add it sooner or later :)

Other hints

Here hints for other "reset" problems with other dvb-t cards are collected.

DiBcom 7000

  • If you have problems with DiBcom 7000 cards like AVerTV DVB-T Volar, Hauppauge WinTV Nova-T-Stick, ..
    • You may read in your dmesg something like: usb 1-2.1: device descriptor read/64, error -110
    • Go and get hub-ctrl [1]
    • run: gcc -o hub-ctrl hub-ctrl.c -l usb
    • Find a USB hub supporting individual power switching
    • Use hub-ctrl to switch off the port of your DVB-T card and switch it on again
      • works! :)

History

  • 2009-10-13 Added hint for DiBcom 7000 cards
  • 2009-10-12 Problem described