[mythtv-users] Backend Startup

Mike Bibbings mike.bibbings at gmail.com
Wed Nov 28 14:11:39 UTC 2018


On 28/11/2018 11:35, John wrote:
> I am experiencing flaky tuner startup at power on - reliable after 
> restart.
>
> I notice that my two dual tuners USB & PCI are loading firmware after 
> the backend starts. I tried putting a delay in mythbackend.service but 
> this does not work. The tuners only start loading firmware after 
> sytemd declares Startup finished.
>
> 11:16:13 tv systemd[1]: Started MythTV Backend.
> Nov 28 11:16:13 tv systemd[1]: Startup finished in 6.524s (firmware) + 
> 4.968s (loader) + 1.556s (kernel) + 37.074s (userspace) = 50.123s.
> Nov 28 11:16:14 tv kernel: [   39.174505] m88ds3103 1-0069: 
> downloading firmware from file 'dvb-demod-m88rs6000.fw'
> Nov 28 11:16:17 tv kernel: [   42.065433] m88ds3103 1-0069: firmware 
> version: 4.1
> Nov 28 11:16:19 tv kernel: [   44.132909] m88ds3103 2-0069: 
> downloading firmware from file 'dvb-demod-m88rs6000.fw'
> Nov 28 11:16:22 tv kernel: [   47.018474] m88ds3103 2-0069: firmware 
> version: 4.1
> Nov 28 11:16:23 tv kernel: [   48.906105] si2168 8-0064: downloading 
> firmware from file 'dvb-demod-si2168-b40-01.fw'
> Nov 28 11:16:24 tv kernel: [   49.113970] si2168 8-0064: firmware 
> version: B 4.0.11
> Nov 28 11:16:24 tv kernel: [   49.166094] si2157 11-0060: firmware 
> version: 3.0.5
> Nov 28 11:16:25 tv kernel: [   50.192247] si2168 10-0067: downloading 
> firmware from file 'dvb-demod-si2168-b40-01.fw'
> Nov 28 11:16:25 tv kernel: [   50.393052] si2168 10-0067: firmware 
> version: B 4.0.11
> Nov 28 11:16:25 tv kernel: [   50.445052] si2157 12-0063: firmware 
> version: 3.0.5
>
> How do I start the backend without systemd so that I can delay it 
> until the tuners are fully initialised?
>
> _______________________________________________ 

I don't know what your operating system is, or the tuners you have, so 
the following is general for Ubuntu/Debian based systems using systemd.

mythbackend when it starts up tests the tuners, so firmware will be 
loaded if required by the appropriate driver.

Note depending on tuner types you may need to increase timeouts using 
mythtv-setup Capture Cards.

On my systems (I am in UK) which have DVB-T/T2 tuners I use :

Signal timeout (ms) 7000 (default is 1000), and Tuning timeout (ms) 
10000 (default 3000).

These longer timeouts do not affect normal operation, but do slow down 
initial channel scan.

To ensure mythbackend is not started before tuners are ready :

a) create a udev rules file named 99-tuner.rules in /etc/udev/rules.d/

with the following contents:

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

The file needs the following permissions so :

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

b) add Wants/After to mythtv-backend service override file

do not do this in mythtv-backend.service file, it gets overwritten on 
updates

sudo systemctl edit mythtv-backend.service  and add the required 
contents for your tuners e.g.

[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

The rules correspond to the /dev/dvb/adapter<x> devices, so you need to 
adjust Wants/After to be specific to your configuration.


Mike



More information about the mythtv-users mailing list