[mythtvnz] New install setup - recording problem

Stephen Worthington stephen_agent at jsw.gen.nz
Sat Aug 13 04:25:03 BST 2016


On Sat, 13 Aug 2016 12:13:31 +1200, you wrote:

>On Fri, 12 Aug 2016 21:18:09 +1200, Stephen Worthington  
><stephen_agent at jsw.gen.nz> wrote:
>
>> On Fri, 12 Aug 2016 14:25:25 +1200, you wrote:
>>
>>>> Modifying Systemd_mythbackend_Configuration looks daunting.
>>>
>>> I am sure we can work it out - I will fire up my 16.04 test box and
>>> see how it works.
>>
>> I have done some experimenting on my test box now, and I have some
>> config files that should work to make systemd wait for the HVR-2200
>> tuners before starting mythbackend.
>>
>> First, you need to tie down the tuner numbers so that the HVR-2200
>> tuners are always /dev/dvb/adapter0 and /dev/dvb/adapter1.  Create
>> this file (the name does not matter, but the .conf does):
>>
>> /etc/modprobe.d/options-dvb.conf
>>
>> and put these two lines in it:
>>
>> #Set adapter numbers for Hauppauge HVR-2200 dual tuner (DVB-T tuners
>> only).
>> options saa7164 adapter_nr=0,1
>>
>> Then add the new systemd "drop-in" override file.  First create a new
>> directory:
>>
>> sudo mkdir /etc/systemd/system/mythtv-backend.service.d
>>
>> Then in that directory, create a new file mythtv-backend-override.conf
>> (again, the name does not matter but the .conf does).  In that file,
>> put the following five lines:
>>
>> [Unit]
>> Wants=dev-dvb-adapter0-frontend0.device
>> Wants=dev-dvb-adapter1-frontend0.device
>> After=dev-dvb-adapter0-frontend0.device
>> After=dev-dvb-adapter1-frontend0.device
>>
>> That causes systemd to wait until /dev/dvb/adapter0/frontend0 and
>> /dev/dvb/adapter1/frontend0 both exist before starting mythbackend. If
>> either device does not exist, systemd will eventually timeout waiting
>> for the devices to appear and then start mythbackend anyway, but the
>> timeout is quite long.  I am just guessing, but it seemed like about
>> 60 seconds.
>>
>
>The HDHR tuners work fine too.
>The Backend takes a long time to start,now.About 1.5 mins.It seems the  
>tuner cards are holding things up.I can probably live with it.
>Here's a section from syslog:
>
>Aug 13 11:02:33 mythpc kernel: [   17.539314] DVB: registering new adapter  
>(saa7164)
>Aug 13 11:02:33 mythpc kernel: [   17.539319] saa7164 0000:03:00.0: DVB:  
>registering adapter 1 frontend 0 (NXP TDA10048HN DVB-T)...
>Aug 13 11:02:34 mythpc kernel: [   17.575686] saa7164[0]: registered  
>device video0 [mpeg]
>Aug 13 11:02:34 mythpc kernel: [   17.802040] saa7164[0]: registered  
>device video1 [mpeg]
>Aug 13 11:02:34 mythpc kernel: [   18.013816] saa7164[0]: registered  
>device vbi0 [vbi]
>Aug 13 11:02:34 mythpc kernel: [   18.013964] saa7164[0]: registered  
>device vbi1 [vbi]
>Aug 13 11:03:48 mythpc systemd[1]: dev-dvb-adapter1-frontend0.device: Job  
>dev-dvb-adapter1-frontend0.device/start timed out.
>Aug 13 11:03:48 mythpc systemd[1]: Timed out waiting for device  
>dev-dvb-adapter1-frontend0.device.
>Aug 13 11:03:48 mythpc systemd[1]: dev-dvb-adapter1-frontend0.device: Job  
>dev-dvb-adapter1-frontend0.device/start failed with result 'timeout'.
>Aug 13 11:03:48 mythpc systemd[1]: dev-dvb-adapter0-frontend0.device: Job  
>dev-dvb-adapter0-frontend0.device/start timed out.
>Aug 13 11:03:48 mythpc systemd[1]: Timed out waiting for device  
>dev-dvb-adapter0-frontend0.device.
>Aug 13 11:03:48 mythpc systemd[1]: dev-dvb-adapter0-frontend0.device: Job  
>dev-dvb-adapter0-frontend0.device/start failed with result 'timeout'.

