[mythtvnz] New install setup - recording problem

Stephen Worthington stephen_agent at jsw.gen.nz
Sat Jul 30 04:46:45 BST 2016


On Sat, 30 Jul 2016 11:02:35 +1200, you wrote:

>
>
>> When you install a Linux system, the group ids and user ids are
>> assigned to the various groups and users.  But they can vary from one
>> Linux install to another, even if you use the same version of Linux.
>> So if you move a drive from one system to another, you often find that
>> the ids do not match and you get the wrong group or user.  So you may
>> need to chown all the directories and files to what they should be.
>> The chown command has a -R option to recurse directories, which helps.
>>
>> As for your tuners, did you just restore the database without checking
>> the order the tuners are in?  Tuners can move in order between boots,
>> and they certainly move when installed in different slots or USB
>> ports, let alone when moved to a different motherboard.  So you need
>> to see which tuner should be on which /dev/dvb address and make sure
>> they are on the same ones that your old system had them.  This command
>> will show you what the database says the tuner addresses are:
>>
>> select
>> cardid,parentid,videodevice,cardtype,defaultinput,tunechan,startchan,displayname,channel_timeout
>> from capturecard order by videodevice;
>>
>> The videodevice field gives the address of the tuner.  So then you
>> need to use the adapter_nr option in your tuner driver setup to assign
>> the tuners to the correct address.  Not all tuners have the adapter_nr
>> option, and if any of yours do not, you will need to use udev rules to
>> assign them to the correct address.  But check first for adapter_nr as
>> that is much easier to use.
>>
>> The modinfo command followed by the device driver name gives the
>> options for drivers.  Here is what my DVB-T drivers say:
>>
>> root at mypvr:/etc/modprobe.d# modinfo dvb_usb_dib0700 | grep parm
>> parm:           force_lna_activation:force the activation of
>> Low-Noise-Amplifyer(s) (LNA), if applicable for the device (default:
>> 0=automatic/off). (int)
>> parm:           debug:set debugging level (1=info,2=fw,4=fwdata,8=data
>> (or-able)). (int)
>> parm:           nb_packet_buffer_size:Set the dib0700 driver data
>> buffer size. This parameter corresponds to the number of TS packets.
>> The actual size of the data buffer corresponds to this parameter
>> multiplied by 188 (default: 21) (int)
>> parm:           adapter_nr:DVB adapter numbers (array of short)
>>
>> To use the adapter_nr option, you need to create a .conf file in
>> /etc/modprobe.d.  I have mine in options-dvb.conf.  This is what I
>> have for my tuners:
>>
>> #Set adapter numbers for Nova-TD 500 DVB-T card (dual tuners), and
>> AverMedia AverTV DVB-T Volar USB tuner (they use the same driver).
>> options dvb_usb_dib0700 adapter_nr=0,1,2
>>
>> #Set adapter number for TurboSight TBS5922 QBOX S2 DVB-S2 USB tuner.
>> options dvb-usb-tbsqbox22 adapter_nr=3
>>
>> #Set adapter number for TeVii S470 DVB-S2 PCIe x1 card.
>> options cx23885 adapter_nr=4
>>
>> Finding the name of your tuner driver can be a bit difficult.  If you
>> do not know what it is, looking through the kern.log file for what
>> happens at boot time will normally tell you, but there are some
>> (fortunately rare) drivers that do not actually post any messages that
>> have the driver name in them.
>>
>> If you can not use adapter_nr, let us know and we can try to help with
>> udev rules.
>>
>> It is also possible that your tuner order is stable with each boot, in
>> which case you could just delete all your tuners in mythtv-setup and
>> re-create them.
>>
>
>I'm not sure I have the info you're asking for but here goes:
>
>+--------+----------+-----------------------------+-----------+--------------+----------+-----------+-------------+-----------------+
>| cardid | parentid | videodevice                 | cardtype  |  
>defaultinput | tunechan | startchan | displayname | channel_timeout |
>+--------+----------+-----------------------------+-----------+--------------+----------+-----------+-------------+-----------------+
>|     37 |       27 | /dev/dvb/adapter0/frontend0 | DVB       |  
>Television   | NULL     | 1         | card-0      |            3000 |
>|     35 |       27 | /dev/dvb/adapter0/frontend0 | DVB       |  
>Television   | NULL     | 1         | card-0      |            3000 |
>|     36 |       27 | /dev/dvb/adapter0/frontend0 | DVB       |  
>Television   | NULL     | 1         | card-0      |            3000 |
>|     27 |        0 | /dev/dvb/adapter0/frontend0 | DVB       |  
>Television   | NULL     | 1         | card-0      |            3000 |
>|     28 |       27 | /dev/dvb/adapter0/frontend0 | DVB       |  
>Television   | NULL     | 1         | card-0      |            3000 |
>|     40 |       29 | /dev/dvb/adapter1/frontend0 | DVB       |  
>Television   | NULL     | 1         | card-1      |            3000 |
>|     38 |       29 | /dev/dvb/adapter1/frontend0 | DVB       |  
>Television   | NULL     | 1         | card-1      |            3000 |
>|     39 |       29 | /dev/dvb/adapter1/frontend0 | DVB       |  
>Television   | NULL     | 1         | card-1      |            3000 |
>|     29 |        0 | /dev/dvb/adapter1/frontend0 | DVB       |  
>Television   | NULL     | 1         | card-1      |            3000 |
>|     30 |       29 | /dev/dvb/adapter1/frontend0 | DVB       |  
>Television   | NULL     | 1         | card-1      |            3000 |
>|     41 |       31 | 11111EB6-0                  | HDHOMERUN |  
>Television   | NULL     | 1         | HDHR-0      |            3000 |
>|     31 |        0 | 11111EB6-0                  | HDHOMERUN |  
>Television   | NULL     | 1         | HDHR-0      |            3000 |
>|     32 |       31 | 11111EB6-0                  | HDHOMERUN |  
>Television   | NULL     | 1         | HDHR-0      |            3000 |
>|     42 |       31 | 11111EB6-0                  | HDHOMERUN |  
>Television   | NULL     | 1         | HDHR-0      |            3000 |
>|     43 |       31 | 11111EB6-0                  | HDHOMERUN |  
>Television   | NULL     | 1         | HDHR-0      |            3000 |
>|     33 |        0 | 11111EB6-1                  | HDHOMERUN |  
>Television   | NULL     | 1         | HDHR-1      |            3000 |
>|     34 |       33 | 11111EB6-1                  | HDHOMERUN |  
>Television   | NULL     | 1         | HDHR-1      |            3000 |
>|     44 |       33 | 11111EB6-1                  | HDHOMERUN |  
>Television   | NULL     | 1         | HDHR-1      |            3000 |
>|     45 |       33 | 11111EB6-1                  | HDHOMERUN |  
>Television   | NULL     | 1         | HDHR-1      |            3000 |
>|     46 |       33 | 11111EB6-1                  | HDHOMERUN |  
>Television   | NULL     | 1         | HDHR-1      |            3000 |
>+--------+----------+-----------------------------+-----------+--------------+----------+-----------+-------------+-----------------+
>
>Kern.log:
>frontend 0 (NXP TDA10048HN DVB-T)...
>Jul 30 10:19:49 myth kernel: [   15.169822] tda18271 5-0060: creating new  
>instance
>Jul 30 10:19:49 myth kernel: [   15.174271] TDA18271HD/C2 detected @ 5-0060
>Jul 30 10:19:50 myth kernel: [   15.423597] tda18271: performing RF  
>tracking filter calibration
>Jul 30 10:19:52 myth kernel: [   17.776718] tda18271: RF tracking filter  
>calibration complete
>Jul 30 10:19:52 myth kernel: [   17.779906] DVB: registering new adapter  
>(saa7164)
>Jul 30 10:19:52 myth kernel: [   17.779912] saa7164 0000:03:00.0: DVB:  
>registering adapter 1
>
>I'm not sure this is the command you want:
>
>~$ modinfo saa7164 | grep parm
>parm:           adapter_nr:DVB adapter numbers (array of short)
>parm:           debug:enable debug messages (int)
>parm:           fw_debug:Firmware debug level def:2 (int)
>parm:           encoder_buffers:Total buffers in read queue 16-512 def:64  
>(int)
>parm:           vbi_buffers:Total buffers in read queue 16-512 def:64 (int)
>parm:           waitsecs:timeout on firmware messages (int)
>parm:           card:card type (array of int)
>parm:           print_histogram:print histogram values once (int)
>parm:           crc_checking:enable crc sanity checking on buffers (int)
>parm:           guard_checking:enable dma sanity checking for buffer  
>overruns (int)
>parm:           enable_msi:enable the use of an msi interrupt if available  
>(bool)
>
>
>I get:
>:~# /etc/modprobe.d# modinfo saa7164|grep parm
>bash: /etc/modprobe.d#: No such file or directory

