TVConfig with vdr and softhddevice

Discussions regarding standard plugins shipped with mms

Moderator: Moderator

mtron
Posts: 13
Joined: Wed Jul 29, 2009 12:17 pm

TVConfig with vdr and softhddevice

Postby mtron » Tue Jun 05, 2012 8:30 pm

Hello!

I guess you heard about the softhddevice plugin for vdr. I updated my vdr installation and i must say that i'm impressed. The plugin is very mature already and has a very good vdpau support (no more lags & crashes when watching HD channels!)

So i want to leave vdr-sxfe and settle with the softhddevice plugin. The plugin is started during boot (with vdr) and once i'm logged in to the desktop i bring up the vdr softhddevice window with

Code: Select all

svdrpsend -p 2001 plug softhddevice RESU


i tried to put this in /etc/mms/TVConfig but it does not work as expected.

Code: Select all

### TV ####

version = 1

# path of the tv program executable
#
tv_path = /usr/bin/svdrpsend -p 2001 plug softhddevice RESU

# options to pass to executeable
#
tvopts =


mms goes off fullscreen and the svdrpsend command is executed ok but mms goes again in the foreground after this so the new softhddevice window (with the tv picture in it) is in the background :(

How can i force mms to stay "out of the picture" as long as the softhddevice window is active?

Thanks for your help!

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Re: TVConfig with vdr and softhddevice

Postby lorenzodes » Thu Jun 07, 2012 7:34 am

This probably means the command returns immediately and doesn't wait for the softhddevice window to close.

I don't use vdr myself, but I'll install it as soon as I get my PC fixed and see if I can post a patch or something.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

mtron
Posts: 13
Joined: Wed Jul 29, 2009 12:17 pm

Re: TVConfig with vdr and softhddevice

Postby mtron » Tue Jun 12, 2012 8:01 am

would appreciate that, thanks!

i thought of a hackish workaround with wmctl, but a patch to mms TV plugin would be a lot better!

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Re: TVConfig with vdr and softhddevice

Postby lorenzodes » Tue Jun 12, 2012 9:57 am

mtron wrote:would appreciate that, thanks!

i thought of a hackish workaround with wmctl, but a patch to mms TV plugin would be a lot better!


Ugh... I suppose I'd need a DVD-T decoder or something... :cry:
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Re: TVConfig with vdr and softhddevice

Postby lorenzodes » Sun Jun 17, 2012 10:14 am

Right. After an epic fail: I went to the shop to buy a DVB-T stick and bought the specific one that is not yet supported in Linux. Anyone needs a Mac/Win7 DVB-T stick? :roll:

Anyway, all is solved now (more or less), I have bought a second DVB-T stick and I have installed VDR.

I haven't installed any front-end yet, but now I know what svdrpsend is and why it will never work with mms.

Is svdrpsend the only way to launch the softhddevice plugin?
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

mtron
Posts: 13
Joined: Wed Jul 29, 2009 12:17 pm

Re: TVConfig with vdr and softhddevice

Postby mtron » Sat Jun 23, 2012 8:46 am

yes.

vdr is started during boot with softhddevice as plugin. Softhddevice itself starts in detached (=off) mode. By sending the svdrp command the detached softhddevice can be attached to a specific screen.

So to start a brainstorm on possible solutions:

- make the mms tv plugin svdrp aware, so it could query vdr itself and attach / detach the Softhddevice

- or if svdrp is too much vdr specific we could use dbus (via vdr-plugin-dbus) to communicate with vdr and do the detaching / attaching

start:
vdr-dbus-send /Plugins/softhddevice plugin.SVDRPCommand string:'RESU'
vdr-dbus-send /Plugins/softhddevice plugin.SVDRPCommand string:'ATTA'

stop:
vdr-dbus-send /Plugins/softhddevice plugin.SVDRPCommand string:'DETA'

- use some window manager hacks to see if a softhddevice window is running (e.g with wmctl) and if one is detected put this in the foreground

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Re: TVConfig with vdr and softhddevice

Postby lorenzodes » Sat Jun 23, 2012 9:49 am

Unfortunately it's not that easy.

The easier hack would be to start softhddevice the way you already do, then polling and parse the result of 'svdrpsend -p 2001 plug softhddevice STAT' every couple of second.
It's not ideal, but if it is acceptable for you, I could write and post a bash script that does that.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

mtron
Posts: 13
Joined: Wed Jul 29, 2009 12:17 pm

Re: TVConfig with vdr and softhddevice

Postby mtron » Sat Jun 23, 2012 7:59 pm

well, i guess this is sub-optimal. My current workaround is to start mms from vdr menu.

Would it be much work to extend the tv plugin (that is basically just a launcher currently) to "incorporate" the softhddevice window?

If it's too much work for one request, maybe someone might pick it up someday. But thanks for your help anyway ;)

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Re: TVConfig with vdr and softhddevice

Postby lorenzodes » Sat Jun 23, 2012 10:28 pm

mtron wrote:well, i guess this is sub-optimal. My current workaround is to start mms from vdr menu.

Would it be much work to extend the tv plugin (that is basically just a launcher currently) to "incorporate" the softhddevice window?

If it's too much work for one request, maybe someone might pick it up someday. But thanks for your help anyway ;)


Yes, it's sub-optimal, but it would be hard for mms to do what you'd like.

This is the bash script I was talking about, it launches softhddevice and wait until it gets detached or in suspended mode.

Code: Select all

#!/bin/bash

VDRADDR=localhost
VDRPORT=2001

COMMAND="svdrpsend -p 2001 plug softhddevice RESU"

NETCAT=nc

NCPID=

INFIFO="/tmp/infifo.~"

OUTFIFO="/tmp/outfifo.~"

cleanup() {
  rm -f $INFIFO $OUTFIFO

  if [ x"$NCPID" != x ]; then
    kill $NCPID
  fi

  exit

}

trap cleanup SIGHUP
trap cleanup SIGTERM
trap cleanup SIGPIPE
trap cleanup SIGABRT
trap cleanup SIGTSTP
trap cleanup SIGCHLD
trap cleanup SIGSEGV
trap cleanup SIGINT

$COMMAND

mkfifo "$INFIFO"  || cleanup
mkfifo "$OUTFIFO" || cleanup


$NETCAT $VDRADDR $VDRPORT < $INFIFO > $OUTFIFO &

NCPID=$!

exec 3<>$INFIFO
exec 4<>$OUTFIFO

while read -u4 line ; do

  case "$line" in
    [0-9][0-9][0-9]-*)
      ;;

    220* | 910*)
      sleep 1
      echo -e "PLUG softhddevice STAT" >&3
      ;;

    909* | 911* | 912*)
      echo "softhddevice is now in suspended state"
      cleanup
      ;;

    *)
      echo "Unknown return code"
      cleanup
      ;;
  esac
done


It's untested, I don't use softhddevice, all I know about it is from the source code.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"


Return to “standard-plugins”

Who is online

Users browsing this forum: Baidu [Spider], Yahoo [Bot] and 1 guest