Twinhan 3250 tuner works great in Windows, only half channels in Linux?

For discussion of topics specific to MythTV on linux
EFM6
Newcomer
Posts: 9
Joined: Tue Jul 28, 2020 7:40 am
United States of America

Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by EFM6 » Tue Jul 28, 2020 8:38 am

Hello.
I have two ATSC Twinhan 3250 PCI tuner cards.
They work great in multiple Windows 7 TV software such as Windows Media Center.

But in MythTV, and in another Linux TV program I tried, only half of the channels get scanned in.
The skipped (actual not virtual) channels are all in the lower range. The lowest channel it tunes in is channel 21. It doesn't tune in any of the channels I should be getting between 12 and 20. I can see MythTV scanning all the channels in a full scan, but it doesn't see a signal for those lower ones.

These tuners are popular enough that the Linux TV wiki says their drivers were added to the Linux kernel years ago.

I plugged a USB Hauppauge tuner in, all channels scan in great.

I then put one of the PCI cards back in and didn't do a scan with it. Using the Program Guide from the Hauppauge, I recorded one of the hard to get channels while watching some of the other hard to get channels at the same time. Some of the channels came in, others still didn't. I was hoping maybe the Twinhan cards just didn't scan well but would work if it already knew what channel to tune to. That helped, but still not enough.

With Windows 7 being end of life, it'd be nice to switch to Linux. Though it'd be disappointing to lose these two tuner cards. I'm assuming since they tune well in Windows that the Linux driver itself is the problem and there's no fix, but I'm posting and hoping.

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

Re: Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by kmdewaal » Tue Jul 28, 2020 12:08 pm

It could be that your Twinhan can do the tuning but that it needs to be told to use e.g. QAM-256 instead of QAM-Auto.
Modern tuners tend to be better at autodetecting tuner parameters than older tuners.

So you can try the following.
First do the scan with the USB tuner. You then have a complete and correct list of channels and transports that do work OK with the USB tuner.
With the Twinhan, find a transport that fails to tune. This can be done with the "Scan Type" selection "Scan of single existing transport" in the Channel Scan page.
Then go to the Channel Editor and change e.g. the "Modulation" from what is probably QAM-Auto to a explicit value, e.g. QAM-64 or QAM-256.
Then back to the Channel Scan and try again. It would be great if you can find the modulation parameters from a website or so, otherwise it is a bit of trail-and-error.
Success!

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

Re: Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by wesnewell » Tue Jul 28, 2020 1:38 pm

You can pretty much bet the farm that the problem is the Linux driver, but that's mot done by the mythtv group. The Linux TV group does that. try contacting them. Good luck.
https://www.linuxtv.org/
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.

EFM6
Newcomer
Posts: 9
Joined: Tue Jul 28, 2020 7:40 am
United States of America

Re: Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by EFM6 » Thu Jul 30, 2020 12:09 am

kmdewaal wrote:
Tue Jul 28, 2020 12:08 pm
It could be that your Twinhan can do the tuning but that it needs to be told to use e.g. QAM-256 instead of QAM-Auto.
I've been messing with it for quite a while.
To be clear, is modifying the Twinhan card in the Channel Transport Editor and changing it to QAM-256 or 64 a trick that is supposed to hopefully work even though I'm using the card for ATSC OTA with an antenna?

I was thinking, to see if the Twinhan can bring in the lower channels at all with different modulation settings, to just change the Full Scan setting in Input Connections to QAM-256 or 64 from ATSC Broadcast and see if it finds any channels, but when I click Save Settings And Exit to try a full scan with QAM, Myth goes back two screens instead of one and doesn't let me do a scan at all.

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

Re: Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by kmdewaal » Thu Jul 30, 2020 8:53 pm

After changing scan settings you go back to the previous menu with the left arrow key "<" on the keyboard (or the remote control).
See also this page https://www.mythtv.org/wiki/Channel_Sca ... figuration in the wiki.

Please note that my suggestion to use e.g. QAM-256 was intended as an example and not literally, I did not realize that this is never used in OTA in the USA. The basic idea is here that if you see in the Transport Editor a value "auto" that you replace that with what is the correct value. The number of combinations is rather large so it would be great if you know what the correct values are, e.g. from a website.

