Relationship between videosource and capture cards ?

For discussion related to MythTV which doesn't belong in another forum.

Moderator: Forum Moderators

Post Reply
aglet
Newcomer
Posts: 5
Joined: Sun Feb 16, 2020 12:22 pm
Great Britain

Relationship between videosource and capture cards ?

Post by aglet » Sun Feb 16, 2020 12:36 pm

Hi,

I've got a mixture of DVB-T tuners (USB and HDHomeRun) connected to a MythTV backend (pre-0.31) and I'm based in the UK. I'm using the schedules direct grabber (tv_grab_zz_sdjson) to pull a Freeview channel lineup to a local file before uploading it into my database with mythfilldatabase.

When I started troubleshooting high Mysqld CPU & a general mythweb slowdown, I noticed that I had 4 Video Sources configured, with each tuner type connected to a different video source. This meant that I was running mythfilldatabase 4 times, using the same schedules file and a different sourceid but it was taking almost 2 hours a day to upload all the schedules. Given that each source has the same program listings (they're all tuned to the same transmitter), can I just use one videosource for all tuners ?

In other words, does the videosource influence which capture card is used or does the scheduler take care of that ?

How about if I add a DVB-S tuner to the mix as well ? Most of the lineup is identical with perhaps an extra channel coming form DVB-S only.

Cheers,
Andrew

PS - I've been using the same MythTV instance for almost 14 years now and it rocks. Thank you so much for all your hard work !

MikeB2013
Senior
Posts: 511
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Relationship between videosource and capture cards ?

Post by MikeB2013 » Sun Feb 16, 2020 3:34 pm

mythfilldatabase using defaults, is very memory hungry and can cause swopping and high cpu usage which slows everything down unless your system has a lot of RAM. In my experience, systems with 4GB or 8GB RAM are particularly affected.

There is an option from mythtv 29 which reduces mythfilldatabase memory use.
Stop mythbackend and use mythtv-setup to add --no-allatonce to Listing data arguments for mythfilldatabase:
1.General scroll down to Programme Schedule Downloading
right arrow key Automatically update programme listings
right arrow key you should now see Listing data arguments, put in --no-allatonce

As far a Video Sources are concerned you need a separate Video Source per tuner type.
For example if you have 2 USB tuners of the same type e.g. DVB-T, only one Video Source is required.

If you have 2 USB tuners of different types e.g. one that only supports DVB-T and one that supports DVB-T/T2 you need 2 Video Sources.

For each physical HDHomeRun box you only need one Video Source, irrespective of how many tuners the HDHomeRun box has. If you have multiple HDHomeRun boxes of the same type e.g. DVB-T/T2, only one Video Source is required, again irrespective of the number of tuners in each HDHomeRun box. I have not tried using the same Video Source for HDHomeRun and other tuner types even if they support the same standard e.g DVB-T/T2, it may or may not work (different device drivers are used, so there may be some unwanted side effects).

If you add a DVB-S tuner to the mix you will need another Video Source and another Schedules Direct lineup.

Mike

aglet
Newcomer
Posts: 5
Joined: Sun Feb 16, 2020 12:22 pm
Great Britain

Re: Relationship between videosource and capture cards ?

Post by aglet » Mon Feb 17, 2020 9:08 pm

Just wanted to say, thanks for the info.
The --no-allatonce has definitely helped and cleaning up the database (unused channels, programs and program info) seems to have got things back under control.

gpw928
Junior
Posts: 20
Joined: Tue Feb 12, 2019 5:59 am
Location: Rural NSW
Australia

Re: Relationship between videosource and capture cards ?

Post by gpw928 » Wed Mar 11, 2020 11:06 pm

I have MythTV servers that have both USB and HDHomeRun tuners "attached" to the same server.

I have only ever used one video source for the "capture cards", the local free-to-air transmission.

As an aside, the HDHomeRuns all work very well. The USB tuners have to be chosen with great care. The only USB tuners that are not now in the rubbish bin came from RTL-SDR.com. I am told that Nooelec USB tuners also work well, but RTL-SDR.com has much better shipping options (for me).

biggus
Newcomer
Posts: 11
Joined: Fri Mar 20, 2020 4:09 pm
United States of America

Re: Relationship between videosource and capture cards ?

Post by biggus » Fri Mar 27, 2020 9:30 pm

I have a question very much along these lines.

I have two antennas, one VHF and another UHF. These are connected to two identical HDHomeRun tuners.

I don't think this is an unusual situation.

I need these two antennas to get good signal strength on all the available channels. Most of them are UHF, but a few are VHF. And there's even one very local UHF stations that comes in best on the VHF antenna. Probably because the UHF antenna is pointed at more interesting, distant UHF channels.

Its my understanding that the only way I can prevent mythtv from using the incorrect HDHomeRun is to do the appropriate channel selection back at the Schedules Direct channel subscription. Which means I have to have two different lineups on Schedules Direct.

Is the above correct, or is there a better way inside mythtv-setup?

Interestingly, Schedules Direct seems to allow only one lineup per zip code. Not a big deal since the locale I live in has about 10 to chose from. But a little bit unexpected if this is how I have to control the MythTV.

And I see other MythTV'ers having problems with database update performance. Is it best to prune off all channels, except the ones you really need in the Schedules Direct linup?

wesnewell
Senior
Posts: 585
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: Relationship between videosource and capture cards ?

Post by wesnewell » Sat Mar 28, 2020 4:33 am

Appears to me you need to use the same input to all hdhr's. That means tying your uhf and vhf together with a combiner (diplexer) and splitting the output to all your hdhrs.. Then every tuner could get every channel. Once done, just manually add the channels for sd instead of doing it by zip code or maybe you can use multiple zip codes. Not sure about that.
BE/FE-Asrock AB350 Pro AMD Ryzen 3 2200G, 6 atsc tuners. Frontends-GF8200's,,AMD Athlon II's. Mythtv user since 2005.

biggus
Newcomer
Posts: 11
Joined: Fri Mar 20, 2020 4:09 pm
United States of America

Re: Relationship between videosource and capture cards ?

Post by biggus » Sat Mar 28, 2020 3:18 pm

Thanks for the response.

What you're saying is consistent with what I'm seeing in the mythtv-setup.

I had assumed that MythTV can deal with multiple inputs. Something like a cable feed and an OTA feed. I just assumed that two HDHomeRuns was no big deal.

Using a diplexer means I have to insert the diplexer itself and then follow it with a splitter to feed the two HDHomeRun boxes. Of course, If I had known this I would have bought a single 4 channel HDHomeRun to avoid the splitter. I know enough about RF, that _anything_ inserted in the RF path comes at a loss which is undesirable. I live in a slightly challenged location vis-a-vis TV transmitters. The two HDHomeRuns connected directly to the each antenna seemed like the best solution to me.

Can't say that I understand this limitation of MythTV. Hopefully anybody who comes by after me will see this post before they buy a tuner.

MikeB2013
Senior
Posts: 511
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Relationship between videosource and capture cards ?

Post by MikeB2013 » Sat Mar 28, 2020 4:28 pm

Unless there is a bug, using 2 hdhomeruns connected to different signal sources should not be a problem, provided 2 Videosources are used, one for each hdhomerun. If a SchedulesDirect lineup covers all received channels, only one lineup is required, and can be used in each Videosource.xmltv file.

Note I am assuming SchedulesDirect using json xmltv, not DataDirect - which is no longer supported from mythtv 31.

For VHF hdhomerun you need to create the appropriate number of Capture Cards in Input Connections, create a VHF Videsource, and then in Input Connections associate VHF Videosource with each of the Input Connections for VHF hdhomerun. You will need to run a channel scan on the first Input Connection associated with VHF hdhomerun. Other Input Connections for VHF hdhomerun do not need channel scan. As usual you can use any name you like for the Videosource.

For UHF hdhomerun you need to create the appropriate number of Capture Cards in Input Connections, create a UHF Videosource, and then in Input Connections associate UHF Videosource with each of the Input Connections for UHF hdhomerun.You will need to run a channel scan on the first Input Connection associated with UHF hdhomerun, other Input Connections for UHF hdhomerun do not need channel scan.

If there are channels on a specific hdhomerun that you do not want, use Channel Editor (or mythweb) to set that channel to not visible (the Scheduler will ignore all channels which are not set to visible).

biggus
Newcomer
Posts: 11
Joined: Fri Mar 20, 2020 4:09 pm
United States of America

Re: Relationship between videosource and capture cards ?

Post by biggus » Sat Mar 28, 2020 6:10 pm

Thanks MikeB!

I went back and had mostly figured out what you said. Basically use the channel editor to disable the channels that don't work well on each tuner.

Then realized I'd only added only one input connection for each HDHomeRun. There should be two. Here's the weird part... mythtv-setup will no longer allow me to add or delete any inputs... period. The add and delete banner bars are simply gone. I've tried restarting mythtv-setup, still no add/delete. Seems like a bug to me. Only thing I can think of is to go back and delete/re-add the capture cards. Maybe that would fix it??

Two other questions about setting up xmltv.
- Is it advantages to only have the usable TV signals in the Schedules Direct lineup? Seems like it might make mythfilldatabase run faster.
-Part of running tv_grab_zz_sdjson_sqlite is to tediously select the channels that really work. Seems like the scan channels matches the SD channel list with the received channel list and this step is superflous.

MikeB2013
Senior
Posts: 511
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Relationship between videosource and capture cards ?

Post by MikeB2013 » Sat Mar 28, 2020 7:55 pm

Sorry my instructions were poorly worded.
You need to create in Capture Cards, a hdhomerun device for each tuner on the hdhomerun, these are then used in Input Connections.
It is only Capture Cards that can be added or deleted (Input Connections follows the currently configured Capture Cards). So if you have two capture cards defined, there will be two entries in Input Connections.

There is a good write up (which I should have mentioned before) https://www.mythtv.org/wiki/Channel_Sca ... Run_tuners
Although it is written for mythtv 31, it also works for mythtv 30.

For SchedulesDirect it is good to limit the lineup the lineup to only the channels you want. mythfilldatabase will run faster and use less memory and with mythtv 31 it has been rewritten tol use much less memory than earlier versions of mythtv.

Being in UK, my use of SchedulesDirect may be different to yours, but I have to do the channel scan (this populates the required data for tuning to a specific channel and the channel selection for SchedulesDirect, but I use a different xmltv grabber tv_grab_zz_sdjson, not tv_grab_zz_sdjson_sqlite.

biggus
Newcomer
Posts: 11
Joined: Fri Mar 20, 2020 4:09 pm
United States of America

Re: Relationship between videosource and capture cards ?

Post by biggus » Mon Mar 30, 2020 7:33 pm

As I have found with just about everything "MythTV", its not quite that simple :-). Perhaps I can help others to get through this a bit faster.

Go through the channel database building process detailed here (about 2/3 of the way down the page): https://mythtv-rp4.blogspot.com/2019/12 ... -pi-4.html MythTV defaults to SchedulesDirect.DB for the channel database name. I went with SD.DB as shown on the linked page.

Create two "Video sources". I called them SD_V and SD_U. Use the same channel database (nominally /home/mythtv/.xmltv/SD.DB) for both.

Create one "Input connection" for each capture card. In my case 2 each for each HDHomeRun DUO for a total of four. Assign the SD_V video source to VHF inputs and SD_U to the UHF inputs. channel scan only the first input of each pair of input connections.

Here's the sorta tricky part... In /home/mythtv/.mythtv utter "ln -s SD.xmltv SD_[U,V].xmltv" twice. Once with "U" and once with "V". mythfilldatabase looks for these files and doesn't do anything if it doesn't find them. Run mythfilldatabase.

Go back into mythtv-setup. Probably, some channels will have only one entry with a corresponding SD_[U,V]. And some channels will have entries for both video sources. What I think is happening during the channel scan is some channels will only scan on one antenna/HDHomeRuns and other will scan on both.

Leave the single scanned channels alone. And if a channel comes in with good signal strength on both antenna/HDHomeRuns, you can leave that alone too. Some channels may have an entry on both video sources, but one antenna not with good signal strength. As far as I know, MythTV doesn't tell you the signal strength. I used the HDHomeRun Windows client to discover this separately. Mark the channel with poor signal strength as not visible in the channel editor.

It is also possible to change a channel's visibility in mythweb. You'll have to correlate your Video source name with the listed "sourceid". Nominally not easier than doing it through mythtv-setup's channel editor... except you can do it without taking the mythbackend down, etc.

May the force be with you.

MikeB2013
Senior
Posts: 511
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Relationship between videosource and capture cards ?

Post by MikeB2013 » Tue Mar 31, 2020 3:41 pm

mythfrontend does have a signal monitor, but it may need to be assigned to a key press (either keyboard or remote control), the default is Alt+F7 which may or may not work depending on your operating system. For Xubuntu 18.04 setting to Shift+F7 works for me

mythfrontend > Setup > Edit Keys > TV Playback > SIGNALMON

Mike

biggus
Newcomer
Posts: 11
Joined: Fri Mar 20, 2020 4:09 pm
United States of America

Re: Relationship between videosource and capture cards ?

Post by biggus » Fri Apr 03, 2020 3:28 pm

Thanks for that advice... but there's a twist others might want to know about.

Mythweb conveniently shows the keybindings here: http://xx.xx.xx.xx/mythweb/settings/mythtv/keys

I have a logitech K400+ keyboard. The default for SIGNALMON is ALT+F7. For reasons unknown, my K400+ issues an ALT+META+UP for an ALT+F7. Probably any of the ALT+function key bindings will need to be updated.

And, once in signal monitor mode there doesn't seem to be a way to get directly back to TV watching mode. I've had to escape back out to the main menu to get back to TV watching.

MikeB2013
Senior
Posts: 511
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Relationship between videosource and capture cards ?

Post by MikeB2013 » Fri Apr 03, 2020 3:47 pm

Signalmon is a toggle, so hitting the same key combination again should resume LiveTV (it does for me).
The key combinations that can be set do depend on your keyboard, you can assign any unused (from mythtv perspective) keys. Edit Keys will warn you when you try to save if the key combination is already used for other things, cancel the operation if you get the warning.

Don't know if you get such warnings with mythweb, Edit Keys in mythfrontend is best.

biggus
Newcomer
Posts: 11
Joined: Fri Mar 20, 2020 4:09 pm
United States of America

Re: Relationship between videosource and capture cards ?

Post by biggus » Sun Apr 05, 2020 8:18 pm

Right again MikeB2013! But its a little weird on my system. It takes a while and I guess I didn't wait long enough.

Post Reply