[mythtv-users] Udev

Bill Meek keemllib at gmail.com
Wed Nov 28 23:31:14 UTC 2018


On 11/28/18 3:41 PM, Daryl McDonald wrote:
> On Wed, Nov 28, 2018 at 4:36 PM Bill Meek <keemllib at gmail.com> wrote:
> 
>> On 11/28/18 2:51 PM, Daryl McDonald wrote:
>>> On Wed, Nov 28, 2018 at 3:48 PM Bill Meek <keemllib at gmail.com> wrote:
>>>
>>>> On 11/28/18 2:16 PM, Daryl McDonald wrote:
>>>>>>
>>>>>> Yes:  udevadm info -a -p $(udevadm info -q path -n
>>>> /dev/dvb/adapter0/dvr0)
>>>>>>
>>>>> Further testing, running the above command with only one tuner
>> installed
>>>> at
>>>>> a time shows unique info for the two HP cards and identical info for
>> the
>>>>> two PC800i cards. Would it be functional to have three Udev rules and
>>>> allow
>>>>> the second PC800i card to be labelled  what-ever?
>>>>
>>>> I *think* you'd be happy with a single rule. The question mark on the
>>>> KERNEL line
>>>> gets both of my tuners.
>>>>
>>>> Here's my rule for a single HVR-2200 card that has two tuners on it.
>> Both
>>>> record
>>>> ATSC (not on different sources.) There's no unique information about the
>>>> tuners.
>>>>
>>>> SUBSYSTEM=="dvb", \
>>>>        KERNEL=="dvb?.frontend0", \
>>>>        ATTRS{subsystem_vendor}=="0x0070", \
>>>>        ATTRS{subsystem_device}=="0x8851", \
>>>>        SYMLINK+="dvb/hvr-2200-$minor", \
>>>>        TAG+="systemd"
>>>>
>>>> #Creates:
>>>> # lrwxrwxrwx 1 root root 18 Dec 27 23:27 /dev/dvb/hvr-2200-0 ->
>>>> adapter0/frontend0
>>>> # lrwxrwxrwx 1 root root 18 Dec 27 23:27 /dev/dvb/hvr-2200-4 ->
>>>> adapter1/frontend0
>>>>
>>>>      looking at device
>>>> '/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/dvb/dvb0.frontend0':
>>>>        KERNEL=="dvb0.frontend0"
>>>>        SUBSYSTEM=="dvb"
>>>>        DRIVER==""
>>>>
>>>>      looking at device
>>>> '/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/dvb/dvb1.frontend0':
>>>>        KERNEL=="dvb1.frontend0"
>>>>        SUBSYSTEM=="dvb"
>>>>        DRIVER==""
>>>
>>> So what name do your tuners get? Can you tell which one recorded what?
>>
>> Maybe my idea of name is different from yours. It's not automatic, just a
>> choice.
>>
>> In backend setup, I just set Display name = ATSC-0.0 and ATSC-0.1 for the
>> 1st
>> tuner (it has Max recordings set to two.) The 2nd one is ATSC-1.0 etc. I
>> suppose they could get reversed at boot time. To prevent that, Ian's
>> earlier
>> suggestion sounds like it a good solution. I've not tried it.

> This rule:
>   SUBSYSTEM=="dvb", ATTRS{device}=="0x8802", PROGRAM="/bin/sh -c 'K=%k;
> K=$${K#dvb}; printf dvb/adapterPC800i/%%s $${K#*.}; exit 0'", SYMLINK+="%c"
> makes the tuner show up in the FE as "PC800i", when the new set up is
> complete, how should I modify it to find both tuners (single card, single
> tuner) that are identical?

Maybe this is the backend log? I look for them after pressing i twice
in the Watch Recordings screen.

Or, with something like this:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''
print_inputs.py: Print the inputs used for recordings

Example: print_inputs.py [title (regular expressions work)]
'''

from __future__ import print_function
import re
import sys
from MythTV import exceptions, MythBE

try:
     TITLE = sys.argv[1]
except IndexError:
     TITLE = None

try:
     BACKEND = MythBE()
except exceptions.MythError:
     sys.exit('\nUnable to connect to the backend, aborting.\n')

# pylint: disable=no-value-for-parameter
RECORDINGS = BACKEND.getRecordings()

for RECORDING in RECORDINGS:
     if TITLE and re.search(TITLE, RECORDING.title, re.IGNORECASE) is None:
         continue

     print(u'{:6}  {}  {:12.12}  {}'.format(RECORDING.chanid,
                                            RECORDING.starttime,
                                            RECORDING.inputname,
                                            RECORDING.title))

-- 
Bill


More information about the mythtv-users mailing list