Skip to content

haigner01k/tvheadend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11,535 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TVHeadend — Octopus Net / dd_ci + Subscription Weight Fork

This is a fork of TVHeadend (branch master, version 4.3) with patches for Digital Devices Octopus Net SAT>IP hardware and per-client subscription priority (weight-based preemption).


Hardware

Digital Devices Octopus Net S2

  • SAT>IP network tuner with 2× DVB-S/S2 tuners
  • Built-in CI/CAM slot for encrypted channels (e.g. ORF HD Austria, ServusTV HD)
  • Firmware tested: 2.2.0

Setup:

  • TVHeadend runs in Docker on Raspberry Pi 5 (Debian Bookworm)
  • Clients: Kodi via HTSP

Patches

1. Digital Devices CI (dd_ci) — src/input/mpegts/satip/satip_frontend.c, src/input/mpegts/satip/satip_rtsp.c

Adds the x_pmt=<PMT-PID> parameter to RTSP PLAY requests, required to activate the CI slot on Digital Devices Octopus Net devices. The PMT PID of the currently streamed service is detected automatically and passed to the Octopus Net via RTSP.

Without this patch, encrypted channels fail to descramble even though the Octopus Net has a valid CI/CAM inserted.

Apply: bash apply_dd_ci_patch.sh

Important: Channel Scan Settings

When scanning for channels, set "Remove scrambled bits" to 1 (enabled) in the mux scan settings. Otherwise TVHeadend will attempt to descramble channels locally instead of relying on the Octopus Net CI — resulting in "Invalid start code" errors in the log.


2. Per-Client Subscription Weight — src/access.c, src/access.h, src/htsp_server.c, src/webui/static/app/acleditor.js

Adds a Subscription weight field to Access Entries (visible under Advanced Settings in the Web UI).

  • Higher weight = higher priority
  • 0 = default (100)
  • When a higher-weight client subscribes to a channel, all lower-weight subscriptions on different channels are preempted (unsubscribed)
  • Clients watching the same channel are never preempted (mux sharing)

Example configuration:

Network / IP Weight Description
10.0.0.100/32 200 Primary Kodi client
10.0.0.23/32 120 Secondary client
10.0.0.24/32 110 Tertiary client
0.0.0.0/0 100 Default (wildcard)

Behaviour:

  • 10.0.0.100 subscribes to ORF1 HD → 10.0.0.23 watching ServusTV HD is preempted
  • 10.0.0.100 and 10.0.0.23 both watch ORF1 HD → no preemption, mux sharing

Note: --noacl must not be used, otherwise Access Entries are bypassed and weights have no effect.


Building

docker build -t tvheadend-ddci:latest .

Running

docker run -d --name tvheadend --restart unless-stopped --network host \
  -v /path/to/config:/config \
  -v /path/to/recordings:/recordings \
  tvheadend-ddci:latest \
  --nosyslog -u tvheadend -g tvheadend -c /config \
  --satip_xml http://<OCTOPUS_NET_IP>/octoserve/octonet.xml

Known Issues / Notes

  • --noacl disables Access Control entirely → subscription weights will not work
  • The Octopus Net CI slot is transparent to TVHeadend (no local CI visible in TVH)
  • RTP/TCP must be disabled (Octopus Net firmware 2.2.0 is incompatible)
  • Tuner priority can be configured in TVH adapter settings depending on your setup
  • After RTSP errors on the CI tuner, an Octopus Net reboot may be required to reset the CI state

Branch

dd_ci_patched

Upstream

https://github.com/tvheadend/tvheadend


Development Notes

The patches in this fork were developed with the assistance of Claude Sonnet 4.6 (Anthropic AI). Debugging, code analysis, and patch implementation were done iteratively through AI-assisted pair programming.

About

Tvheadend is the leading TV streaming server for Linux with ATSC, DVB-C/C2, DVB-S/S2, DVB-T/T2, IPTV, SAT>IP and unix pipe input sources

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 86.4%
  • JavaScript 8.8%
  • Python 3.2%
  • Other 1.6%