It looks like I was wrong about where the problem lies.  Since you
have only one real tuner card, even though it has dual tuners, it will
never move its address around.  The HDHR tuners are Ethernet, so they
do not show up as hardware devices in /dev/dvb.  So there is no need
for adapter_nr settings unless you ever add another standard tuner.

The settings from the capturecard table look fine except for the
channel_timeout value (3000), which is way too small for DVB-T here in
New Zealand.  In versions before 0.28, mythbackend recovered from that
and managed to tune channels anyway, but took longer than necessary as
it could retry several times.  In 0.28, it can fail to ever tune
properly, so those settings need to all be increased.  I am using
10000 ms, and that seems to work well.  TV3 can take between 7 and 8
seconds to tune.  However, that is unlikely to explain your symptoms,
it is just another problem you would have had later in getting 16.04
working properly.  You change those values in mythtv-setup => Capture
Cards.  On each tuner there, on the first page of its settings, change
the "Tuning timeout" from 3000 to 10000.  That same change should also
be done for your old 12.04 setup - it should make tuning work faster
there too.

It looks like we need to see full logs of what is going on.  So you
will probably need to set the "-v record" log option on mythbackend.
In 16.04, to work with systemd, that is done in a different way from
previously.  In the /etc/mythtv directory, create a file
"additional.args" if it does not exist.  Give it mythtv group and user
(chown mythtv:mythtv additional.args).  Change its permissions to make
it only writeable by its user (chmod a=r,u=rw additional.args).  In
that file, you put one line with additional arguments that get added
on to the end of the mythbackend command line, so put the -v record
there.

Then restart mythbackend (systemctl restart mythtv-backend) and try
tuning a channel - one of the SD ones as they tune more easily, so
Prime or ChoiceTV are good ones to try.  Then stop mythbackend
(systemctl stop mythtv-backend) and post a copy of the section of
/var/log/mythtv/mythbackend.log that contains all the output from just
that run of mythbackend.  To find where a run of mythbackend starts in
the log, search for the text "mythbackend version:" which is on the
first line mythbackend logs when it starts.  The last thing that
mythbackend logs when it shuts down is normally a line saying "Waiting
for threads to exit.".  The log will likely be way too big to post in
an email, so putting it somewhere like pastebin.com is the way to go,
unless you have a web server of your own you can put it on.



More information about the mythtvnz mailing list