[mythtv-users] "Tuner 5 has an error"

Stephen Worthington stephen_agent at jsw.gen.nz
Thu Apr 25 10:50:51 UTC 2019


On Thu, 25 Apr 2019 10:37:55 +0100, you wrote:

>On 25/04/2019 05:06, mythtv at kosowsky.org wrote:
>> I am using mythtv 29.1 under Ubuntu 18.04 running under kernel 5.0.9.
>>
>> I initially installed a Hauppauge WinTV-quadHD PC Express card that
>> provides 4 dvb inputs:
>> 	 /dev/dvb/adapter0/frontend0
>>   	 /dev/dvb/adapter1/frontend0
>>   	 /dev/dvb/adapter2/frontend0
>>   	 /dev/dvb/adapter3/frontend0
>>
>> The Frontend ID for all is: LGDT3306A VSB/QAM Frontend.
>>
>> I then added a Hauppauge WinTV-HVR-955Q (aka Hauppauge Digital TV
>> Tuner for Xbox One) USB tuner.
>>
>> That tuner is recognized by Linux as /dev/dvb/adapter4/frontend4.
>> It works fine with VLC.
>>
>> Mythtv recognis the card appropriately as /dev/dvb/adapter4/frontend4
>> with Frontend ID also LGDT3306A VSB/QAM Frontend.
>>
>> Everything seems fine, but I can't switch to the card input on LiveTV.
>> System info says "Tuner 5 has an error" with details:
>>         Tuner 4 [DVB: /dev/dvb/adapter4/frontend0] has an error
>> (Note numbering is off because I name them Tuner 0 through 4 whereas
>> System info seems to count them 1 to 5,
>>
>> The mythtv-setup configuration for the tuner is the exact same as the
>> other 4.
>>
>> When I cycle through the tuners on Live TV, I go from Tuner 0 to 1 to
>> 2 to 3 and back to 0.
>> (Note that when I type M->Source, I get only the first 3 tuners...)
>>
>> The syslog shows for each tuner switch (but no errors for the 'skipped' Tuner 4):
>> Apr 24 23:49:03 consult kernel: [83954.235912] dvb_frontend: dvb_frontend_get_frequency_limits: frequency interval: tuner: 42000000...870000000, frontend: 54000000...858000000
>> Apr 24 23:49:03 consult kernel: [83959.284003] dvb_frontend: dvb_frontend_get_frequency_limits: frequency interval: tuner: 42000000...870000000, frontend: 54000000...858000000
>>
>> Any hints on how to track down the 'error' for the last tuner.
>> _______________________________________________
>
>You can safely ignore the "dvb_frontend: 
>dvb_frontend_get_frequency_limits: ..." messages (they are due to an 
>omission in a V4L update, where they should only be output under debug 
>conditions, but the debug check line is missing).
>
>
> From a clean boot the output "dmesg | grep frontend" from a terminal 
>session will show the order of detection and allocation to 
>adapter<x>/frontend<y>
>
>
>Assuming that all required firmware files are in /lib/firmware/, my 
>initial guess (without seeing mythbackend.log) is that USB Tuner is not 
>completely initialised at mythtv-backend startup, so mythtv gives the 
>error message.
>
>A quick check to see if this is the problem is to stop and start 
>mythtv-backend as follows in a terminal session:
>
>sudo systemctl stop mythtv-backend
>
>sudo systemctl start mythtv-backend
>
>now using mythfrontend try LiveTV, If the error is no longer present it 
>means a race condition at startup
>
>A quick and dirty fix, as an interim only, is to delay mythtv-backend 
>startup by a fixed time:
>
>In a terminal on the machine running mythtv backend:
>
>sudo systemctl edit mythtv-backend.service and add the following two lines:
>
>[Service]
>ExecStartPre=/bin/sleep 20
>
>Then exit from the edit screen (it uses nano by default, so Ctrl+x, then
>y, then Return key) then  reboot the machine
>
>The real fix is more complicated, if the startup delay resolves your 
>issue there is more information at 
>https://www.mythtv.org/wiki/Systemd_mythbackend_Configuration
>
>see section on Delay starting the backend until tuners have initialized
>
>
>Mike

If you are right about the tuner taking too long to start up, then it
is much better to go directly to the correct systemd fix rather than
trying the dirty one that might not work.  Here are specific
instructions for the correct fix:

First, create this file in /etc/udev/rules.d:

root at mypvr:/etc/udev/rules.d# cat 99-tuner.rules
#
# Create systemd device units for capture devices
#
SUBSYSTEM=="video4linux", TAG+="systemd"
SUBSYSTEM=="dvb", TAG+="systemd"
SUBSYSTEM=="firewire", TAG+="systemd"

The 99-tuner.rules file needs to have the right ownership and
permissions:

sudo chown root:root /etc/udev/rules.d/99-tuner.rules
sudo chmod u=rw,g=r,o=r /etc/udev/rules.d/99-tuner.rules

Then create a systemd override file for mythtv-backend:

sudo systemctl edit mythtv-backend.service

In the override file, put this:

[Unit]

Wants=dev-dvb-adapter0-frontend0.device
After=dev-dvb-adapter0-frontend0.device
Wants=dev-dvb-adapter1-frontend0.device
After=dev-dvb-adapter1-frontend0.device
Wants=dev-dvb-adapter2-frontend0.device
After=dev-dvb-adapter2-frontend0.device
Wants=dev-dvb-adapter3-frontend0.device
After=dev-dvb-adapter3-frontend0.device
Wants=dev-dvb-adapter4-frontend0.device
After=dev-dvb-adapter4-frontend0.device

That will create a file
/etc/systemd/system/mythtv-backend.service.d/override.conf.  If you
already have an override file in that directory with a different name,
edit that and add the above to it.

Then reboot.

Now the mythtv-backend service will not be started until all those
devices exist, or a long timeout (90 seconds, I think) happens.  So if
the USB tuner is unplugged or faulty, mythbackend will take a long
time before it is started.

You can see the status of the mythtv-backend service with this
command:

systemctl status mythtv-backend


More information about the mythtv-users mailing list