start VDR with a delay of 4-5sec

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
sveni_lee Offline
Fan
Posts: 386
Joined: Jan 2013
Reputation: 9
Post: #1
Is it possible to start VDR with a delay of 4-5 sec?

From time to time I have the problem that the VDR doesn't found a dvb-device because is not mountet
until VDR starts... that also happend if I rebbot the HTPC... So I thought it could help if VDR starts with a delay...

Board: B85M-ITX
CPU: i3 4330
find quote
FernetMenta Offline
Team-Kodi Developer
Posts: 3,547
Joined: Jul 2010
Reputation: 67
Location: Munich
Post: #2
I start vdr with upstart triggered by a dvb-ready event fired by udev when it detects the device.

So the answer is yes of course, if you don't want to use the mostly old fashioned startup scripts provided by the various distros.
(This post was last modified: 2014-02-11 15:00 by FernetMenta.)
find quote
sveni_lee Offline
Fan
Posts: 386
Joined: Jan 2013
Reputation: 9
Post: #3
thanks, for answer...

so i had a look into the system and I only have the vdr.conf...
If I understand right, I've to make an upstart script for VDR instand of the vdr.conf and there
I've to build in the dvb-ready event fired by udev... right

If it is something like this I've to for a HowTo...

Board: B85M-ITX
CPU: i3 4330
find quote
FernetMenta Offline
Team-Kodi Developer
Posts: 3,547
Joined: Jul 2010
Reputation: 67
Location: Munich
Post: #4
My udev rule:
Code:
#DVB
SUBSYSTEM=="dvb" , KERNEL=="dvb0.frontend0", ACTION=="add", RUN+="/sbin/initctl --quiet emit --no-wait dvb-ready"

upstart:

Code:
description "vdr"
start on (local-filesystems
            and net-device-up IFACE=lo
          and dvb-ready)

stop on runlevel [!2345]
nice -1

pre-start script
  while [ ! -e /dev/dvb/adapter0/frontend0 ]
  do
    sleep 1
  done
end script

script
  su -c /usr/local/bin/runvdr xbmc > /var/vdr/vdr.log 2>&1
end script
find quote
sveni_lee Offline
Fan
Posts: 386
Joined: Jan 2013
Reputation: 9
Post: #5
Thanks for sharing...

I'll try...

Board: B85M-ITX
CPU: i3 4330
find quote
ursli Offline
Fan
Posts: 306
Joined: Nov 2011
Reputation: 7
Post: #6
You could also add that check for the dvb adapter in your vdr startup script in /etc/init.d/vdr

My startvdr looks like this (I've got 2 dvb adapters so waiting for the second to be ready)

Code:
startvdr()
{
    if [ "$ENABLED" != "0" ] ; then
        # only start vdr if there is no other instance running
        if start-stop-daemon --start --startas $DAEMON --test \
            --name $(basename $DAEMON) --pidfile $PIDFILE >/dev/null
        then
        while ! [ -e /dev/dvb/adapter1/frontend0 ]; do
  sleep 1s;
done

Complete file: http://paste.ubuntu.com/6918149/
find quote
gdachs Offline
Junior Member
Posts: 11
Joined: Nov 2008
Reputation: 0
Post: #7
The dynamite-plugin allows to start independ to the dvb devices. They will be added by the plugin to the vdr when they come. The vdr can be started even without any dvb device.

Gerald
find quote
sveni_lee Offline
Fan
Posts: 386
Joined: Jan 2013
Reputation: 9
Post: #8
Today I had a litle bit time think about the udev-rule and upstart script.

So I think I've to do as follow:

create a udev.rule /etc/udev/rules.d/set_VDR_ready.rule
Code:
#DVB
SUBSYSTEM=="dvb" , KERNEL=="dvb0.frontend0", ACTION=="add", RUN+="/sbin/initctl --quiet emit --no-wait dvb-ready"

and create a upstart script /etc/init/vdr.conf
Code:
description "vdr-upstart"
start on (local-filesystems
            and net-device-up IFACE=lo
          and dvb-ready)

stop on runlevel [!2345]
nice -1

pre-start script
  while [ ! -e /dev/dvb/adapter0/frontend0 ]
  do
    sleep 1
  done
end script

script
  su -c /usr/sbin/runvdr > /var/vdr/vdr.log 2>&1
end script

I changed su -c /usr/sbin/runvdr because I found the runvdr only in this path...

Board: B85M-ITX
CPU: i3 4330
find quote
-DDD- Offline
Fan
Posts: 428
Joined: Sep 2013
Reputation: 8
Post: #9
The older Series 7 Board from Asrock had the Bug, that they don't detect the PCIe Card 100%, some Bios Versions detected it only sometimes. Maybe this Patch won't help then, when the BIOS doesn't recognize
the Card properly?!

But i would like to have this Delay also, cause i think my Setting in OE (Start Confluence on TV Screen) doesn't work because the vdr/vnsi isn't ready when xbmc wants to go into TV Screen.

| myHTPC |
find quote
sveni_lee Offline
Fan
Posts: 386
Joined: Jan 2013
Reputation: 9
Post: #10
So I've test it yesterday and it works perfect for me...


thanks again to FernetMenta...

Board: B85M-ITX
CPU: i3 4330
find quote