That is not good.  The new systemd jobs to detect the creation of the
tuners are not actually working.  Instead, they are timing out.  The
timeout is long enough so that when mythbackend gets started, the
tuner devices are actually present, so mythbackend seems to be seeing
working tuners once it gets started, but the timeouts likely slow down
booting much more than needs to happen.

>Aug 13 11:03:48 mythpc systemd[1]: Started MythTV Backend.
>Aug 13 11:03:48 mythpc systemd[1]: Reached target Multi-User System.
>Aug 13 11:03:48 mythpc systemd[1]: Reached target Graphical Interface.
>Aug 13 11:03:48 mythpc systemd[1]: Started Stop ureadahead data collection  
>45s after completed startup.
>Aug 13 11:03:48 mythpc systemd[1]: Starting Update UTMP about System  
>Runlevel Changes...
>Aug 13 11:03:48 mythpc systemd[1]: Started Update UTMP about System  
>Runlevel Changes.
>Aug 13 11:03:48 mythpc systemd[1]: Startup finished in 1.798s (kernel) +  
>1min 30.619s (userspace) = 1min 32.418s.
>Aug 13 11:03:49 mythpc kernel: [   92.670822] tda10048_firmware_upload:  
>waiting for firmware upload (dvb-fe-tda10048-1.0.fw)...
>Aug 13 11:03:49 mythpc kernel: [   92.671115] tda10048_firmware_upload:  
>firmware read 24878 bytes.
>Aug 13 11:03:49 mythpc kernel: [   92.671118] tda10048_firmware_upload:  
>firmware uploading
>Aug 13 11:03:52 mythpc kernel: [   95.647746] tda10048_firmware_upload:  
>firmware uploaded
>Aug 13 11:03:52 mythpc kernel: [   95.718869] tda18271: performing RF  
>tracking filter calibration
>Aug 13 11:03:54 mythpc kernel: [   98.071954] tda18271: RF tracking filter  
>calibration complete
>Aug 13 11:03:56 mythpc kernel: [   99.888159] tda10048_firmware_upload:  
>waiting for firmware upload (dvb-fe-tda10048-1.0.fw)...
>Aug 13 11:03:56 mythpc kernel: [   99.888203] tda10048_firmware_upload:  
>firmware read 24878 bytes.
>Aug 13 11:03:56 mythpc kernel: [   99.888204] tda10048_firmware_upload:  
>firmware uploading
>Aug 13 11:03:59 mythpc kernel: [  102.851201] tda10048_firmware_upload:  
>firmware uploaded

And here more firmware is loaded for the HVR-2200 tuners, AFTER
mythbackend has been started.  So the HVR-2200 tuners may not actually
have been fully working when mythbackend was started.  On the LinuxTV
Wiki page:

https://www.linuxtv.org/wiki/index.php/Hauppauge_WinTV-HVR-2200

there are reports that recording has problems every half an hour or so
without the dvb-fe-tda10048-1.0.fw file being loaded, so it may be
that having loaded late is OK, but it is still a bad idea.  But it may
also be that the dvb-fe-tda10048-1.0.fw firmware file never gets
loaded until something tries to use the HVR-2200 tuners, which
mythbackend does at startup.

Please do two test runs, where you boot, wait for everything to start
up, then run LiveTV on a channel, watch for a few seconds, then stop
it.  Do that in both 12.04 and 16.04 and post the complete syslog and
mythbackend.log file from start of booting until LiveTV is finished.

>Aug 13 11:04:34 mythpc systemd[1]: Starting Stop ureadahead data  
>collection...
>Aug 13 11:04:34 mythpc systemd[1]: Stopped Read required files in advance.
>Aug 13 11:04:34 mythpc systemd[1]: Started Stop ureadahead data collection.
>
>
>
>Also, the reboot and shutdown options in frontend have ceased to  
>function.These are performed by  /sbin/reboot and /sbin/poweroff   correct?

Yes and no.  Before systemd, the reboot command was a real executable
file and poweroff was a link to the reboot file.  The reboot file
detected whether it was called via the poweroff link or directly in
order to decide whether it should just power off or reboot.  Now, that
function is done by systemctl and both reboot and poweroff are links
to /bin/systemctl and systemctl detects whether it is being run via a
link as to which function it should perform.  So if the /sbin links to
systemctl do not work now for some reason when used from MythTV, you
should probably just put the base command into the MythTV settings
instead of using the links:

  /bin/systemctl reboot
  /bin/systemctl poweroff



More information about the mythtvnz mailing list