P09
Posts: 8
Joined: Wed Sep 04, 2019 7:25 am

RPi4 + Buster + Kodi 18.x and PVR-HTS addon (TVHeadend stream client) - SOLVED

Wed Sep 04, 2019 7:33 am

Hi have someone PVR-HTS addon for Kodi 18.x as TVHeadend stream client? I can not find any to install into the RPi4 Kodi 18.x build (see https://www.raspberrypi.org/forums/view ... 8&t=246837). Have someone some solution how to run TVHeadend stream in this Kodi build (in Buster and Raspberry Pi 4 Model B)?
Last edited by P09 on Wed Sep 04, 2019 12:15 pm, edited 1 time in total.

P09
Posts: 8
Joined: Wed Sep 04, 2019 7:25 am

Re: RPi4 + Buster + Kodi 18.x and PVR-HTS addon (TVHeadend stream client)

Wed Sep 04, 2019 12:11 pm

Solved - I am using pvr.hts addon from LibreELEC (LibreELEC (Leia) 9.1.002 ALPHA) now (my second SD card which I am trying with my RPi4). Everything ok, just Kodi 18.x is consuming a lot of CPU in Raspbian - it is still not official and optimized version of Kodi for RPi4 so we have to wait or experiment.

alfi
Posts: 1
Joined: Fri Sep 06, 2019 11:31 am

Re: RPi4 + Buster + Kodi 18.x and PVR-HTS addon (TVHeadend stream client) - SOLVED

Fri Sep 06, 2019 11:36 am

I have just successfully tried packages from deb-multimedia.org (https://www.deb-multimedia.org/dists/st ... ckage/kodi), incl. pvr-hts. Probably it is more easy and maintanable way than copying packages or binaries from LibreELEC :-)

OTTStreamingVideo
Posts: 2
Joined: Sun Dec 29, 2019 5:45 pm
Location: USA West Coast
Contact: Website Skype

Re: RPi4 + Buster + Kodi 18.x and PVR-HTS addon (TVHeadend stream client) - SOLVED

Mon Dec 30, 2019 7:46 pm

Kodi 18.4-Leia was installed on a RPi4 "Raspbian GNU/Linux 10 (buster)" with the following hardware and software:

Hauppauge WinTV-HVR-955Q for USA ATSC OTA (over-the-air) and cable

TVheadend

kodi-pvr-hts


These references were very helpful:

https://kodi.wiki/view/HOW-TO:Install_K ... spberry_Pi

https://www.raspberrypi.org/forums/view ... p?t=251645

https://www.raspberrypi.org/forums/view ... p?t=257083

https://www.instructables.com/id/Multic ... -HVR-955Q/

https://forums.plex.tv/t/plex-linux-hau ... d/197382/3

http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/

https://kodi.wiki/view/Live_TV

https://kodi.wiki/view/PVR_recording_software

https://kodi.wiki/view/Tvheadend

My recommendation is to read all the links above before starting since Kodi and Tvheadend can be complex.

The steps below used were in the shell as user pi. The RPi4 used was NOT a clean Raspbian Buster installation, so there may be some differences with a clean installation due to other software packages previously installed.

sudo apt update

sudo apt full-upgrade

sudo apt install kodi

sudo raspi-config

7 Advanced Options

A3 Memory Split

256 MB

7 Advanced Options

G2 GL (Fake KMS) OpenGL desktop driver with fake KMS (note: this resolved the kodi "ERROR: Unable to create GUI. Exiting")

sudo reboot

cd /lib/firmware (note: the two fw files were installed for the Hauppauge WinTV-HVR-955Q - perhaps only one may have been needed)

sudo wget http://palosaari.fi/linux/v4l-dvb/firmw ... 2168-02.fw

sudo wget http://palosaari.fi/linux/v4l-dvb/firmw ... 2168-01.fw

sudo reboot

note: the steps below will verify that the Hauppauge WinTV-HVR-955Q is present:

lsusb
...
Bus 001 Device 004: ID 2040:b123 Hauppauge
...

dmesg | grep dvb
[ 7.148223] dvbdev: DVB: registering new adapter (cx231xx #0)
[ 7.150055] cx231xx 1-1.4:1.1: Successfully loaded cx231xx-dvb
[ 7.150077] cx231xx 1-1.4:1.1: Cx231xx dvb Extension initialized

ls /dev/dvb
adapter0

kodi (note: kodi should now open but will not have any TV channels)

sudo apt update

sudo apt full-upgrade

sudo apt install tvheadend

In a browser:

http://localhost:9981

note: read https://kodi.wiki/view/Tvheadend and select the proper OTA and/or cable network(s) for your location

note: make sure the Tvheadend -> Configuration -> DVB Inputs -> Services .> Map services -> Map all services
lists all the channels you wish to watch

sudo apt update

sudo apt full-upgrade

sudo apt install kodi-pvr-hts

note: recommended programs were installed:

sudo apt install kodi-pvr-mythtv kodi-pvr-vuplus kodi-pvr-vdr-vnsi kodi-pvr-njoy kodi-pvr-nextpvr kodi-pvr-mediaportal-tvserver kodi-pvr-tvheadend-hts kodi-pvr-dvbviewer kodi-pvr-argustv kodi-pvr-iptvsimple kodi-audioencoder-vorbis kodi-audioencoder-flac kodi-audioencoder-lame

note: kodi -> Add-ons -> My add-ons -> PVR clients -> Tvheadend HTSP Client -> Configure

tail -f /home/pi/.kodi/temp/kodi.log

note: the error "ERROR: CVideoPlayer::OpenInputStream - error opening [/var/run/lirc/lircd]" was resolved by making the folder:

sudo mkdir /var/run/lirc

note: at this point the channels listed in the Tvheadend Services tab should be seen in kodi

In order to use a USB3.0 1 TB SSD drive (Samsung Electronics Co., Ltd Portable SSD T5) for Tvheadend recording, the following steps were required:

The USB SSD drive was formatted for EXT4, which is a common Linux format. Other formats may be OK, but EXT4 was used here.

The USB SSD drive was labeled "tvhrecordings" and should be found at "/media/pi/tvhrecordings".

Per https://www.raspberrypi.org/forums/view ... 8&t=245323 :

sudo nano /boot/cmdline.txt

add at end of line:

usb-storage.quirks=04e8:61f5:u

note: the "04e8:61f5" was obtained via "lsusb"

On my RPi4, the File Manager opened and immediately closed. This was resolved by:

sudo apt update

sudo apt full-upgrade

sudo apt install --reinstall pcmanfm

In order to verify that Tvheadend can read the USB drive, please see https://tvheadend.org/boards/5/topics/23146

sudo -u hts bash
touch /media/pi/tvhrecordings/this_is_a_test.file
exit

This failed due to Access Control Lists (note the + sign below):

sudo ls -alh /media/pi/tvhrecordings
total 24K
drwx------ 3 hts hts 4.0K Dec 26 12:06 .
drwxr-x---+ 3 root root 4.0K Dec 26 12:06 ..
drwx------ 2 hts hts 16K Dec 26 12:06 lost+found

See https://help.ubuntu.com/community/FilePermissionsACLs for more information.

sudo apt update

sudo apt full-upgrade

sudo apt install acl

getfacl /media/pi note: this part of the path would NOT allow access for hts below this folder level

getfacl: Removing leading '/' from absolute path names
# file: media/pi
# owner: root
# group: hts
user::rwx
user:pi:r-x
group::---
mask::rwx
other::r-x

This command resolved the issue:

sudo setfacl -m g:hts:rwx /media/pi/

The result was:

getfacl /media/pi
getfacl: Removing leading '/' from absolute path names
# file: media/pi
# owner: root
# group: hts
user::rwx
user:pi:r-x
group::---
group:hts:rwx
mask::rwx
other::r-x

My impression is that Raspbian (and Debian) probably default to restricting access to USB drives that the user inserted for security reasons.

Since Tvheadend runs under user "hts", then it appears necessary to allow user "hts" access via Access Control Lists.

Return to “Graphics, sound and multimedia”