You can also play around with dvbv5-scan and other utilities of that package. Google for dvbv5-scan and you should find it on linuxtv.org.
If you can get your tuner to work using the dvbv5 utilities then I expect it to be possible to make it work with MythTV.

EFM6
Newcomer
Posts: 9
Joined: Tue Jul 28, 2020 7:40 am
United States of America

Re: Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by EFM6 » Fri Jul 31, 2020 5:09 am

I'm glad you mentioned to just arrow left instead of Save And Exit in scanning options. I was then able to at least satisfy curiosity and do full scans with QAM 64, 128, 256. No channels found, of course.

In Channel Editor, it shows the frequency for each channel when clicking on each channel. In Transport Editing, there's only four options: 3 QAM settings, and 8-VSB. So not much choice there.

One thing when doing a Full Scan for channels is I increased the Twinhan tuning seconds from the default 2 or 4 to 20, but the Twinhan still doesn't slow down at all on channels 2 through 20 when doing a Full Scan. It "scans" each channel in about one second, and the signal strength meter shows nothing. It doesn't show 0% signal. The meter is simply blank.

MythTV says the Twinhan is scanning 2 through 20, but it's as if (apparently due to the driver) the Twinhan is completely ignoring channels 2 through 20 and isn't actually trying to tune them in during a Full Scan.

Then starting at channel 21, which isn't a channel I get, the signal strength meter shows a %, and it tries to scan/tune the channel for 20 seconds.

So, I guess that's it. Thanks for trying, guys. MythTV looks very good, and I might still switch from Windows though both these Twinhan cards would need replacing.

EFM6
Newcomer
Posts: 9
Joined: Tue Jul 28, 2020 7:40 am
United States of America

Re: Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by EFM6 » Fri Jul 31, 2020 4:17 pm

It's probably occurred to someone else while reading the previous post, but it took me a few more hours.
That what's probably happening is the Twinhan tuner card sees "2_1" as "21" in some way. And the not processing channels with an underscore happens to every channel up to channel 21.

The Twinhan does scan and tune in sub-channels, so the underscores do work, but only starting with channel 21.

I figure it's a lost cause to fix, but I thought the "why" might be interesting.

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

Re: Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by kmdewaal » Fri Jul 31, 2020 7:54 pm

I agree about the interesting. If you are willing to make a full debug log of a "Full Scan" then I will take a look at it.
You can make the log like this:

Code: Select all

mythtv-setup -v general,channel,chanscan,record --loglevel=debug 2>&1 | tee ms-20200731-2151.log
and then attach the log file ms-20200731-2151.log to this thread. If it is, even gzipped, too big you can send it to me directly.

EFM6
Newcomer
Posts: 9
Joined: Tue Jul 28, 2020 7:40 am
United States of America

Re: Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by EFM6 » Sat Aug 01, 2020 6:35 am

I'd post the log if I could figure out how to make the log. I copy/paste that line in terminal, it starts Myth backend, I do a full scan, exit Myth. I see the log file exists, but it is 0 size. Opening it in Libre Office shows a blank page. I do have logs for mythbackend, mythfrontend, mythtv-setup.

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

Re: Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by kmdewaal » Sat Aug 01, 2020 8:39 am

The command as given should work for the bash shell. But you can also make a log file as follows that works with every shell:

Code: Select all

mythtv-setup -v general,channel,chanscan,record --loglevel=debug --logpath=.
This will create a file with a name like mythtv-setup.20200729204624.164233.log in your current directory.

EFM6
Newcomer
Posts: 9
Joined: Tue Jul 28, 2020 7:40 am
United States of America

Re: Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by EFM6 » Sat Aug 01, 2020 9:57 am

That one worked. This is all a fresh installation today, by the way. Formatted the drive, and only put Kubuntu, a different file manager, and Myth on it.

Earlier, I did a scan with the Hauppauge tuner (and it found all channels). In this log, I added a Twinhan back in and did a scan with that. It did something odd and said three channles already existed, and named them slightly different. (Channel 38 and two sub channels.)

