Waiting for a HD HomeRun before starting the MythTV backend

My mythtv box uses a SiliconDust HDHomeRun external network based tuner. Every so often (1 out of 5 boots) the network subsystem does not get started up before the mythtv-backend daemon. This causes an error where the mythtv-backend does not find the tuner, so it can not record any shows.
[I have my HDHomerun set up with an ethernet crossover cable directly plugged into the MythTv box, which is doing the DHCP setup of the HDHomerun directly, as opposed to having an external home router that does this. I suspect that this is the cause for the race condition.]

To fix this problem, I created a script (wait_for_hdhr) that will wait for the HDHomerun device to be found on the network before it exits. I call this script from inside the /etc/init.d/mythtv-backend script just before it starts up the mythtv-backend.

Now, about 1 out of 5 boots, instead of failing to connect to the tuner, my Ubuntu 8.04 based mythtv box will “pause” at the booting status bar for five to ten seconds. Then it drops to the text based boot-up messages and displays 8 to 12 “No HDHomeRun found yet…” messages before continuing with the bootup procedure after the network is initialized and the HDHomerun device is found.

Leave a Reply

Your email address will not be published. Required fields are marked *