Ticket #13014: 20190319-delsys-v1.patch
File 20190319-delsys-v1.patch, 30.9 KB (added by , 5 years ago) |
---|
-
mythtv/libs/libmythtv/cardutil.cpp
diff --git a/mythtv/libs/libmythtv/cardutil.cpp b/mythtv/libs/libmythtv/cardutil.cpp index 41224166d9..76fdf521e9 100644
a b QStringList CardUtil::ProbeVideoDevices(const QString &rawtype) 574 574 return devs; 575 575 } 576 576 577 QString CardUtil::ProbeDVBType(const QString &device) 577 // Get the list of delivery systems from the card 578 QStringList CardUtil::ProbeDeliverySystems(const QString &device) 578 579 { 579 QString ret = "ERROR_UNKNOWN";580 QStringList delsys; 580 581 581 582 if (device.isEmpty()) 582 return ret;583 return delsys; 583 584 584 585 #ifdef USING_DVB 585 586 QString dvbdev = CardUtil::GetDeviceName(DVB_DEV_FRONTEND, device); … … QString CardUtil::ProbeDVBType(const QString &device) 588 589 int fd_frontend = open(dev.constData(), O_RDWR | O_NONBLOCK); 589 590 if (fd_frontend < 0) 590 591 { 591 LOG(VB_GENERAL, LOG_ERR, QString("Can't open DVB frontend (%1) for %2.") 592 LOG(VB_GENERAL, LOG_ERR, LOC + 593 QString("Can't open DVB frontend (%1) for %2.") 592 594 .arg(dvbdev).arg(device) + ENO); 593 return ret; 594 } 595 596 struct dvb_frontend_info info; 597 memset(&info, 0, sizeof(info)); 598 int err = ioctl(fd_frontend, FE_GET_INFO, &info); 599 if (err < 0) 600 { 601 close(fd_frontend); 602 LOG(VB_GENERAL, LOG_ERR, QString("FE_GET_INFO ioctl failed (%1)") 603 .arg(dvbdev) + ENO); 604 return ret; 605 } 606 607 DTVTunerType type(info.type); 608 #if HAVE_FE_CAN_2G_MODULATION 609 if (info.caps & FE_CAN_2G_MODULATION) 610 { 611 if (type == DTVTunerType::kTunerTypeDVBS1) 612 type = DTVTunerType::kTunerTypeDVBS2; 613 else if (type == DTVTunerType::kTunerTypeDVBT) 614 type = DTVTunerType::kTunerTypeDVBT2; 595 return delsys; 615 596 } 616 #endif // HAVE_FE_CAN_2G_MODULATION617 597 618 598 #if DVB_API_VERSION >=5 619 599 unsigned int i; … … QString CardUtil::ProbeDVBType(const QString &device) 621 601 struct dtv_properties cmd; 622 602 623 603 memset(&prop, 0, sizeof(prop)); 624 prop.cmd = DTV_ ENUM_DELSYS;604 prop.cmd = DTV_API_VERSION; 625 605 cmd.num = 1; 626 606 cmd.props = ∝ 607 if (ioctl(fd_frontend, FE_GET_PROPERTY, &cmd) == 0) 608 { 609 LOG(VB_GENERAL, LOG_INFO, LOC + 610 QString("(%1) ").arg(dvbdev) + 611 QString("dvb api version %1.%2").arg((prop.u.data>>8)&0xff).arg((prop.u.data)&0xff)); 612 } 613 else 614 { 615 LOG(VB_GENERAL, LOG_ERR, LOC + QString("(%1) FE_GET_PROPERTY ioctl failed") 616 .arg(dvbdev) + ENO); 617 close(fd_frontend); 618 return delsys; 619 } 627 620 621 memset(&prop, 0, sizeof(prop)); 622 prop.cmd = DTV_ENUM_DELSYS; 623 cmd.num = 1; 624 cmd.props = ∝ 628 625 if (ioctl(fd_frontend, FE_GET_PROPERTY, &cmd) == 0) 629 626 { 630 627 for (i = 0; i < prop.u.buffer.len; i++) 631 628 { 632 switch (prop.u.buffer.data[i]) 633 { 634 // TODO: not supported. you can have DVBC and DVBT on the same card 635 // The following are backwards compatible so its ok 636 case SYS_DVBS2: 637 type = DTVTunerType::kTunerTypeDVBS2; 638 break; 639 case SYS_DVBT2: 640 type = DTVTunerType::kTunerTypeDVBT2; 641 break; 642 default: 643 break; 644 } 629 delsys.push_back(DTVModulationSystem::toString(prop.u.buffer.data[i])); 645 630 } 631 QStringList::iterator it = delsys.begin(); 632 QString msg = "Delivery systems:"; 633 for (; it != delsys.end(); it++) 634 { 635 msg += " "; 636 msg += *it; 637 } 638 LOG(VB_GENERAL, LOG_INFO, QString("CardUtil: (%1) num props:%2 ") 639 .arg(dvbdev).arg(prop.u.buffer.len) + msg); 646 640 } 647 #endif 641 else 642 { 643 LOG(VB_GENERAL, LOG_ERR, LOC + QString("FE_GET_PROPERTY ioctl failed (%1)") 644 .arg(dvbdev) + ENO); 645 } 646 #endif // DVB_API_VERSION >= 5 648 647 close(fd_frontend); 648 #endif // USING_DVB 649 649 650 return delsys; 651 } 652 653 QString CardUtil::ProbeDVBType(const QString &device) 654 { 655 QString ret = "ERROR_UNKNOWN"; 656 657 if (device.isEmpty()) 658 return ret; 659 660 #ifdef USING_DVB 661 DTVTunerType type = ProbeTunerType(device); 650 662 ret = (type.toString() != "UNKNOWN") ? type.toString().toUpper() : ret; 663 664 LOG(VB_GENERAL, LOG_INFO, LOC + QString("(%1) tuner type:%2") 665 .arg(device).arg(ret)); 651 666 #endif // USING_DVB 652 667 653 668 return ret; … … uint CardUtil::GetMinSignalMonitoringDelay(const QString &device) 719 734 return 25; 720 735 } 721 736 737 738 DTVTunerType CardUtil::ConvertToTunerType(DTVModulationSystem delsys) 739 { 740 DTVTunerType tunertype; 741 742 switch (delsys) 743 { 744 case DTVModulationSystem::kModulationSystem_DVBS: 745 tunertype = DTVTunerType::kTunerTypeDVBS1; 746 break; 747 case DTVModulationSystem::kModulationSystem_DVBS2: 748 tunertype = DTVTunerType::kTunerTypeDVBS2; 749 break; 750 case DTVModulationSystem::kModulationSystem_DVBC_ANNEX_A: 751 tunertype = DTVTunerType::kTunerTypeDVBC; 752 break; 753 case DTVModulationSystem::kModulationSystem_DVBT: 754 tunertype = DTVTunerType::kTunerTypeDVBT; 755 break; 756 case DTVModulationSystem::kModulationSystem_DVBT2: 757 tunertype = DTVTunerType::kTunerTypeDVBT2; 758 break; 759 case DTVModulationSystem::kModulationSystem_ATSC: 760 tunertype = DTVTunerType::kTunerTypeATSC; 761 break; 762 default: 763 LOG(VB_GENERAL, LOG_ERR, LOC + 764 QString("TODO Add to switch case delivery system:%2 %3") 765 .arg(delsys).arg(delsys.toString())); 766 break; 767 } 768 769 return tunertype; 770 } 771 772 // Get the currently configured delivery system from the database 773 DTVModulationSystem CardUtil::GetDeliverySystem(uint inputid) 774 { 775 QString delsys_db = GetDeliverySystemFromDB(inputid); 776 DTVModulationSystem delsys; 777 delsys.Parse(delsys_db); 778 return delsys; 779 } 780 781 // Get the currently configured tuner type from the database 782 DTVTunerType CardUtil::GetTunerType(uint inputid) 783 { 784 DTVModulationSystem delsys = GetDeliverySystem(inputid); 785 DTVTunerType tunertype = ConvertToTunerType(delsys); 786 return tunertype; 787 } 788 789 // Get the currently configured delivery system from the device 790 DTVModulationSystem CardUtil::ProbeDeliverySystem(const QString &device) 791 { 792 DTVModulationSystem delsys; 793 794 QByteArray dev = device.toLatin1(); 795 int fd_frontend = open(dev.constData(), O_RDWR | O_NONBLOCK); 796 if (fd_frontend < 0) 797 { 798 LOG(VB_GENERAL, LOG_ERR, LOC + 799 QString("open failed (%1)") 800 .arg(device) + ENO); 801 return delsys; 802 } 803 804 #ifdef USING_DVB 805 #if DVB_API_VERSION >=5 806 struct dtv_property prop; 807 struct dtv_properties cmd; 808 809 memset(&prop, 0, sizeof(prop)); 810 prop.cmd = DTV_DELIVERY_SYSTEM; 811 // prop.u.data = delsys; 812 cmd.num = 1; 813 cmd.props = ∝ 814 815 int ret = ioctl(fd_frontend, FE_GET_PROPERTY, &cmd); 816 if (ret < 0) 817 { 818 LOG(VB_GENERAL, LOG_ERR, LOC + 819 QString("FE_GET_PROPERTY ioctl failed (%1)") 820 .arg(device) + ENO); 821 return delsys; 822 } 823 824 delsys.Parse(DTVModulationSystem::toString(prop.u.data)); 825 826 LOG(VB_GENERAL, LOG_INFO, LOC + QString("(%1) delsys:%2 %3") 827 .arg(device).arg(delsys).arg(delsys.toString())); 828 829 #endif // DVB_API_VERSION >=5 830 #endif // USING_DVB 831 832 close(fd_frontend); 833 return delsys; 834 } 835 836 // Get the currently configured tuner type from the device 837 DTVTunerType CardUtil::ProbeTunerType(const QString &device) 838 { 839 DTVModulationSystem delsys = ProbeDeliverySystem(device); 840 DTVTunerType tunertype = ConvertToTunerType(delsys); 841 return tunertype; 842 } 843 844 // Get the delivery system from database table capturecard 845 // and configure the tuner accordingly. 846 // Return the tuner type corresponding with the modulation system. 722 847 QString CardUtil::ProbeSubTypeName(uint inputid) 723 848 { 724 849 QString type = GetRawInputType(inputid); … … QString CardUtil::ProbeSubTypeName(uint inputid) 730 855 if (device.isEmpty()) 731 856 return "ERROR_OPEN"; 732 857 733 return ProbeDVBType(device); 858 DTVModulationSystem delsys = GetDeliverySystem(inputid); 859 DTVTunerType tunertype = ConvertToTunerType(delsys); 860 if (DTVTunerType::kTunerTypeUnknown != tunertype) 861 { 862 SetDeliverySystem(inputid, delsys); 863 } 864 865 QString subtype = "ERROR_UNKNOWN"; 866 if (DTVTunerType::kTunerTypeUnknown != tunertype) 867 { 868 subtype = tunertype.toString(); 869 } 870 871 LOG(VB_GENERAL, LOG_INFO, LOC + QString("[%1]: delsys:%2 %3 tunertype:%4 %5 subtype:%6") 872 .arg(inputid).arg(delsys).arg(delsys.toString()) 873 .arg(tunertype).arg(tunertype.toString()).arg(subtype)); 874 875 return subtype; 734 876 } 735 877 736 878 /// \brief Returns true iff the input_type is one of the DVB types. … … bool CardUtil::IsDVBInputType(const QString &inputType) 741 883 (t == "OFDM") || (t == "ATSC") || (t == "DVB_S2"); 742 884 } 743 885 886 int CardUtil::SetDeliverySystem(uint inputid) 887 { 888 int ret = -1; 889 890 #ifdef USING_DVB 891 #if DVB_API_VERSION >=5 892 DTVModulationSystem delsys = GetDeliverySystem(inputid); 893 ret = SetDeliverySystem(inputid, delsys); 894 #endif // DVB_API_VERSION >=5 895 #endif // USING_DVB 896 897 return ret; 898 } 899 900 int CardUtil::SetDeliverySystem(uint inputid, DTVModulationSystem delsys) 901 { 902 int ret = -1; 903 904 #ifdef USING_DVB 905 #if DVB_API_VERSION >=5 906 QString device = GetVideoDevice(inputid); 907 908 if (device.isEmpty()) 909 return ret; 910 911 QString dvbdev = CardUtil::GetDeviceName(DVB_DEV_FRONTEND, device); 912 QByteArray dev = dvbdev.toLatin1(); 913 int fd_frontend = open(dev.constData(), O_RDWR | O_NONBLOCK); 914 if (fd_frontend < 0) 915 { 916 LOG(VB_GENERAL, LOG_ERR, LOC + 917 QString("open failed (%1)") 918 .arg(dvbdev) + ENO); 919 return errno; 920 } 921 ret = SetDeliverySystem(inputid, delsys, fd_frontend); 922 923 close(fd_frontend); 924 #endif // DVB_API_VERSION >=5 925 #endif // USING_DVB 926 927 return ret; 928 } 929 930 // Get delivery system from the database and write it to the card 931 int CardUtil::SetDeliverySystem(uint inputid, int fd) 932 { 933 int ret = -1; 934 935 #ifdef USING_DVB 936 #if DVB_API_VERSION >=5 937 DTVModulationSystem delsys = GetDeliverySystem(inputid); 938 ret = SetDeliverySystem(inputid, delsys, fd); 939 #endif // DVB_API_VERSION >=5 940 #endif // USING_DVB 941 942 return ret; 943 } 944 945 // Write the delivery system to the card 946 int CardUtil::SetDeliverySystem(uint inputid, DTVModulationSystem delsys, int fd) 947 { 948 int ret = -1; 949 950 #ifdef USING_DVB 951 #if DVB_API_VERSION >=5 952 LOG(VB_GENERAL, LOG_INFO, LOC + QString("[%1] fd:%2 delsys:%3 %4") 953 .arg(inputid).arg(fd).arg(delsys).arg(delsys.toString())); 954 955 struct dtv_property prop; 956 struct dtv_properties cmd; 957 958 memset(&prop, 0, sizeof(prop)); 959 prop.cmd = DTV_DELIVERY_SYSTEM; 960 prop.u.data = delsys; 961 cmd.num = 1; 962 cmd.props = ∝ 963 964 ret = ioctl(fd, FE_SET_PROPERTY, &cmd); 965 if (ret < 0) 966 { 967 LOG(VB_GENERAL, LOG_ERR, LOC + 968 QString("[%1] FE_SET_PROPERTY ioctl failed") 969 .arg(inputid) + ENO); 970 return ret; 971 } 972 #endif // DVB_API_VERSION >=5 973 #endif // USING_DVB 974 975 return ret; 976 } 977 744 978 QString get_on_input(const QString &to_get, uint inputid) 745 979 { 746 980 MSqlQuery query(MSqlQuery::InitCon()); -
mythtv/libs/libmythtv/cardutil.h
diff --git a/mythtv/libs/libmythtv/cardutil.h b/mythtv/libs/libmythtv/cardutil.h index 1de3a3ac48..e5c207ab16 100644
a b using namespace std; 14 14 15 15 // MythTV headers 16 16 #include "mythtvexp.h" 17 #include "dtvconfparserhelpers.h" 17 18 18 19 class InputInfo; 19 20 class CardInput; … … class MTV_PUBLIC CardUtil 275 276 { return get_on_input("audiodevice", inputid); } 276 277 static QString GetVBIDevice(uint inputid) 277 278 { return get_on_input("vbidevice", inputid); } 279 static QString GetDeliverySystemFromDB(uint inputid) 280 { return get_on_input("inputname", inputid); } // use capturecard/inputname for now 278 281 279 282 static QString GetHostname(uint inputid) 280 283 { return get_on_input("hostname", inputid); } … … class MTV_PUBLIC CardUtil 372 375 { return "DVB" == GetRawInputType(inputid); } 373 376 static bool IsDVBInputType(const QString &input_type); 374 377 static QString ProbeDVBFrontendName(const QString &device); 378 static QStringList ProbeDeliverySystems(const QString &device); 379 static DTVModulationSystem ProbeDeliverySystem(const QString &device); 380 static DTVTunerType ProbeTunerType(const QString &device); 381 static DTVTunerType ConvertToTunerType(DTVModulationSystem delsys); 382 static DTVTunerType GetTunerType(uint inputid); 383 static DTVModulationSystem GetDeliverySystem(uint inputid); 375 384 static QString ProbeDVBType(const QString &device); 376 385 static bool HasDVBCRCBug(const QString &device); 377 386 static uint GetMinSignalMonitoringDelay(const QString &device); 378 387 static QString GetDeviceName(dvb_dev_type_t, const QString &device); 379 388 static InputNames GetConfiguredDVBInputs(const QString &device); 389 static int SetDeliverySystem(uint inputid); 390 static int SetDeliverySystem(uint inputid, DTVModulationSystem delsys); 391 static int SetDeliverySystem(uint inputid, int fd); 392 static int SetDeliverySystem(uint inputid, DTVModulationSystem delsys, int fd); 380 393 381 394 // V4L info 382 395 static bool hasV4L2(int videofd); -
mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
diff --git a/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp b/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp index 6b2942250e..69be48c8e4 100644
a b bool ChannelScanSM::AddToList(uint mplexid) 2176 2176 2177 2177 TransportScanItem item(sourceid, sistandard, fn, mplexid, m_signalTimeout); 2178 2178 2179 // KdW 2180 LOG(VB_CHANSCAN, LOG_INFO, LOC + 2181 QString("tt:%1 %2 sourceid:%3 sistandard:%4 fn:'%5' mplexid:%6") 2182 .arg(tt).arg(tt.toString()).arg(sourceid).arg(sistandard).arg(fn).arg(mplexid)); 2183 2179 2184 if (item.m_tuning.FillFromDB(tt, mplexid)) 2180 2185 { 2181 2186 LOG(VB_CHANSCAN, LOG_INFO, LOC + "Adding " + fn); -
mythtv/libs/libmythtv/dtvconfparserhelpers.cpp
diff --git a/mythtv/libs/libmythtv/dtvconfparserhelpers.cpp b/mythtv/libs/libmythtv/dtvconfparserhelpers.cpp index 55af025dac..a0101c8395 100644
a b const char *DTVPolarity::s_dbStr[DTVPolarity::kDBStrCnt] = 448 448 const DTVParamHelperStruct DTVModulationSystem::s_confTable[] = 449 449 { 450 450 { "SYS_UNDEFINED", kModulationSystem_UNDEFINED }, 451 { "SYS_DVBC_ANNEX_A C", kModulationSystem_DVBC_ANNEX_AC},451 { "SYS_DVBC_ANNEX_A", kModulationSystem_DVBC_ANNEX_A }, 452 452 { "SYS_DVBC_ANNEX_B", kModulationSystem_DVBC_ANNEX_B }, 453 453 { "SYS_DVBT", kModulationSystem_DVBT }, 454 454 { "SYS_DVBT2", kModulationSystem_DVBT2 }, … … const DTVParamHelperStruct DTVModulationSystem::s_vdrTable[] = 478 478 479 479 const DTVParamHelperStruct DTVModulationSystem::s_parseTable[] = 480 480 { 481 { "UNDEFINED", kModulationSystem_UNDEFINED },482 { "DVB C_AC", kModulationSystem_DVBC_ANNEX_AC},483 { "DVB C_B",kModulationSystem_DVBC_ANNEX_B },484 { "DVB-T", kModulationSystem_DVBT },485 { "D VB-T2", kModulationSystem_DVBT2},486 { "D SS", kModulationSystem_DSS},487 { "DVB-S ", kModulationSystem_DVBS},488 { "DVB -S2", kModulationSystem_DVBS2},489 { " DVBH", kModulationSystem_DVBH},490 { "ISDB T", kModulationSystem_ISDBT},491 { "ISDB S", kModulationSystem_ISDBS},492 { " ISDBC", kModulationSystem_ISDBC},493 { "ATSC ", kModulationSystem_ATSC},494 { " ATSCMH", kModulationSystem_ATSCMH},495 { " DMBTH", kModulationSystem_DMBTH},496 { " CMMB", kModulationSystem_CMMB},497 { "D AB", kModulationSystem_DAB},498 { "TURBO", kModulationSystem_TURBO },499 { "DVB C_C",kModulationSystem_DVBC_ANNEX_C },500 { nullptr, kModulationSystem_UNDEFINED },481 { "UNDEFINED", kModulationSystem_UNDEFINED }, 482 { "DVB-C/A", kModulationSystem_DVBC_ANNEX_A }, 483 { "DVB-C/B", kModulationSystem_DVBC_ANNEX_B }, 484 { "DVB-T", kModulationSystem_DVBT }, 485 { "DSS", kModulationSystem_DSS }, 486 { "DVB-S", kModulationSystem_DVBS }, 487 { "DVB-S2", kModulationSystem_DVBS2 }, 488 { "DVBH", kModulationSystem_DVBH }, 489 { "ISDBT", kModulationSystem_ISDBT }, 490 { "ISDBS", kModulationSystem_ISDBS }, 491 { "ISDBC", kModulationSystem_ISDBC }, 492 { "ATSC", kModulationSystem_ATSC }, 493 { "ATSCMH", kModulationSystem_ATSCMH }, 494 { "DMBTH", kModulationSystem_DMBTH }, 495 { "CMMB", kModulationSystem_CMMB }, 496 { "DAB", kModulationSystem_DAB }, 497 { "DVB-T2", kModulationSystem_DVBT2 }, 498 { "TURBO", kModulationSystem_TURBO }, 499 { "DVB-C/C", kModulationSystem_DVBC_ANNEX_C }, 500 { nullptr, kModulationSystem_UNDEFINED }, 501 501 }; 502 502 503 503 const char *DTVModulationSystem::s_dbStr[DTVModulationSystem::kDBStrCnt] = 504 504 { 505 "UNDEFINED", ///< kModulationSystem_UNDEFINED506 "DVB CAC", ///< kModulationSystem_DVBC_ANNEX_AC507 "DVB C_B",///< kModulationSystem_DVBC_ANNEX_B508 "DVB-T", ///< kModulationSystem_DVBT509 "DSS", ///< kModulationSystem_DSS510 "DVB-S", ///< kModulationSystem_DVBS511 "DVB-S2", ///< kModulationSystem_DVBS2512 "DVBH", ///< kModulationSystem_DVBH513 "ISDBT", ///< kModulationSystem_ISDBT514 "ISDBS", ///< kModulationSystem_ISDBS515 "ISDBC", ///< kModulationSystem_ISDBC516 "ATSC", ///< kModulationSystem_ATSC517 "ATSCMH", ///< kModulationSystem_ATSCMH518 "DMBTH", ///< kModulationSystem_DMBTH519 "CMMB", ///< kModulationSystem_CMMB520 "DAB", ///< kModulationSystem_DAB521 "DVB-T2", ///< kModulationSystem_DVBT2522 "TURBO", ///< kModulationSystem_TURBO523 "DVB C-C",///< kModulationSystem_DVBC_ANNEX_C505 "UNDEFINED", ///< kModulationSystem_UNDEFINED 506 "DVB-C/A", ///< kModulationSystem_DVBC_ANNEX_A 507 "DVB-C/B", ///< kModulationSystem_DVBC_ANNEX_B 508 "DVB-T", ///< kModulationSystem_DVBT 509 "DSS", ///< kModulationSystem_DSS 510 "DVB-S", ///< kModulationSystem_DVBS 511 "DVB-S2", ///< kModulationSystem_DVBS2 512 "DVBH", ///< kModulationSystem_DVBH 513 "ISDBT", ///< kModulationSystem_ISDBT 514 "ISDBS", ///< kModulationSystem_ISDBS 515 "ISDBC", ///< kModulationSystem_ISDBC 516 "ATSC", ///< kModulationSystem_ATSC 517 "ATSCMH", ///< kModulationSystem_ATSCMH 518 "DMBTH", ///< kModulationSystem_DMBTH 519 "CMMB", ///< kModulationSystem_CMMB 520 "DAB", ///< kModulationSystem_DAB 521 "DVB-T2", ///< kModulationSystem_DVBT2 522 "TURBO", ///< kModulationSystem_TURBO 523 "DVB-C/C", ///< kModulationSystem_DVBC_ANNEX_C 524 524 }; 525 525 526 526 const DTVParamHelperStruct DTVRollOff::s_confTable[] = -
mythtv/libs/libmythtv/dtvconfparserhelpers.h
diff --git a/mythtv/libs/libmythtv/dtvconfparserhelpers.h b/mythtv/libs/libmythtv/dtvconfparserhelpers.h index 69111b98de..dd172f1a6c 100644
a b class DTVModulationSystem : public DTVParamHelper 593 593 { 594 594 // see fe_delivery_system in frontend.h 595 595 kModulationSystem_UNDEFINED, 596 kModulationSystem_DVBC_ANNEX_A C,596 kModulationSystem_DVBC_ANNEX_A, 597 597 kModulationSystem_DVBC_ANNEX_B, 598 598 kModulationSystem_DVBT, 599 599 kModulationSystem_DSS, -
mythtv/libs/libmythtv/dtvmultiplex.cpp
diff --git a/mythtv/libs/libmythtv/dtvmultiplex.cpp b/mythtv/libs/libmythtv/dtvmultiplex.cpp index cb1aeb0396..4ae52d4430 100644
a b bool DTVMultiplex::ParseDVB_T2( 270 270 QString l_mod_sys = _mod_sys; 271 271 if (_mod_sys == "1") 272 272 { 273 LOG(VB_GENERAL, LOG_WARNING, LOC + "Invalid T2 modulation system " +273 LOG(VB_GENERAL, LOG_WARNING, LOC + "Invalid DVB-T2 modulation system " + 274 274 QString("parameter '%1', using DVB-T2.").arg(_mod_sys)); 275 l_mod_sys = "DVB-T ";275 l_mod_sys = "DVB-T2"; 276 276 } 277 277 else if (_mod_sys == "0") 278 278 { 279 LOG(VB_GENERAL, LOG_WARNING, LOC + "Invalid T2modulation system " +279 LOG(VB_GENERAL, LOG_WARNING, LOC + "Invalid DVB-T modulation system " + 280 280 QString("parameter '%1', using DVB-T.").arg(_mod_sys)); 281 281 l_mod_sys = "DVB-T"; 282 282 } 283 283 if (!m_mod_sys.Parse(l_mod_sys)) 284 284 { 285 LOG(VB_GENERAL, LOG_WARNING, LOC + "Invalid T2 modulation system " +285 LOG(VB_GENERAL, LOG_WARNING, LOC + "Invalid DVB-T/T2 modulation system " + 286 286 QString("parameter '%1', aborting.").arg(l_mod_sys)); 287 287 return false; 288 288 } … … bool DTVMultiplex::ParseTuningParams( 343 343 } 344 344 345 345 if (DTVTunerType::kTunerTypeATSC == type) 346 { 346 347 return ParseATSC(_frequency, _modulation); 348 } 347 349 348 350 LOG(VB_GENERAL, LOG_ERR, LOC + 349 351 QString("ParseTuningParams -- Unknown tuner type = 0x%1") -
mythtv/libs/libmythtv/recorders/channelbase.cpp
diff --git a/mythtv/libs/libmythtv/recorders/channelbase.cpp b/mythtv/libs/libmythtv/recorders/channelbase.cpp index 882931f3ae..adf08e94d2 100644
a b bool ChannelBase::InitializeInput(void) 562 562 563 563 if (!query.exec() || !query.isActive()) 564 564 { 565 MythDB::DBError(" InitializeInputs", query);565 MythDB::DBError("ChannelBase::InitializeInput", query); 566 566 return false; 567 567 } 568 568 else if (!query.size()) 569 569 { 570 LOG(VB_GENERAL, LOG_ERR, "InitializeInputs(): " 571 "\n\t\t\tCould not get inputs for the capturecard." 572 "\n\t\t\tPerhaps you have forgotten to bind video" 573 "\n\t\t\tsources to your card's inputs?"); 570 LOG(VB_GENERAL, LOG_ERR, LOC + 571 QString("No capturecard record in database for input %1") 572 .arg(m_inputid)); 574 573 return false; 575 574 } 576 575 … … bool ChannelBase::InitializeInput(void) 582 581 m_externalChanger = query.value(3).toString(); 583 582 m_tuneToChannel = query.value(4).toString(); 584 583 584 if (0 == m_sourceid) 585 { 586 LOG(VB_GENERAL, LOG_ERR, LOC + 587 QString("No video source defined for input %1") 588 .arg(m_inputid)); 589 return false; 590 } 591 585 592 m_channels = ChannelUtil::GetChannels(m_sourceid, false); 586 593 QString order = gCoreContext->GetSetting("ChannelOrdering", "channum"); 587 594 ChannelUtil::SortChannels(m_channels, order); -
mythtv/libs/libmythtv/recorders/dtvchannel.cpp
diff --git a/mythtv/libs/libmythtv/recorders/dtvchannel.cpp b/mythtv/libs/libmythtv/recorders/dtvchannel.cpp index 9721a97ca8..92f2f8927c 100644
a b bool DTVChannel::SetChannelByString(const QString &channum) 283 283 } 284 284 else 285 285 { 286 // KdW 287 LOG(VB_GENERAL, LOG_ERR, loc + 288 QString("Initialize multiplex options m_tunerType:%1 mplexid:%2") 289 .arg(m_tunerType).arg(mplexid)); 290 286 291 // Try to fix any problems with the multiplex 287 292 CheckOptions(tuning); 288 293 -
mythtv/libs/libmythtv/recorders/dvbchannel.cpp
diff --git a/mythtv/libs/libmythtv/recorders/dvbchannel.cpp b/mythtv/libs/libmythtv/recorders/dvbchannel.cpp index 4cb8bed226..8dcc69c72d 100644
a b bool DVBChannel::Open(DVBChannel *who) 260 260 return false; 261 261 } 262 262 263 m_frontend_name = info.name; 264 m_tunerType = info.type; 265 #if HAVE_FE_CAN_2G_MODULATION 266 if (info.caps & FE_CAN_2G_MODULATION) 267 { 268 if (m_tunerType == DTVTunerType::kTunerTypeDVBS1) 269 m_tunerType = DTVTunerType::kTunerTypeDVBS2; 270 else if (m_tunerType == DTVTunerType::kTunerTypeDVBT) 271 m_tunerType = DTVTunerType::kTunerTypeDVBT2; 272 } 273 #endif // HAVE_FE_CAN_2G_MODULATION 263 m_frontend_name = info.name; 274 264 m_capabilities = info.caps; 275 265 m_frequency_minimum = info.frequency_min; 276 266 m_frequency_maximum = info.frequency_max; 277 267 m_symbol_rate_minimum = info.symbol_rate_min; 278 268 m_symbol_rate_maximum = info.symbol_rate_max; 279 269 280 #if DVB_API_VERSION >=5 281 unsigned int i; 282 struct dtv_property prop; 283 struct dtv_properties cmd; 284 285 memset(&prop, 0, sizeof(prop)); 286 prop.cmd = DTV_API_VERSION; 287 cmd.num = 1; 288 cmd.props = ∝ 289 if (ioctl(m_fd_frontend, FE_GET_PROPERTY, &cmd) == 0) 290 { 291 LOG(VB_RECORD, LOG_INFO, LOC + 292 QString("dvb api version %1.%2").arg((prop.u.data>>8)&0xff).arg((prop.u.data)&0xff)); 293 } 294 295 memset(&prop, 0, sizeof(prop)); 296 prop.cmd = DTV_ENUM_DELSYS; 297 cmd.num = 1; 298 cmd.props = ∝ 299 300 if (ioctl(m_fd_frontend, FE_GET_PROPERTY, &cmd) == 0) 301 { 302 LOG(VB_RECORD, LOG_DEBUG, LOC + 303 QString("num props %1").arg(prop.u.buffer.len)); 304 for (i = 0; i < prop.u.buffer.len; i++) 305 { 306 LOG(VB_RECORD, LOG_INFO, LOC + 307 QString("delsys %1: %2 %3") 308 .arg(i).arg(prop.u.buffer.data[i]) 309 .arg(DTVModulationSystem::toString(prop.u.buffer.data[i]))); 310 switch (prop.u.buffer.data[i]) 311 { 312 // TODO: not supported. you can have DVBC and DVBT on the same card 313 // The following are backwards compatible so its ok 314 case SYS_DVBS2: 315 m_tunerType = DTVTunerType::kTunerTypeDVBS2; 316 break; 317 case SYS_DVBT2: 318 m_tunerType = DTVTunerType::kTunerTypeDVBT2; 319 break; 320 default: 321 break; 322 } 323 } 324 } 325 #endif 270 CardUtil::SetDeliverySystem(m_inputid, m_fd_frontend); 271 m_tunerType = CardUtil::GetTunerType(m_inputid); 326 272 327 273 LOG(VB_RECORD, LOG_INFO, LOC + 328 QString(" Using DVB card %1, with frontend '%2'.")329 .arg(m_ device).arg(m_frontend_name));274 QString("Frontend '%2' tunertype:%3 %4") 275 .arg(m_frontend_name).arg(m_tunerType).arg(m_tunerType.toString())); 330 276 331 277 // Turn on the power to the LNB 332 278 if (m_tunerType.IsDiSEqCSupported()) … … bool DVBChannel::Open(DVBChannel *who) 366 312 367 313 bool DVBChannel::IsOpen(void) const 368 314 { 369 // Have to acquire the hw lock to prevent is_open being modified whilst we're searching it315 // Have to acquire the hw lock to prevent is_open being modified whilst we're searching it 370 316 QMutexLocker locker(&m_hw_lock); 371 317 IsOpenMap::const_iterator it = m_is_open.find(this); 372 318 return it != m_is_open.end(); … … bool DVBChannel::HasLock(bool *ok) const 1078 1024 fe_status_t status; 1079 1025 memset(&status, 0, sizeof(status)); 1080 1026 1027 // KdW test 1028 { 1029 struct dvb_frontend_info info; 1030 memset(&info, 0, sizeof(info)); 1031 int err = ioctl(m_fd_frontend, FE_GET_INFO, &info); 1032 if (err < 0) 1033 { 1034 LOG(VB_GENERAL, LOG_ERR, LOC + 1035 QString("FE_GET_INFO failed fd:%1") 1036 .arg(m_fd_frontend) + ENO); 1037 } 1038 } 1039 1081 1040 int ret = ioctl(m_fd_frontend, FE_READ_STATUS, &status); 1082 1041 if (ret < 0) 1083 1042 { 1084 1043 LOG(VB_GENERAL, LOG_ERR, LOC + 1085 " Getting Frontend status failed." + ENO);1044 "FE_READ_STATUS failed" + ENO); 1086 1045 } 1087 1046 1088 1047 if (ok) -
mythtv/libs/libmythtv/transporteditor.cpp
diff --git a/mythtv/libs/libmythtv/transporteditor.cpp b/mythtv/libs/libmythtv/transporteditor.cpp index 56b21e046f..4ce6f938d5 100644
a b void TransportListEditor::Load() 263 263 type = "(DVB-S)"; 264 264 if (CardUtil::QAM == m_cardtype) 265 265 type = "(DVB-C)"; 266 if (CardUtil::DVBS2 == m_cardtype) 267 type = "(DVB-S2)"; 266 268 267 269 QString txt = QString("%1 %2 %3 %4 %5 %6 %7") 268 270 .arg(mod).arg(query.value(2).toString()) -
mythtv/libs/libmythtv/videosource.cpp
diff --git a/mythtv/libs/libmythtv/videosource.cpp b/mythtv/libs/libmythtv/videosource.cpp index 826bd657cf..af6b459ba2 100644
a b class DVBCardNum : public CaptureCardComboBoxSetting 1031 1031 } 1032 1032 }; 1033 1033 1034 class DVBCardType : public GroupSetting 1034 // KdW change DVBCardType from subtype to delivery system 1035 // 1036 // NOTE: use column capturecard/inputname to store the delivery system selection in the database 1037 // If this does conflict with other use of this field then a new column, e.g. "deliverysystem", 1038 // must be added to table capturecard 1039 // Changed GroupSetting into CaptureCardComboBoxSetting 1040 // 1041 class DVBCardType : public CaptureCardComboBoxSetting // KdW was: public GroupSetting 1035 1042 { 1036 1043 public: 1037 DVBCardType() 1044 explicit DVBCardType(const CaptureCard &parent) : 1045 CaptureCardComboBoxSetting(parent, false, "inputname") // KdW false means no "New entry" 1038 1046 { 1039 setLabel(QObject::tr("Subtype")); 1040 setEnabled(false); 1047 setLabel(QObject::tr("Delivery system")); // KdW was: Subtype 1048 setHelpText( 1049 QObject::tr("If your card supports more than one delivery system " 1050 "then you can select here the one that you want to use.")); 1051 1052 // setEnabled(false); 1041 1053 }; 1042 1054 }; 1043 1055 … … void DVBConfigurationGroup::probeCard(const QString &videodevice) 3710 3722 default: 3711 3723 break; 3712 3724 } 3725 3726 // Create selection list of all delivery systems of this card 3727 { 3728 m_cardType->clearSelections(); 3729 QStringList delsys = CardUtil::ProbeDeliverySystems(videodevice); 3730 QStringList::iterator it = delsys.begin(); 3731 if (it != delsys.end()) 3732 { 3733 m_cardType->setValue(*it); 3734 } 3735 for (; it != delsys.end(); it++) 3736 { 3737 LOG(VB_GENERAL, LOG_INFO, QString("DVBCardType: add deliverysystem:%1") 3738 .arg(*it)); 3739 3740 m_cardType->addSelection(*it, *it); 3741 } 3742 } 3743 # 3713 3744 #else 3714 3745 m_cardType->setValue(QString("Recompile with DVB-Support!")); 3715 3746 #endif … … DVBConfigurationGroup::DVBConfigurationGroup(CaptureCard& a_parent, 3759 3790 3760 3791 m_cardNum = new DVBCardNum(m_parent); 3761 3792 m_cardName = new DVBCardName(); 3762 m_cardType = new DVBCardType( );3793 m_cardType = new DVBCardType(m_parent); 3763 3794 3764 3795 m_signalTimeout = new SignalTimeout(m_parent, 500, 250); 3765 3796 m_channelTimeout = new ChannelTimeout(m_parent, 3000, 1750);