Personal Video Recorder

The Requirement

TiVo revolutionised video-recording. The video-tapes & the error-prone spinning video-head were replaced by a hard-disk, & the increasingly wide TV-schedule was available as dial-up service; they had invented the PVR. Regrettably, TiVo's UK-debut in 2000 with the Thomson PVR10UK, failed after an advertising campaign which focussed solely on the ability to pause live TV, & the ≈2007 migration from terrestrial analogue broadcasting to DVB was the final nail in the coffin. Though over a decade has passed since TiVo's fall (except as offered by Virgin Media), other PVRs haven't reproduced the user-experience. In my experience, they're typically:

The Solution

Software

There are a variety of open-source s/w-projects based on GNU/Linux & kodi (formerly XBMC), which provide not only PVR-functionality but can double as a media-player:

Raspberry Pi model 3B

Hardware

In 2012 the Raspberry Pi became available. The model 3B provides:

  • a 4-core processor,
  • Ethernet & WiFi,
  • hardware-accelerated h.264-decoding.

This is sufficiently powerful to run kodi, & is quite inexpensive. Many people have pioneered such solutions, but I've detailed my specific solution & conclusions.

PVR
Component Type # Size
Case
Acrylic sheet Clear 1 A3 × 3mm
Tube Aluminium 4 72mm × 11mm
Foot Rubber 15mm
Threaded rod Stainless steel 10cm × M3
Nut 8 M3
Washer Penny 16 1cm
Computer
Raspberry Pi model 3B 1
Power-supply µUSB output-plug 5V DC × 2.5A
µSD-card Class-10 8GB
Real-time Clock DS3231
Standoff Male-female 4 M2.5
Bolt
Nut
RF
Tuner USB DVB-T2 2
Acrylic bar Square section 2cm × 5mm2
Cable-tie Black 20cm × 2.5mm
RF-adapter Male-male
Solvent Tensol 12
RF-splitter 4-way 1
Bolt Hex socket 2 8mm × M3
Nut M3
RF-adapter Female-female 1
Storage
Hard-disk drive SATA 2 2.5", 500GB
Adapter SATA-USB
Bolt Hex socket 8 8mm × M3
Grommet Rubber 10mm × 3mm
Flash-drive USB 1 Standard, Type A
Power
USB-hub 15W 1 4-port
Cable-tie Black 2 20cm × 2.5mm
Cable HDMI 1 Standard

From a glance at the list of parts, this is likely to be more expensive than the average commercial PVR, but then, they're not exactly the same product. Whereas a commercial PVR will probably give you a nose-bleed when you discover that it promised long & delivering short, this solution is:

  • networked; one can connect over ssh, or HTTP.
  • flexible; there are many s/w add-ons to enhance functionality.
  • open-source; so you can in principle, inspect the code to see how your data is being used.
  • supported; the update-frequency depends on the selected distribution.
  • repairable.
  • many of the parts are re-usable in other projects, or may previously have been purchased for abandoned projects.
  • it looks better; OK, that's subjective, but it reminds me of Orac.

If your unconvinced by these merits, you could reduce the cost by downgrading:

  • to merely one tuner (& also potentially remove the RF splitter & three gender-changers), preventing simultaneous recording.
  • from DVB-T2 to the older DVB-T standard, limiting you to standard-definition broadcasts.
  • to just one HDD / SATA-USB adapter, increasing the chance that video-files will be lost on failure.
  • to a Raspberry Pi Zero W, which with a single CPU, is slow but adequate. You'll also have to cope with a mini HDMI port & a single µUSB data-port.
  • The battery-backed real-time clock can be omitted provided that the network is available when booting, to permit synchronisation with an NTP-server.
PVR (end) PVR (oblique) PVR (plan) PVR (left)

Case

The case is built from acrylic.

  • This typically comes covered by protective plastic, which shouldn't be removed until completion.
  • The A3 sheet is scored & snapped over a straight edge (which takes considerable force), into two A4 halves, which can then be clamped together to halve the effort of subsequent processing & to force alignment of those holes they share.
  • The corners are ground to a radius of ≈1cm; a coin can be clamped to form a guide for the file. This is largely aesthetic, though my sheet of acrylic arrived by post, with one corner pre-mashed.
  • Various holes were drilled using HSS twist-drill bits.
    • For accuracy a drill-stand was used, after piloting each hole by hand using a 1mm bit which easily bites into the relatively soft protective plastic.
    • Acrylic has a tendency to ride up the thread of the drill-bit, & since it's brittle, the consequences are typically catastrophic, so each hole was progressively enlarged 1mm at a time; for holes wider than ≈7mm diameter, a step drill-bit or hole-saw is probably required.
    • The sharp 90° corner of larger holes can be rounded using a countersink.
    • Excess heat can melt & discolour the acrylic, so a low drill speed was used.
    • Wood was placed beneath the acrylic to prevent chipping round the exit-hole when the drill-bit emerges from the far side.
  • Two square-section acrylic bars are bonded to the lower face of the upper plate, between the 3 holes through which the DVB-tuners are attached using two cable-ties.