I don't know why it did that this time and never before, but it's just a minor weird thing and is irrelevant to the main weird thing of the Twinhan apparently ignoring channels below 21.
Attachments
mythtv-setup.20200801090533.4859.zip
(72.76 KiB) Downloaded 9 times

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

Re: Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by kmdewaal » Sat Aug 01, 2020 1:59 pm

Never bet with wesnewell, he is right about this being a driver issue.

What happens is that MythTV gets from the driver information about the minimum and maximum frequency that the device can handle.
When tuning, MythTV does give a warning when the frequency is out of the allowed range and then it also prints the frequency range.

This is the message for Channel 14 at 473MHz:

Code: Select all

2020-08-01 04:07:09.500652 W [4859/4910] Scanner recorders/dvbchannel.cpp:339 (CheckFrequency) - DVBChan[2](/dev/dvb/adapter0/frontend0): Your frequency setting (473000000) is out of range. (min/max:510000000/858000000)
MythTV nevertheless ignores this warning and tries to tune anyway, which results then in this message:

Code: Select all

2020-08-01 04:07:10.500948 E [4859/4910] Scanner recorders/dvbchannel.cpp:818 (Tune) - DVBChan[2](/dev/dvb/adapter0/frontend0): Tune(): Setting Frontend tuning parameters failed.
			eno: Invalid argument (22)
This is, with a high degree of certainty, the result of the driver code checking against the frequency limits.
The first channel that is in the frequency range is Channel 21 at 515MHz and that channel is tuned correctly as you have found.
So this is a driver issue that cannot be fixed in MythTV. It could be fixed in the driver, given that the hardware can do it as Windows proves, but that is unlikely to happen spontaneously at short notice.

What you can do is build a system with the Twinhan tuners and with other tuners as well and create two video sources, one for the Twinhan tuners with a limited set of channels and one for the other tuners with all channels. If you then give the Twinhan tuners a higher priority then these will be used whenever possible and when it is not possible, so for the lower frequencies, MythTV will use the other tuners.

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

Re: Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by wesnewell » Sat Aug 01, 2020 4:38 pm

Just a wag. If you can find the driver source code, it shouldn't be too hard to change the min/max ranges. Should also be able to change it in the raw code with some searching. Take your pick of minimum.
VHF-Lo 2 - 6 54 - 88 MHz
VHF-Hi 7 - 13 174 - 216 MHz
UHF 14 - 69 470 - 806 MHz
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.

EFM6
Newcomer
Posts: 9
Joined: Tue Jul 28, 2020 7:40 am
United States of America

Re: Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by EFM6 » Sun Aug 02, 2020 2:45 am

Thanks for the help. If nothing else, it's nice that the mystery is solved.

The Twinhan card works well in Windows 10, but only one card. I don't know of any Windows 10 software that can get two of them to work at the same time. So, one can work 100% in Windows 10, or two can work at 50% each in Linux. haha

And MythTV is very good, so there's that.

Finding and changing driver source code is beyond me at the moment. I'm a Linux newb, and this week is the first time I've used Linux more than just browsing around for a few minutes. Maybe there's some good Driver Source Code how-to's on the internet, and then I'll have no choice but to try it. Though maybe the first stop on that should be the LinuxTV group like was mentioned. You never know who might be interested in helping to get a TV tuner card from the year 2006 to work. ;)

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

Re: Twinhan 3250 tuner works great in Windows, only half channels in Linux?

Post by wesnewell » Sun Aug 02, 2020 4:40 am

If I'm right it uses the bttv driver. That's part of the kernel source, so the source code for it is available. It may even be fixed in a later kernel, but I have no idea which kernel you are using. This is the one on my system.
wes@mythfe0:~$ ll /usr/lib/modules/5.4.0-42-generic/kernel/drivers/media/pci/bt8xx/bttv.ko
-rw-r--r-- 1 root root 239337 Jul 9 18:50 /usr/lib/modules/5.4.0-42-generic/kernel/drivers/media/pci/bt8xx/bttv.ko
wes@mythfe0:~$
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.

Post Reply