Page 1 of 1

accessing DVB-S tuner and media files remotely from another machine

Posted: Tue Nov 21, 2017 5:47 pm
by leo.smith
The problem:
A machine can run e.g. kaffeine or VLC and access a DVB-T or DVB-S hardware, but you want to watch the TV program on another machine on the same network.

The solution: to redirect X windows and sound to a remote client machine.

Client configuration
On the client machine you have to set both the X-server and pulse audio servers to accept incoming
Edit (as root, or using sudo) the two files:

/etc/pulse/default.pa

and add the line

load-module module-native-protocol-tcp auth-ip-acl="192.168.0.100"

(where 192.168.0.100 is the IP address of your DVB equipped server)
and also edit (with root permissions) the display manager file (I use mate, so its mdm)

/usr/share/mdm/defaults.conf

and change the line

DisallowTCP=true

to

DisallowTCP=false

In my laptop I also needed to change this line

StandardXServer=/usr/bin/X -audit 0

to
StandardXServer=/usr/bin/X -listen tcp -audit 0

At this point your client is fully capable of receiving video and audio from a remote X program that uses pulse, provided that you set up the far end correctly.

Server configuration
This was complex, so I scripted it.

At some level you need to create this script and make it executable.

#!/bin/sh
# start in the right place - this is where my hoard of multimedia files is mounted so starting there makes kaffeine default to search that for pre-recorded material
cd /var/videos
# this fixes some errors that I don't understand
export $(dbus-launch)
#detect IP address of remote client
IP=`echo $SSH_CONNECTION | awk '{print $1}'`
#redirect pulse audio to it
PULSE_SERVER=$IP:'4713'
# set default X display to remote client
DISPLAY=$IP:0.0
export PULSE_SERVER
export DISPLAY
# run kaffeine with all info and errors redirected to outer space
kaffeine > /dev/null 2>&1

Now I had already set up ssh so that I use passwordless logins to access the server, so on the client machine all I have to do is run:

ssh <myserver> <path/to/my/script-above>

If you wrap that up in a desktop launcher its a one click to launch kaffeine on the remote machine but watch and listen to it on your local client

Be aware that it needs fair bandwidth. Bad wifi may not be enough...

....and indeed it really isn't. you need 100Mbps minimum

Re: accessing DVB-S tuner and media files remotely from another machine

Posted: Tue Nov 21, 2017 6:12 pm
by mr_raider
Ingenious. I use a slightly different technique.

I install a PVR software on the machine hosting the tuner, this is the "backend". I personally use HTS-tvheadend, but have used mythtv in the past.

I then install a front end software on the target machine, usually Kodi. I can then use kodi on the front end to control, view and record streams on the backend.

Re: accessing DVB-S tuner and media files remotely from another machine

Posted: Tue Nov 21, 2017 6:20 pm
by jimallyn
Nice. I tried to access Pulse remotely one time and gave up. I will bookmark this page!

Re: accessing DVB-S tuner and media files remotely from another machine

Posted: Tue Nov 21, 2017 7:06 pm
by leo.smith
now of course on this identical software laptop, it isn't accepting X despite editing the same files in the same way. netstat shows port 6000 is not listening :(

Re: accessing DVB-S tuner and media files remotely from another machine

Posted: Tue Nov 21, 2017 7:40 pm
by Neil Edmond
It may be a while before I get around to setting it up, but I plan on a system something like the technique mr_raider is using. Bookmarking this too.