[mythtv-users] Delay starting backend until initialisation of capture card(s)
Jan Ceuleers
jan.ceuleers at computer.org
Wed Feb 2 11:49:29 UTC 2011
Hi.
I am using 0.23-fixes and have recently moved a pvrusb2 device
(Hauppauge HVR 1900) from my frontend/slave backend to the master
backend. This latter machine is much faster than the former, and upon
power-up it boots and starts the backend well before the tuner is fully
up and running. As a result this tuner never gets used until I manually
restart the backend process.
Judging by the logfile (excerpt inline below) it looks like a race
condition whereby the /dev/video0 device node has been created (by
udev?) but the permissions have not yet been set properly at the time
that the backend tries to open it.
I could just insert a delay into the backend's startup script
(/etc/init.d/mythtv-backend), although since my distro (Ubuntu 10.04)
uses the event-driven upstart I'm not sure that this would work but I'm
willing to try. Still, I'd be interested in any hints on how to do this
properly:
- Which event should I make the backend wait for? According to dmesg the
/dev/video0 device is registered 14.7 seconds after boot (dmesg
attached), but an RF calibration process subsequently still takes place,
resulting in a "DVB: registering adapter 0 frontend 0"... message only
around 41.7 seconds after boot. I can see in /var/log/messages that
these events are at some time before 11:33:01 and at 11:33:19 local
time, respectively. The first of these times is just when the dmesg
buffer gets sucked into syslog, so this time stamp is inaccurate.
Anyway, the first event is before the backend starts, and the second
event is after the backend's attempt to open the tuner.
- Is it possible to tell upstart that the mythtv-backend process should
not be started until the above condition has been met?
If it makes any difference: this device is capable of both analogue
capture and DVB-T. I am using it as an analogue tuner only.
Thanks, Jan
=== Backend log excerpt for case where tuner unable to be opened ===
2011-02-02 11:33:05.914 mythbackend version: branches/release-0-23-fixes
[24158] www.mythtv.org
...
2011-02-02 11:33:09.839 Channel(/dev/video0)::Open(): Can't open video
device, error "Permission denied"
2011-02-02 11:33:09.917 mythbackend: Problem with capture cards: Card 1
failed init
...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dmesg.log
Type: text/x-log
Size: 36528 bytes
Desc: not available
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20110202/87293c96/attachment-0001.bin>
More information about the mythtv-users
mailing list