[mythtv-users] Delay starting backend until initialisation of capture card(s)

Andre mythtv-list at dinkum.org.uk
Wed Feb 2 13:03:32 UTC 2011


On 2 Feb 2011, at 11:49, Jan Ceuleers wrote:

> 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?

Try this:

http://www.gossamer-threads.com/lists/mythtv/users/469387#469387


> 
> 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
> ...
> 
> 
> <dmesg.log>_______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users



More information about the mythtv-users mailing list