The two horizontal sheets are connected by vertical aluminium tubes, one at each corner, through each of which a threaded rod is inserted. Penny-washers are used to spread the load from the tightened threaded rods, to avoid cracking the acrylic. The length of these tubes plus twice the thickness of a penny-washer, should equal the 70mm width of the HDD plus the thickness of the grommets.

Rubber feet must be threaded onto the lower end of the threaded rods, since otherwise various protruding bolt-heads & cable-ties would prevent the case from sitting horizontally.

Computer

The Raspberry Pi is attached to the acrylic base-plate using 12mm long standoffs to enable subsequent removable of the µSD-card using one's fingers rather than tweezers. The upper end of the standoff must be female since there's insufficient space to tighten a nut; the lower end can be either gender.

There was apparently no need to attach a heat-sink to the Broadcom BCM2837 SoC. While recording two high-definition channels & watching a standard-definition recording, the temperature rose from a quiescent 39C, to 48C; well below the 80C at which throttling occurs.

The battery-backed real-time clock is connected to the GPIO-pins, but LibreELEC must be modified so that the kernel recognises it:

mount -o 'remount,rw' /flash;	# This file-system is normally mounted read-only.
echo 'dtoverlay=i2c-rtc,ds3231' >>/flash/config.txt;	# Append a line to the config-file.
reboot;
hwclock -r	# Confirm the time.
							

Storage

The selected distribution is read from a µSD-card. Either a Sandisk Extreme Plus or Samsung Pro is compatible with the Raspberry Pi, & their high speed reduces the boot-time. Though 8GB is sufficient for the smaller distributions, greater capacity costs little more. For installation, either follow "these instructions", or install NOOBS & select the required distribution.

Video files are recorded onto a level-1 RAID built from a pair of HDDs formatted with BTRFS. These were connected to the USB-hub via SATA-USB adapters, & to the case by rubber grommets to reduce transmission of vibrations.

Since kodi is not just a PVR, but a media-player, any audio files can be read from a USB flash drive. By including "mount -o 'remount,ro' device" in "/storage/.config/autostart.sh", this is mounted read-only, to avoid corruption of the file-system on power-loss.

RF

Two DVB-tuners were used, to permit simultaneous recording. I used a Geniatech MyGica T230 & a PCTV Systems tripleStick 292e, both of which worked seamlessly. DVB-T (Freeview in the UK) was piped to them via an RF-splitter. Initially I used a cheap 4-way splitter, which at best quarters the signal-power available to each output, resulting in a signal that was unacceptibly weak, so I replaced it with a higher quality 2-way inductive splitter.

The assembly of RF-components was hung from the top plate of the case, taking care to distance them from the GPIO-pins rising from the Raspberry Pi.

Power

The 7200 RPM Hitachi Z7K500s selected for storage of video files, require only ≈2W each, but can draw a rather high 5.5W on start-up (the 5400 RPM version is little better).

The power-requirements of both the HDDs & two 0.5A DVB-tuners, exceed that which can be delivered from the USB-ports of the Raspberry Pi, so they're connected to a powered USB-hub; I used a 15W Atolla 204u3.

Being low power (200mA), the USB flash-drive containing the audio files is connected directly to the Raspberry Pi, liberating all the ports of the USB-hub for higher power devices.

Back-powering the Raspberry Pi from the USB-hub also, bypasses protection & is generally deprecated, so it retains its own independent power-supply.

User-interface

The Raspberry Pi is connected to a TV using HDMI. The primary input-device is the TV's remote-control via HDMI-CEC, so no separate infra-red receiver is required. CAVEAT: the HDMI-support on older TVs may not include CEC, or may need it to be enabled, & the manufacturer may refer to it using some fatuous brand-name (typically called "something-(link|sync)").

One can also connect over Ethernet, to:

Port Name Service
8080 Chorus kodi's web-UI
9981 Tvheadend kodi's backend for managing TV

Audio

Perhaps just when playing music, or also when watching a film, the output from the TV's internal speakers doesn't quite cut it. Your TV may have a 4K resolution, but the sound it no better than an old cathode ray model; it's probably worse since the speakers typically face either rearwards or downwards, to permit a stylish narrow front bezel.

One can connect an audio amplifier (& Hi-Fi speakers) to the TV's sound output (typically RCA sockets) rather than directly to the Raspberry Pi. The TV will probably have an item buried in its menu to redirect the audio signal. One could alternatively take the audio signal from the headphone jack on the Raspberry Pi.

Conclusions

My impression is largely positive, but there are a few issues: