Hauppauge WinTV-HVR-1950 Unavailable on Reboot -- Backend Starting Too Soon?

For discussion of topics specific to MythTV on linux
Post Reply
MSorice
Junior
Posts: 15
Joined: Wed Oct 27, 2021 1:18 am
United States of America

Hauppauge WinTV-HVR-1950 Unavailable on Reboot -- Backend Starting Too Soon?

Post by MSorice »

I have 2 Hauppauge tuners: a WinTV-HVR-1955 and a WinTV-HVR-1950. The 1955 works flawlessly, but the 1950 and MythTV combine for odd behavior on reboot. The inputs for the 1950 it show as "Errored" under system status. If I restart the backend, it goes back to working normally. My hypothesis is that the backend is starting too early, before the 1950 is ready.

I'm running MythTV 32.0 from the PPA under Ubuntu 20.04 with the Hauppauge Mediatree kernel. This behavior has persisted under many, many versions of Myth & Linux, so I don't think those version #s are relevant.

Anyone have any advice on how to fix this? I previously tried adding a delay to the backend startup script, but this not only failed to fix the issue, but also made restarting the backend take longer!
MSorice
Junior
Posts: 15
Joined: Wed Oct 27, 2021 1:18 am
United States of America

Re: Hauppauge WinTV-HVR-1950 Unavailable on Reboot -- Backend Starting Too Soon?

Post by MSorice »

I've tried something like this before. Still no joy, but maybe you can help me! Here's what I've done so far:

The service that runs my backend is called mythtv-backend and the problem tuner's devices are /dev/dvb/adapter1/{demux0,dvr0,frontend0,net0}.

I made the file /etc/udev/rules/99-mythtv-backend.rules. (Possibly relevant: there was such file in /etc/udev/rules before.)

I put this in /etc/udev/rules/99-mythtv-backend.rules:

Code: Select all

#
# Create systemd device units for capture devices
#
SUBSYSTEM=="video4linux", TAG+="systemd"
SUBSYSTEM=="dvb", TAG+="systemd"

Wants=dev-dvb-adapter1-frontend0.device
After=dev-dvb-adapter1-frontend0.device

Type=simple
After rebooting, the same behavior happens. The first 2 inputs (corresponding to the 1955) are nominal. The second 2 (1950) are errored, but clear up if I manually restart the backend.
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Hauppauge WinTV-HVR-1950 Unavailable on Reboot -- Backend Starting Too Soon?

Post by bill6502 »

You can review mine. Not the same card, but close.

Code: Select all

/etc/udev/rules.d/hauppauge.rules
SUBSYSTEM=="dvb", \
    KERNEL=="dvb?.frontend0", \
    ATTRS{subsystem_vendor}=="0x0070", \
    ATTRS{subsystem_device}=="0x8851", \
    SYMLINK+="dvb/hvr-2200-$minor", \
    TAG+="systemd"

/etc/systemd/system/mythtv-backend.service
[Unit]                                                                          
Description=MythTV Backend                                                      
Documentation=https://www.mythtv.org/wiki/Mythbackend
Wants=mysql.service network-online.target time-sync.target
After=mysql.service network-online.target time-sync.target
Wants=dev-dvb-adapter0-frontend0.device dev-dvb-adapter1-frontend0.device
After=dev-dvb-adapter0-frontend0.device dev-dvb-adapter1-frontend0.device
MSorice
Junior
Posts: 15
Joined: Wed Oct 27, 2021 1:18 am
United States of America

Re: Hauppauge WinTV-HVR-1950 Unavailable on Reboot -- Backend Starting Too Soon?

Post by MSorice »

Thanks, that was most helpful. I had an analogous file already in /lib/systemd/system/mythtv-backend.service. I edited the 'Wants' statements for both tuners' frontend0 devices in and that seems to have done the trick. Is it good to move that file to /etc/systemd/system/?

Assuming that leaving it in /lib is okay, I have just one more problem. The backend now takes long enough to start that the frontend gives up on finding it and winds up at the timeout screen. If I can just get it to wait, the system will finally boot to full functionality without any manual input.
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Hauppauge WinTV-HVR-1950 Unavailable on Reboot -- Backend Starting Too Soon?

Post by bill6502 »

The issue with changing the .service in /lib is that if/when a packager releases a
new version, your changes will vanish. /etc is a better choice IMNSHO.
MSorice
Junior
Posts: 15
Joined: Wed Oct 27, 2021 1:18 am
United States of America

Re: Hauppauge WinTV-HVR-1950 Unavailable on Reboot -- Backend Starting Too Soon?

Post by MSorice »

Okay, perfect. Copying the edited file to /etc and resetting the /lib one to the original produces the same effect. I surmise systemd must load relevant service definitions from /etc first. Live and learn! :D

Now I just need to figure out this frontend timing out thing. Frontend is being started right after auto-login as 'mythfrontend --service' via the Ubuntu "Startup Applications" facility. I didn't see any configuration settings or command line settings to mythfrontend to alter the delay before it gives "Unable to connect to master backend." Any ideas there?
Post Reply