[mythtv-users] Card not ready

James jam at tigger.ws
Sat Nov 5 06:55:01 UTC 2022



> On 5 Nov 2022, at 2:29 pm, Stephen Worthington <stephen_agent at jsw.gen.nz> wrote:
> 
> On Sat, 5 Nov 2022 02:53:09 +0000, you wrote:
> 
>> On Fri, Nov 4, 2022 at 11:46 PM James <jam at tigger.ws> wrote:
>> 
>>> At the macro level I know what to do, it's the detail ...
>>> does instantiation of /dev/dvb/adaperN mean the card IS ready or SOON-WILL-BE ?
>> 
>> In theory (and theory and practice depends
>> on the particular driver) the device should be
>> ready after it is created, so adding an
>> appropriate device specific WANTS and
>> AFTER to the BE unit override, and if there
>> exists an appropriate udev rule to tag the
>> device(s) with the systemd value, things
>> should work as expected.
>> 
>> Note that if you are using network based
>> tuners there exists a number of 3rd party
>> tools to wait for the device(s) to come
>> online.
> 
> To get systemd to make mythbackend wait for DVB tuners, do this:
> 
> 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"
> 
> Create the above file as root, and chmod u=rw,og=r it. The line that
> matters is the dvb one - the other two are probably historical now.
> 
> Then in the systemd unit for mythbackend, add lines like these in the
> [Unit] section:
> 
> 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=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
> 
> I have 8 DVB-T2 tuners, of which 4 are used for mythbackend and one
> for fetching MHEG5 EPG data externally for mythbackend. The above
> lines makes mythbackend wait for those 5 tuners to be present before
> it is started. You can manually create a
> /etc/systemd/system/mythtv-backend.service.d/<any name>.conf file to
> put them in, if you do not already have one. Or these days, you can
> just use this command:
> 
> sudo systemctl edit mythtv-backend
> 
> Then reboot.

Thanks that saved me a heap of reading, and of course it works.
I don't grok where the lines like

dev-dvb-adapter0-frontend0.device

come from ?
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20221105/da1f9345/attachment.htm>


More information about the mythtv-users mailing list