[mythtv-users] mythtv v31 slave backend help needed

Bill Meek keemllib at gmail.com
Sun Jul 19 17:15:39 UTC 2020

On 7/19/20 10:43 AM, James Abernathy wrote:
> On Sun, Jul 19, 2020 at 7:00 AM Mike Perkins <mikep at randomtraveller.org.uk <mailto:mikep at randomtraveller.org.uk>> wrote:
>     On 19/07/2020 11:27, Jim Abernathy wrote:
>      >
>      > On 7/19/20 6:12 AM, Mike Perkins wrote:
>      >> On 19/07/2020 10:59, Jim Abernathy wrote:
>      >>>
>      >> (snip)
>      >>>
>      >>> Thanks, just a few questions. The need for a slave backend is for many reasons and 2 that caught
>      >>> my mind were:
>      >>>
>      >>> 1.� adding more tuners.
>      >>>
>      >>> 2.� adding more storage.
>      >>>
>      >>>
>      >>> Having the tuners defined locally on the slave and no local video source makes sense because I
>      >>> only use one video source and all my tuners could use it because there are one set up OTA TV
>      >>> stations.
>      >>>
>      >>> However, I'm confused on the Storage setup.� The Storage Groups are all defined on the master,
>      >>> but how is the slave local storage defined and used?� It sound like you do all your recording on
>      >>> the master.
>      >>> A point on the remote tuners: Using a source on another host is only possible if the remote tuners
>      >> are the same type.
>      >>
>      >> A source defines a method of tuning as well as a selection of channels. Different tuner types
>      >> require different sources.
>      >>
>      >
>      > So on my current master backend I have Hauppauge WinTV HD Quad PCIe card.  My slave would have a
>      > HDHomerun Quatro, so different types of tuners.  They could use the same list of channels provided
>      > by Schedules Direct, I think. The master backend could do the scan on one of the WinTV tuners, but
>      > not the HDHR tuners, so it could only establish input connections for the WinTV tuners, unless
>      > Mythtv can tell the slave to scan the HDHR tuners?
>      >
>      > Jim A
>      >
>      >
>     You'll be using mythtv-setup on the slave to configure it, so you can provide a unique (to it)
>     source and do whatever scan it requires there.
>     You can reference the same channel list from SD, though, since SD doesn't care about tuner types,
>     just what you watch.
>     Mmm. Interesting point: presumably mythfilldatabase (mfdb) normally runs on the host that has a
>     database, the master. How does it know about remote sources? Or do you run mfdb on every slave as
>     well, updating the database over the network? I can't answer that one, can anyone else?
>     -- 
>     Mike Perkins
> So I've made some progress.   I installed Raspberry Pi OS on a fresh SD card and booted, updated, and then copied the SD image to a USB3 SATA 
> SSD since the RPi4 now supports USB3 boot with the latest EEPROM bootloader.
> Then I installed mythtv-light v31 per the wiki and I downloaded the pi-utils from: https://github.com/MikeB2013/pi-utils.git
> I modified the pi-mythbackend-helper.sh so the only functions I ran were:
> fn_get_git
> fn_setup_mythtv_user
> fn_setup_mythtv_backend_service
> fn_setup_directories
> fn_tidy_up
> After rebooting, I ran mythtv-setup on the slave and it can't find the database since there isn't one on the slave.  So I use the manual setup 
> option to fill in the info about the master backend, i.e. IP, mythconverge password, etc.

Right, it will find the database once config.xml knows where the DB is,
And it's most frequently on the same host as the main backend.

> It then found the master and I could add the tuner cards and it already knew about the Video Source (SD). I could set up the Input Connections 
> and scan the first tuner only; the same as when you build a regular backend.
> You are not supposed to configure Storage groups on the backend, but that confuses me.

Me to, at first, but it's right. More below.

> I also copied my .mythtv/config.xml file to /etc/mythtv/config.xml and that is symbolic linked to /home/mythtv/.mythtv/config.xml

This is what things should look like. The above comment may be OK, but it sounds
reversed. It's the same as on a main backend.

$ ls -ld /etc/mythtv/config.xml {~,~mythtv}/.mythtv/config.xml
-rw-rw---- 1 mythtv mythtv 565 Mar 24 13:53 /etc/mythtv/config.xml
lrwxrwxrwx 1 you    you     22 May 26  2019 /home/you/.mythtv/config.xml -> /etc/mythtv/config.xml
lrwxrwxrwx 1 mythtv mythtv  22 May 26  2019 /home/mythtv/.mythtv/config.xml -> /etc/mythtv/config.xml

> I defined a mountpoint in the Storage Group Default and created that directory, but mythtv-setup will not let you create a path that doesn't 
> exist, even though the wiki says to do that.The directory does exist on the slave backend.  the master is supposed to ignore any directory that 
> doesn't exit, but since you can't create one that doesn't exist, ????

When I was using a remote BE, I didn't mount/share/... anything from the remote backend.

I see your point. And, in the mythtv-setup log:

   mythuifilebrowser.cpp:613 (updateLocalFileList) - MythUIFileBrowser: current directory does not exist!

The Services API isn't as picky. Verify the host name known to MythTV
(it takes into account any LocalHostName in config.xml) with this:

   curl localhost:6544/Myth/GetHostName

This works, but don't use /tmp/blah!:

   curl --data GroupName=Default --data DirName=/tmp/blah --data HostName=yourHostName localhost:6544/Myth/AddStorageGroupDir

You can substitute RemoveStorageGroupDir for AddStorageGroupDir if a typo is made.

> This is where I'm getting my Storage Group information and I can't seem to make it work.  The errors I'm getting are related to the recordings 
> not being accessible.
> https://www.mythtv.org/wiki/Setup_Storage_Directories#Multiple_Backends

Good choice (and, no I didn't write it.)

This API displays existing Storage Group entries. You can look at it in a browser with


Or, from the command line (you likely need to install the libxml2-utils package.)
Note the trailing dash:

   curl --silent localhost:6544/Myth/GetStorageGroupDirs | xmllint --format -

Here's my 'Default' SG as an example. Note that the HostName is 'mc0', which is my main backend:

curl --silent localhost:6544/Myth/GetStorageGroupDirs?GroupName=Default | xmllint --format -
<?xml version="1.0" encoding="UTF-8"?>
<StorageGroupDirList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" serializerVersion="1.1">

     ... omitted others that are on the main backend

       <DirName>/var/lib/mythtv/remote/recordings/</DirName> # This path doesn't exist on the main backend


More information about the mythtv-users mailing list