Autor Thema: Linux (Ubuntu) Boot Order  (Gelesen 19911 mal)

MatzeB

  • Newbie
  • *
  • Beiträge: 2
    • Profil anzeigen
Linux (Ubuntu) Boot Order
« am: Januar 28, 2012, 07:02:21 Nachmittag »
Hi, I'm using a sundtek mediatv pro (driver from september) with tvheadend as dvr/streaming server. The setup appears to be correct as most of the time I can nicely watch TV. However I have a problem when rebooting that linux/ubuntu system.
Tvheadend is started by an init script and checks for available dvb receivers when it starts up. Sometimes at that point the sundtek driver is not ready yet it seems, so I have to manually restart tvheadend later to get it working (which sucks when you want to contorl everything with an IR remote...).

I can see that the tvheadendscript performs an "udevadm settle" before starting but that doesn't appear to be enough.

Does someone know a way to get the dependencies resolved? Maybe I can add a call to mediaclient to make it wait for the device to become ready?

Sundtek

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 8604
    • Profil anzeigen
Re:Linux (Ubuntu) Boot Order
« Antwort #1 am: Januar 28, 2012, 07:31:59 Nachmittag »
USB Devices in general are a little bit tricky,

Our driver has some feature to tell your system when a device is available.

you can add a parameter in

/etc/sundtek.conf
Zitat
device_attach=/usr/bin/script.sh


/usr/bin/script.sh
Zitat
#!/bin/bash
/etc/init.d/tvheadend restart

this will allow that you can hot plug the device any time and attach the device to tvheadend.
Failure is a good thing! I'll fix it

KnisterPeter

  • Jr. Member
  • **
  • Beiträge: 52
    • Profil anzeigen
Re:Linux (Ubuntu) Boot Order
« Antwort #2 am: Januar 29, 2012, 09:44:02 Vormittag »
Our you can use VDR instead of tvheadend and extend that with the dynamite-extension from yavdr. This is a hotplug extension to vdr.

MatzeB

  • Newbie
  • *
  • Beiträge: 2
    • Profil anzeigen
Re:Linux (Ubuntu) Boot Order
« Antwort #3 am: Januar 29, 2012, 05:45:19 Nachmittag »
@SundTek: Thanks, that option should be enough for me.
@KnisterPeter: Well tvheadend is the only solution I got working in combination with xbmc yet (with some yavdr ppa repos). VDR was easy to setup and use, but somehow the vsni connection thing never really worked for me, so I'm staying with tveheadend for now.

lajuette

  • Newbie
  • *
  • Beiträge: 39
    • Profil anzeigen
Re:Linux (Ubuntu) Boot Order
« Antwort #4 am: April 19, 2012, 10:23:16 Nachmittag »
Using the device_attach option won't work with two devices. Or at least not, if you don't want to have tvheadend restart twice after booting.

I altered my tvheadend init-script. This is my do_start(). My code is embraced by the two 'echo' statements:

do_start()
{
# Return
#   0 if daemon has been started
#   1 if daemon was already running
#   2 if daemon could not be started
        udevadm settle

echo "sleeping a few seconds to let sundtek driver settle..."
i=0
while [ $i -lt 20 ]; do
    echo $i
    devices=$(/opt/bin/mediaclient -e |grep "device"|wc -l)
    if [ $devices -eq 2 ]; then
        break
    fi
    sleep 1
    i=$(expr $i + 1 )
done
echo "continuing..."

start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
}

This is a very simple and surely not very elegant solution, but it works for me™.

While we are at it: What IS an elegant solution to find out the number of connected tv cards? ls -1 /dev/dvb/ ? Anything more... direct?

Sundtek

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 8604
    • Profil anzeigen
Re:Linux (Ubuntu) Boot Order
« Antwort #5 am: April 20, 2012, 04:18:39 Vormittag »
hmm... yes that's known so we better do it a better way.

We'll add an option to the config file J/etc/sundtek.conf
Zitat
bulk_notification=on

this will cause device_attach to be called only once when the driver is started and all devices are initialized. That way we preserve the old functionality of device_attach.

Please note this option will be available with the next driver update.
Failure is a good thing! I'll fix it

ultraman

  • Newbie
  • *
  • Beiträge: 23
    • Profil anzeigen
Re:Linux (Ubuntu) Boot Order
« Antwort #6 am: April 20, 2012, 09:04:57 Vormittag »
When can we expect new driver with this mentioned option?

Sundtek

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 8604
    • Profil anzeigen
Re:Linux (Ubuntu) Boot Order
« Antwort #7 am: April 20, 2012, 10:24:29 Vormittag »
When can we expect new driver with this mentioned option?

today or tomorrow.
Failure is a good thing! I'll fix it

lajuette

  • Newbie
  • *
  • Beiträge: 39
    • Profil anzeigen
Re:Linux (Ubuntu) Boot Order
« Antwort #8 am: April 22, 2012, 08:48:27 Nachmittag »
Great! Thank you!

Sundtek

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 8604
    • Profil anzeigen
Re:Linux (Ubuntu) Boot Order
« Antwort #9 am: April 23, 2012, 12:13:45 Nachmittag »
Driver is updated.
Failure is a good thing! I'll fix it