Skip to content

Instantly share code, notes, and snippets.

@dreamcat4
Last active August 29, 2015 14:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dreamcat4/24b756ede2a62832c75f to your computer and use it in GitHub Desktop.
dreamcat4/tvheadend docker image DRAFT documentation. Unfinished.

Tvheadend

A docker image of Tvheadend Server. For Intel x86_64 architecture.

Pre-seeded Configuration

  • The default configuration folder is VOLUME /config. A docker volume. It is not some .hts folder or anything else like that.
  • The VOLUME /config is pre-seeded from the docker Build context config/. Giving the following default settings at build time:
General
  • Default Language(s): English
Access Entries
  • The file: confg/accesscontrol/def0ad0acc0000000000000000000000

  • The default admin account '*' with no username and no password. Which was created by running tvheadend -C / --firstrun.

If you don't want the default admin account. Then you may instead pre-seed with your own previously saved tvheadend account files instead. Fork / download the dreamcat4/docker-images github repo. Delete the file def0ad0acc0000000000000000000000 from the confg/accesscontrol folder. And put there your alternative user account(s). Rebuild tvheadend image.

Recording / Default DVR Profile
  • The file: confg/dvr/config/def00000000000000000000000000000

  • Stream profile - pass through (.TS)

  • Episode Duplicate Detect: true

  • Recoding System Path: /recordings

  • Filename Charset: ASCII

  • Make Subdirectories Per Title: true

  • Include Date In Filename: true

  • Include Episode In Filename: true

  • Put Episode In Filename Before Date And Time: true

  • Remove All Unsafe Characters From Filename: true

  • Use Windows-compatible filenames: true

Recording / Timeshift
  • Enabled: true
  • On-Demand: true
  • Storage Path: /recordings/.timeshift/buffer
  • Max. Period (mins): 60 (per client)
  • Unlimited size: true
  • Max RAM Size (MB): 100

Usage

docker run -v /path/to/your/recordings:/recordings -v /etc/localtime:/etc/localtime:ro \
  dreamcat4/tvheadend [extra tvheadend args...]
  • The default arguments to start tvheadend are always tvheadend -u hts -g video -c /config. You can change this by overriding the ENTRYPOINT array.

  • Do not make your /config volume a host mount /host_folder:/mountpount. If you want this image to copy the tvheadend pre-seed configration data into /config. Else you will need to configure everything yourself from scratch. And there will be no pre-seeded configration.

  • You can create your own variant(s) of this basic image, with localized configuration that gets pre-seeded into the tvheadend /config folder. See: dreamcat4/tvheadend-uk-atlas for an example.

  • SAT>IP server(s) on your local network will not work with Docker's default NAT style of networking. Tvheadend will log: 'Scan no data failed' or similar messages indicating a failure to communicate with the SAT>IP server. To solve that you can either:

    • Specify the docker networking mode as --net="host"

    • Use dreamcat4/pipework to configure the networking instead.

  • To access DVB Tuners attached to your host machine, you will need to specify the --device flag, multiple times. For example:

device:
  - /dev/dvb/adapter0/demux0
  - /dev/dvb/adapter0/dvr0
  - /dev/dvb/adapter0/frontend0
  - /dev/dvb/adapter0/net0
  • The August DVB-T210v1 / Geniatech T220 tuner requires Linux Kernel 3.17 or higher. Other tuners will have different requirements. Run the w_scan or similar on you host system to check your DVB tuner is working properly... before trying to use it inside Tvheadend.

GUI configuration

Add networks
  • Add Network:

    • Type: DVB-T Network
    • Name: DVB-T/T2 - uk-Rowridge
    • Network Discovery: true
    • Skip Initial Scan: false
    • Pre-defined Muxes: United Kingdom: uk-Rowridge
    • Idle Scan Muxes: true
    • Save
  • Add Network:

    • Type: DVB-S Network
    • Name: DVB-S/S2 - 28.2E:Astra
    • Network Discovery: true
    • Skip Initial Scan: false
    • Pre-defined Muxes: > 28.2E:Astra
    • Orbital Position: 28.2E : Astra 2A/2C/2E/2F/Eutelsat 28A
    • Idle Scan Muxes: true
    • Save
Set up tuners
  • Set up the DVB-T/T2 usb tuners

    • For each tuner set:

      • Over-the-air EPG: false
      • Networks: DVB-T/T2 - uk-Rowridge
      • Priority: -1
      • Streaming Priority: -1
      • Save
    • (Leave alone)

      • Linked Input: Not Linked
  • Set up the sat>ip tuners

    • For each tuner set:

      • Over-the-air EPG: false
      • Satellite Positions: 1
      • Save
    • (Leave alone)

      • Master Tuner: This Tuner
      • Initial Scan: true
      • Idle Scan: true
      • Linked Input: Not Linked
      • Next tune delay: 50
      • Force teardown delay: false
    • For each position set:

      • Networks: DVB-S/S2 - 28.2E:Astra
  • Enable each 'Position' of each sat>ip tuner

  • Enable each of the sat>ip tuners

Eable bouquet
  • Wait for FreeSAT bouquets to appear

  • To force bouquet scan on same mux:

    • Wait for first few bouquets to appear
      • Find any FreeSAT bouquet
        • Similar bouquets are all on same mux
          • Name: England HD: -
          • Comment: 11426H in > 28.2E:Astra
            • Edit:
              • Enable: true
              • Rescan: true
              • Save
  • Find correct FreeSAT bouquet for your local region

grep dvb-freesat://dvbs,28.2E,0110,28 bouquet/* grep 'England HD: South/Meridian S' bouquet/*

Check All Bouquet Channels Were Added
  • Wait for bouquet to map FreeSAT channels

    • Can take from 30 minutes to 1 hour
    • Can take up to 4 (FOUR) hours to fully map everything
  • Check for healthy bouquets! Example:

    • Name: BSkyB Bouquet 13 - Test: London
    • Seen Services: 883

  • Bouquet completion - Check for new mapped Channels

  • The line of Enabled (target) Bouquet should show:

    • Services: 257 <------ before was '0'

    • Seen Services: 261

  • Services

    • Check for missing channels not in the FreeSAT Bouquet
    • Manually map missing un-mapped channels
  • Channels

    • Assign Channel Numbers
Enable OTA epg
  • Finish set up: DVB-T/T2 usb tuners

    • For each tuner set:
      • Over-the-air EPG: true
      • Save
  • Finish set up: sat>ip tuners

    • For each tuner set:
      • Over-the-air EPG: true
      • Save
  • Leave alone

Debugging Tvheadend

Test core file is generated

docker run -it --privileged=true dreamcat4/tvheadend-debug --abort
  • Must be run in privileged mode, to allow modification of /proc to set the core file path.

To get a stack trace when tvheadend hangs / freezes (Deadlock or Livelock)

If the container name is tvheadend-debug, you can just run:

docker exec -it tvheadend-debug stacktrace

And it will invoke the stacktrace script, dumping all output to stdout.

To get core files, and other artifact files

This is useful in addition to the full output. So those files can be uploaded as attachments on the issue tracker.

docker run -v ~/tvh_debug:/tmp -it --privileged=true dreamcat4/tvheadend-debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment