SOLVED: HDHomeRun 3 setting up dual tuners

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: HDHomeRun 3 setting up dual tuners

Post by kmdewaal »

Yes, this looks good. There is one "real" capturecard (that is the one with parentid 0) and one "virtual" capturecard (that is the one with parentid 1). This is the so-called Multirec feature. You can receive multiple programs at the same time provided the programs are all on the same transport stream multiplex. You need only one physical tuner to receive one multiplex. The virtual capturecards are needed for the additional recordings and are created automatically when needed.

The next step is to add the second capturecard and connect that to the same video source MyChannels.
Then please post the output of the sql commands again.
BgeeCaver
Junior
Posts: 20
Joined: Mon Mar 11, 2019 12:27 pm
United States of America

Re: HDHomeRun 3 setting up dual tuners

Post by BgeeCaver »

Done. I added another capture card using the same HDHomeRun tuner as the first. I then added an Input for that capture card. Running the two SQL commands gives this:

Code: Select all

MariaDB [mythconverg]> select * from videosource;
+----------+------------+-------------------+--------+-----------+----------+----------+--------+------------+------------+------------+-----------+---------------+-----------+
| sourceid | name       | xmltvgrabber      | userid | freqtable | lineupid | password | useeit | configpath | dvb_nit_id | bouquet_id | region_id | scanfrequency | lcnoffset |
+----------+------------+-------------------+--------+-----------+----------+----------+--------+------------+------------+------------+-----------+---------------+-----------+
|        1 | MyChannels | tv_grab_zz_sdjson | NULL   | us-bcast  | PC:66061 | NULL     |      0 | NULL       |         -1 |          0 |         0 |             0 |         0 |
+----------+------------+-------------------+--------+-----------+----------+----------+--------+------------+------------+------------+-----------+---------------+-----------+
1 row in set (0.006 sec)

MariaDB [mythconverg]> select cardid,parentid,videodevice,sourceid,hostname,cardtype,inputname,displayname from capturecard;
+--------+----------+-------------+----------+----------------------+-----------+-----------+-------------+
| cardid | parentid | videodevice | sourceid | hostname             | cardtype  | inputname | displayname |
+--------+----------+-------------+----------+----------------------+-----------+-----------+-------------+
|      1 |        0 | 103C90FD    |        1 | mythtv.billgee.local | HDHOMERUN | MPEG2TS   | Tuner 0     |
|      4 |        0 | 103C90FD    |        1 | mythtv.billgee.local | HDHOMERUN | MPEG2TS   | Tuner 1     |
|      3 |        1 | 103C90FD    |        1 | mythtv.billgee.local | HDHOMERUN | MPEG2TS   | Tuner 0     |
+--------+----------+-------------+----------+----------------------+-----------+-----------+-------------+
3 rows in set (0.000 sec)
When I restart the frontend, go to System Information - System Status - Inputs, the first input shows OK and the second shows "Errored". The exact text on this screen is:

Code: Select all

Input 1 Tuner 0:2 Available
Input 4 Tuner 1:1 Errored
Bill Gee
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: HDHomeRun 3 setting up dual tuners

Post by bill6502 »

Just to be crystal clear, was the backend stopped/started for the change? If not,
then I'd restart it and then the FE again.
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: HDHomeRun 3 setting up dual tuners

Post by kmdewaal »

The database output looks good so we have to look further. A log file of mythbackend might have useful information.
Can you please start mythbackend with the options "-v most,norefcount" and post the complete output here, from the start until and including checking the tuner status with mythfrontend "Information Centre/System Status/Input Status".
BgeeCaver
Junior
Posts: 20
Joined: Mon Mar 11, 2019 12:27 pm
United States of America

Re: HDHomeRun 3 setting up dual tuners

Post by BgeeCaver »

Hmmm... This is odd!

Answer to restart question - When I go into the setup tool, I always choose "stop backend and continue". I have never checked to see if that actually does something, and it has never displayed any errors. However .....

When I went to capture the output from "mythbackend -v most,norefcount", I first stopped the backend using systemctl. Then I ran it from a command shell. When I started the front end to check the input status, it says everything is good! There are two tuners and both are "Available". No more "Errored".

I stopped the manual invocation of mythbackend with Ctrl-C, then launched it with systemctl. The tuners are still available. I quit and restarted the front end when restarting the back end.

Hypothesis: When I did the manual invocation, I was running as root. The mythsetup program runs as the mythtv user which may not have permission to stop services. Could that be what I have been fighting all along??

I do have some of the captured output. It exceeded the capture buffer of the command shell I was using, so only the last 1000 lines are saved. It seems to me that looking at that output is now moot, so I will not post it. If you want it anyway, say so and I will figure out how to get it to you.

Bill Gee
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: HDHomeRun 3 setting up dual tuners

Post by bill6502 »

Not that odd (unfortunately). Different distros can set up the start/stop commands. I'd
heard that *buntu's was working. I don't use a package and set up mine from the mythtv-setup.
I just add the systemctl start/stop mythtv-backend.service commands, BUT, I've entered them
in an sudoers.d file as well. And that's another topic if you've never done it;).
BgeeCaver
Junior
Posts: 20
Joined: Mon Mar 11, 2019 12:27 pm
United States of America

Re: HDHomeRun 3 setting up dual tuners

Post by BgeeCaver »

Another topic! :-) I have never done a file for sudoers. This morning I spent some time messing with it, but apparently there is some secret sauce I am missing. First, I verified that my user account is a member of the mythtv group. Then I created a file named /etc/sudoers.d/mythtv with permissions 0440. Its content is a single line:

Code: Select all

%mythtv ALL=(ALL) NOPASSWD: /usr/bin/systemctl
When I run "visudo --check", it reports that this file parsed OK.

Code: Select all

[root@mythtv sudoers.d]# visudo --check
/etc/sudoers: parsed OK
/etc/sudoers.d/mythtv: parsed OK
[root@mythtv sudoers.d]# 
I also went into mythtv-setup and modified the start/stop commands. They were set to use "killall mythbackend" for stop and "mythbackend" for start. I changed them to use systemctl. That works, except I have to enter a password when I start mythtv-setup and again when I exit. That is annoying. Not a showstopper, but annoying.

Does someone have a template for what the sudoers.d file should contain? Is modifying this file the way to make mythtv-setup succeed when it offers to stop the backend?

Bill Gee
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: HDHomeRun 3 setting up dual tuners

Post by bill6502 »

Mine looks like this, obviously modify for your needs (I limited the systemctl message):

Code: Select all

#
# MythTV /etc/sudoers.d/mythtv file.
#

Defaults        editor=/usr/bin/vim
Defaults        timestamp_timeout=45

User_Alias MYTHTV_USERS = bill, mythtv

Cmnd_Alias MYTHTV_COMMANDS =                         \
    /bin/systemctl poweroff --message=*,             \
    /bin/systemctl start mythtv-backend.service,     \
    /bin/systemctl stop mythtv-backend.service,      \
    /usr/bin/tv_grab_zz_sdjson_sqlite

MYTHTV_USERS ALL=NOPASSWD: MYTHTV_COMMANDS
BgeeCaver
Junior
Posts: 20
Joined: Mon Mar 11, 2019 12:27 pm
United States of America

Re: HDHomeRun 3 setting up dual tuners

Post by BgeeCaver »

Nice! Thanks! I will give that a try. But I think I figured out the real reason it is still asking for a password. The user account "bgee" under which I normally logiin to the system is also a member of the wheels group. When sudo is processing through the file, it gets a match on the wheels group first. That configuration requires a password for all commands, as it should. sudo never gets to the entry in the sudoers.d file because it found an earlier match.

I think my choices are to modify sudoers so it has the mythtv line before the wheels line, or to make another user on the system which is not a member of the wheels group. Or ... I can choose to just live with it asking for a password. It's not like I run the mythtv-setup program every day.

I think this topic is pretty much concluded. I will see about marking it as "Solved" for future queries.

Thanks for all the help!

Bill Gee
User avatar
heyted
Senior
Posts: 301
Joined: Sun Jun 08, 2014 2:14 am
Location: South Florida
Contact:
United States of America

Re: SOLVED: HDHomeRun 3 setting up dual tuners

Post by heyted »

The host system is Fedora 36 (64-bit) running MythTV packages from the Fedora repositories.
I'd heard that *buntu's was working.
One option for Ubuntu users to stop the backend before running mythtv-setup is to use Mythbuntu Control Panel.
Ted | My blog
Post Reply