Silicondust HDHomeRun setup/DVB-C

From MythTV Official Wiki
Revision as of 22:01, 25 September 2021 by Ulmus-scott (talk | contribs) (Ulmus-scott moved page Silicondust HDHomeRun Expand to Silicondust HDHomeRun setup/DVB-C: reflect page content)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page describes how to set up an HDHomeRun DVB-C cable TV tuner for use in MythTV in Europe. It receives the signal from your cable provider via coax, which may require a subscription for the digital cable service, and connects through ethernet to your network. See Category:HDHomeRun for instructions for other devices.

MythTV setup

The following shows the key steps in configuring MythTV to use the HDHomerun Expand in different countries. (First example is the Netherlands.)

Netherlands

Cable TV provider: Telfort

Guide data: xmltv, see

https://github.com/tvgrabbers/tvgrabnlpy

Capture card setup

HDHR eu capcard config.png

Video source setup

Scanning

HDHR eu scan configuration.png

Important to: “Scan all existing transports”, marking “Ignore Signal Timeout” and mark “Search new transports”.

Belgium

This is a case study using a 4-tuner HDHR5 with the DVB-C signal from Belgian provider Telenet.

  • Install the hardware: connect the device to the LAN and to the cable TV signal. Configure DHCP on your router or server to issue a static IP address to the HDHR device, based on the MAC address printed on the device's label. Now apply power to the HDHR and verify (using ping) that you can reach it at the expected IP address.
  • Install the packages called hdhomerun_config and hdhomerun_config_gui on your backend machine.
  • On your backend machine, issue the command hdhomerun_config discover. This yields the device ID which you will need in subsequent commands:
# hdhomerun_config discover
hdhomerun device 1420577E found at 192.168.1.63
  • Since mythtv-setup's full scan may not find all or even any of the unencrypted channels, use hdhomerun_config to perform a full scan, saving it to a file:
# hdhomerun_config 1420577E scan 0 file
SCANNING: 862000000 (eu-cable:862)
LOCK: none (ss=80 snq=0 seq=0)
SCANNING: 861000000 (eu-cable:861)
LOCK: none (ss=82 snq=0 seq=0)
(...)
  • When the scan completes examine the file it generated (called "file" in the above example), looking for unencrypted programs of interest. DVB-C terminology point: a channel is equivalent to a frequency, and each channel transports multiple programs. In MythTV speak a DVB-C channel is a multiplex, and what DVB-C calls a program is a channel to MythTV. In my case, since I was interested only in the unencrypted TV programs (and not the radio programs), I found that they were present on frequencies 290 and 298.
  • Optional step: use hdhomerun_config_gui (on any machine connected to the LAN) to verify that you can watch the programs of interest. Fill in the frequency, hit the scan button, select a program and press View. (Once done viewing don't just kill vlc but rather use the Stop button).
  • In mythtv-setup create a capture card entry for each of the tuners present in the device (in my case 4 of them). Let MythTV find the device, i.e. do not enter the IP address manually. This causes the device ID to be detected as was done by hdhomerun_config discover above. MythTV appends the tuner number after a dash.
  • Create a source in mythtv-setup and associate the capture cards with it.
  • In one of the associations perform tuned scans for each of the frequencies you found in the hdhomerun_config scan file to be of interest. This creates the channels in the MythTV database.
  • Edit the channels to add xmltv IDs.
  • Start the backend, import listings data in whatever way you are used to.
  • Try using Live TV in the frontend to watch the channels of interest. It didn't work for me (probably due to bugs #13371 and #12792) so I fixed it as follows.
  • Save the following script to the mythtv home directory on the backend:
#!/bin/bash

# Call as event script with parameters %CARDID% and %CHANID%

# Parameters
OURSOURCEID=4
OURDVBCMOD=a8qam256-6875
OURHDHRDEVICE=1420577E

/usr/bin/logger $0: $*
if [ "$1" == "%CARDID%" ] ; then
   exit 0
fi

SOURCEID=`/usr/bin/mysql -umythtv -pmythtv -s -N -e "SELECT sourceid FROM capturecard WHERE cardid=$1;" mythconverg`

if [ "$SOURCEID" != "$OURSOURCEID" ] ; then
  exit 0
fi

MPLEXID=`/usr/bin/mysql -umythtv -pmythtv -s -N -e "SELECT mplexid FROM channel WHERE chanid=$2 AND sourceid=$SOURCEID;" mythconverg`

FREQ=`/usr/bin/mysql -umythtv -pmythtv -s -N -e "SELECT frequency FROM dtv_multiplex WHERE mplexid=$MPLEXID;" mythconverg`

TUNER=`/usr/bin/mysql -umythtv -pmythtv -s -N -e "SELECT RIGHT(videodevice,1) from capturecard where cardid=$1;" mythconverg`

/usr/bin/logger $0: Issuing command /usr/bin/hdhomerun_config $OURHDHRDEVICE set /tuner$TUNER/channel $OURDVBCMOD:$FREQ
/usr/bin/hdhomerun_config $OURHDHRDEVICE set /tuner$TUNER/channel $OURDVBCMOD:$FREQ

  • Edit the parameters near the top of the script. OURSOURCEID is the number of the video source associated with the HDHR. OURDVBCMOD contains the DVB-C modulation parameters as found in the hdhomerun_config scan output (the first part of the LOCK: line following each of the SCANNING: lines of interest), and OURHDHRDEVICE is the device ID.
  • Also change the database username and password if necessary.
  • In mythtv-setup, configure the script as a system event for Recording Started, for Live TV Started, and for Channel Changed, each time adding "%CARDID% %CHANID%" as parameters.
  • Try viewing the channels in the frontend again.