Ticket #13014: 20190320-delsys-v1.patch
| File 20190320-delsys-v1.patch, 30.9 KB (added by , 7 years ago) |
|---|
-
mythtv/libs/libmythtv/cardutil.cpp
diff --git a/mythtv/libs/libmythtv/cardutil.cpp b/mythtv/libs/libmythtv/cardutil.cpp index acfe2a5fb6..e40c4d8caa 100644
a b QStringList CardUtil::ProbeVideoDevices(const QString &rawtype) 573 573 return devs; 574 574 } 575 575 576 QString CardUtil::ProbeDVBType(const QString &device) 576 // Get the list of delivery systems from the card 577 QStringList CardUtil::ProbeDeliverySystems(const QString &device) 577 578 { 578 QString ret = "ERROR_UNKNOWN";579 QStringList delsys; 579 580 580 581 if (device.isEmpty()) 581 return ret;582 return delsys; 582 583 583 584 #ifdef USING_DVB 584 585 QString dvbdev = CardUtil::GetDeviceName(DVB_DEV_FRONTEND, device); … … QString CardUtil::ProbeDVBType(const QString &device) 587 588 int fd_frontend = open(dev.constData(), O_RDWR | O_NONBLOCK); 588 589 if (fd_frontend < 0) 589 590 { 590 LOG(VB_GENERAL, LOG_ERR, QString("Can't open DVB frontend (%1) for %2.") 591 LOG(VB_GENERAL, LOG_ERR, LOC + 592 QString("Can't open DVB frontend (%1) for %2.") 591 593 .arg(dvbdev).arg(device) + ENO); 592 return ret; 593 } 594 595 struct dvb_frontend_info info; 596 memset(&info, 0, sizeof(info)); 597 int err = ioctl(fd_frontend, FE_GET_INFO, &info); 598 if (err < 0) 599 { 600 close(fd_frontend); 601 LOG(VB_GENERAL, LOG_ERR, QString("FE_GET_INFO ioctl failed (%1)") 602 .arg(dvbdev) + ENO); 603 return ret; 604 } 605 606 DTVTunerType type(info.type); 607 #if HAVE_FE_CAN_2G_MODULATION 608 if (info.caps & FE_CAN_2G_MODULATION) 609 { 610 if (type == DTVTunerType::kTunerTypeDVBS1) 611 type = DTVTunerType::kTunerTypeDVBS2; 612 else if (type == DTVTunerType::kTunerTypeDVBT) 613 type = DTVTunerType::kTunerTypeDVBT2; 594 return delsys; 614 595 } 615 #endif // HAVE_FE_CAN_2G_MODULATION616 596 617 597 #if DVB_API_VERSION >=5 618 598 unsigned int i; … … QString CardUtil::ProbeDVBType(const QString &device) 620 600 struct dtv_properties cmd; 621 601 622 602 memset(&prop, 0, sizeof(prop)); 623 prop.cmd = DTV_ ENUM_DELSYS;603 prop.cmd = DTV_API_VERSION; 624 604 cmd.num = 1; 625 605 cmd.props = ∝ 606 if (ioctl(fd_frontend, FE_GET_PROPERTY, &cmd) == 0) 607 { 608 LOG(VB_GENERAL, LOG_INFO, LOC + 609 QString("(%1) ").arg(dvbdev) + 610 QString("dvb api version %1.%2").arg((prop.u.data>>8)&0xff).arg((prop.u.data)&0xff)); 611 } 612 else 613 { 614 LOG(VB_GENERAL, LOG_ERR, LOC + QString("(%1) FE_GET_PROPERTY ioctl failed") 615 .arg(dvbdev) + ENO); 616 close(fd_frontend); 617 return delsys; 618 } 626 619 620 memset(&prop, 0, sizeof(prop)); 621 prop.cmd = DTV_ENUM_DELSYS; 622 cmd.num = 1; 623 cmd.props = ∝ 627 624 if (ioctl(fd_frontend, FE_GET_PROPERTY, &cmd) == 0) 628 625 { 629 626 for (i = 0; i < prop.u.buffer.len; i++) 630 627 { 631 switch (prop.u.buffer.data[i]) 632 { 633 // TODO: not supported. you can have DVBC and DVBT on the same card 634 // The following are backwards compatible so its ok 635 case SYS_DVBS2: 636 type = DTVTunerType::kTunerTypeDVBS2; 637 break; 638 case SYS_DVBT2: 639 type = DTVTunerType::kTunerTypeDVBT2; 640 break; 641 default: 642 break; 643 } 628 delsys.push_back(DTVModulationSystem::toString(prop.u.buffer.data[i])); 644 629 } 630 QStringList::iterator it = delsys.begin(); 631 QString msg = "Delivery systems:"; 632 for (; it != delsys.end(); it++) 633 { 634 msg += " "; 635 msg += *it; 636 } 637 LOG(VB_GENERAL, LOG_INFO, QString("CardUtil: (%1) num props:%2 ") 638 .arg(dvbdev).arg(prop.u.buffer.len) + msg); 645 639 } 646 #endif 640 else 641 { 642 LOG(VB_GENERAL, LOG_ERR, LOC + QString("FE_GET_PROPERTY ioctl failed (%1)") 643 .arg(dvbdev) + ENO); 644 } 645 #endif // DVB_API_VERSION >= 5 647 646 close(fd_frontend); 647 #endif // USING_DVB 648 648 649 return delsys; 650 } 651 652 QString CardUtil::ProbeDVBType(const QString &device) 653 { 654 QString ret = "ERROR_UNKNOWN"; 655 656 if (device.isEmpty()) 657 return ret; 658 659 #ifdef USING_DVB 660 DTVTunerType type = ProbeTunerType(device); 649 661 ret = (type.toString() != "UNKNOWN") ? type.toString().toUpper() : ret; 662 663 LOG(VB_GENERAL, LOG_INFO, LOC + QString("(%1) tuner type:%2") 664 .arg(device).arg(ret)); 650 665 #endif // USING_DVB 651 666 652 667 return ret; … … uint CardUtil::GetMinSignalMonitoringDelay(const QString &device) 718 733 return 25; 719 734 } 720 735 736 737 DTVTunerType CardUtil::ConvertToTunerType(DTVModulationSystem delsys) 738 { 739 DTVTunerType tunertype; 740 741 switch (delsys) 742 { 743 case DTVModulationSystem::kModulationSystem_DVBS: 744 tunertype = DTVTunerType::kTunerTypeDVBS1; 745 break; 746 case DTVModulationSystem::kModulationSystem_DVBS2: 747 tunertype = DTVTunerType::kTunerTypeDVBS2; 748 break; 749 case DTVModulationSystem::kModulationSystem_DVBC_ANNEX_A: 750 tunertype = DTVTunerType::kTunerTypeDVBC; 751 break; 752 case DTVModulationSystem::kModulationSystem_DVBT: 753 tunertype = DTVTunerType::kTunerTypeDVBT; 754 break; 755 case DTVModulationSystem::kModulationSystem_DVBT2: 756 tunertype = DTVTunerType::kTunerTypeDVBT2; 757 break; 758 case DTVModulationSystem::kModulationSystem_ATSC: 759 tunertype = DTVTunerType::kTunerTypeATSC; 760 break; 761 default: 762 LOG(VB_GENERAL, LOG_ERR, LOC + 763 QString("TODO Add to switch case delivery system:%2 %3") 764 .arg(delsys).arg(delsys.toString())); 765 break; 766 } 767 768 return tunertype; 769 } 770 771 // Get the currently configured delivery system from the database 772 DTVModulationSystem CardUtil::GetDeliverySystem(uint inputid) 773 { 774 QString delsys_db = GetDeliverySystemFromDB(inputid); 775 DTVModulationSystem delsys; 776 delsys.Parse(delsys_db); 777 return delsys; 778 } 779 780 // Get the currently configured tuner type from the database 781 DTVTunerType CardUtil::GetTunerType(uint inputid) 782 { 783 DTVModulationSystem delsys = GetDeliverySystem(inputid); 784 DTVTunerType tunertype = ConvertToTunerType(delsys); 785 return tunertype; 786 } 787 788 // Get the currently configured delivery system from the device 789 DTVModulationSystem CardUtil::ProbeDeliverySystem(const QString &device) 790 { 791 DTVModulationSystem delsys; 792 793 QByteArray dev = device.toLatin1(); 794 int fd_frontend = open(dev.constData(), O_RDWR | O_NONBLOCK); 795 if (fd_frontend < 0) 796 { 797 LOG(VB_GENERAL, LOG_ERR, LOC + 798 QString("open failed (%1)") 799 .arg(device) + ENO); 800 return delsys; 801 } 802 803 #ifdef USING_DVB 804 #if DVB_API_VERSION >=5 805 struct dtv_property prop; 806 struct dtv_properties cmd; 807 808 memset(&prop, 0, sizeof(prop)); 809 prop.cmd = DTV_DELIVERY_SYSTEM; 810 // prop.u.data = delsys; 811 cmd.num = 1; 812 cmd.props = ∝ 813 814 int ret = ioctl(fd_frontend, FE_GET_PROPERTY, &cmd); 815 if (ret < 0) 816 { 817 LOG(VB_GENERAL, LOG_ERR, LOC + 818 QString("FE_GET_PROPERTY ioctl failed (%1)") 819 .arg(device) + ENO); 820 return delsys; 821 } 822 823 delsys.Parse(DTVModulationSystem::toString(prop.u.data)); 824 825 LOG(VB_GENERAL, LOG_INFO, LOC + QString("(%1) delsys:%2 %3") 826 .arg(device).arg(delsys).arg(delsys.toString())); 827 828 #endif // DVB_API_VERSION >=5 829 #endif // USING_DVB 830 831 close(fd_frontend); 832 return delsys; 833 } 834 835 // Get the currently configured tuner type from the device 836 DTVTunerType CardUtil::ProbeTunerType(const QString &device) 837 { 838 DTVModulationSystem delsys = ProbeDeliverySystem(device); 839 DTVTunerType tunertype = ConvertToTunerType(delsys); 840 return tunertype; 841 } 842 843 // Get the delivery system from database table capturecard 844 // and configure the tuner accordingly. 845 // Return the tuner type corresponding with the modulation system. 721 846 QString CardUtil::ProbeSubTypeName(uint inputid) 722 847 { 723 848 QString type = GetRawInputType(inputid); … … QString CardUtil::ProbeSubTypeName(uint inputid) 729 854 if (device.isEmpty()) 730 855 return "ERROR_OPEN"; 731 856 732 return ProbeDVBType(device); 857 DTVModulationSystem delsys = GetDeliverySystem(inputid); 858 DTVTunerType tunertype = ConvertToTunerType(delsys); 859 if (DTVTunerType::kTunerTypeUnknown != tunertype) 860 { 861 SetDeliverySystem(inputid, delsys); 862 } 863 864 QString subtype = "ERROR_UNKNOWN"; 865 if (DTVTunerType::kTunerTypeUnknown != tunertype) 866 { 867 subtype = tunertype.toString(); 868 } 869 870 LOG(VB_GENERAL, LOG_INFO, LOC + QString("[%1]: delsys:%2 %3 tunertype:%4 %5 subtype:%6") 871 .arg(inputid).arg(delsys).arg(delsys.toString()) 872 .arg(tunertype).arg(tunertype.toString()).arg(subtype)); 873 874 return subtype; 733 875 } 734 876 735 877 /// \brief Returns true iff the input_type is one of the DVB types. … … bool CardUtil::IsDVBInputType(const QString &inputType) 740 882 (t == "OFDM") || (t == "ATSC") || (t == "DVB_S2"); 741 883 } 742 884 885 int CardUtil::SetDeliverySystem(uint inputid) 886 { 887 int ret = -1; 888 889 #ifdef USING_DVB 890 #if DVB_API_VERSION >=5 891 DTVModulationSystem delsys = GetDeliverySystem(inputid); 892 ret = SetDeliverySystem(inputid, delsys); 893 #endif // DVB_API_VERSION >=5 894 #endif // USING_DVB 895 896 return ret; 897 } 898 899 int CardUtil::SetDeliverySystem(uint inputid, DTVModulationSystem delsys) 900 { 901 int ret = -1; 902 903 #ifdef USING_DVB 904 #if DVB_API_VERSION >=5 905 QString device = GetVideoDevice(inputid); 906 907 if (device.isEmpty()) 908 return ret; 909 910 QString dvbdev = CardUtil::GetDeviceName(DVB_DEV_FRONTEND, device); 911 QByteArray dev = dvbdev.toLatin1(); 912 int fd_frontend = open(dev.constData(), O_RDWR | O_NONBLOCK); 913 if (fd_frontend < 0) 914 { 915 LOG(VB_GENERAL, LOG_ERR, LOC + 916 QString("open failed (%1)") 917 .arg(dvbdev) + ENO); 918 return errno; 919 } 920 ret = SetDeliverySystem(inputid, delsys, fd_frontend); 921 922 close(fd_frontend); 923 #endif // DVB_API_VERSION >=5 924 #endif // USING_DVB 925 926 return ret; 927 } 928 929 // Get delivery system from the database and write it to the card 930 int CardUtil::SetDeliverySystem(uint inputid, int fd) 931 { 932 int ret = -1; 933 934 #ifdef USING_DVB 935 #if DVB_API_VERSION >=5 936 DTVModulationSystem delsys = GetDeliverySystem(inputid); 937 ret = SetDeliverySystem(inputid, delsys, fd); 938 #endif // DVB_API_VERSION >=5 939 #endif // USING_DVB 940 941 return ret; 942 } 943 944 // Write the delivery system to the card 945 int CardUtil::SetDeliverySystem(uint inputid, DTVModulationSystem delsys, int fd) 946 { 947 int ret = -1; 948 949 #ifdef USING_DVB 950 #if DVB_API_VERSION >=5 951 LOG(VB_GENERAL, LOG_INFO, LOC + QString("[%1] fd:%2 delsys:%3 %4") 952 .arg(inputid).arg(fd).arg(delsys).arg(delsys.toString())); 953 954 struct dtv_property prop; 955 struct dtv_properties cmd; 956 957 memset(&prop, 0, sizeof(prop)); 958 prop.cmd = DTV_DELIVERY_SYSTEM; 959 prop.u.data = delsys; 960 cmd.num = 1; 961 cmd.props = ∝ 962 963 ret = ioctl(fd, FE_SET_PROPERTY, &cmd); 964 if (ret < 0) 965 { 966 LOG(VB_GENERAL, LOG_ERR, LOC + 967 QString("[%1] FE_SET_PROPERTY ioctl failed") 968 .arg(inputid) + ENO); 969 return ret; 970 } 971 #endif // DVB_API_VERSION >=5 972 #endif // USING_DVB 973 974 return ret; 975 } 976 743 977 QString get_on_input(const QString &to_get, uint inputid) 744 978 { 745 979 MSqlQuery query(MSqlQuery::InitCon()); -
mythtv/libs/libmythtv/cardutil.h
diff --git a/mythtv/libs/libmythtv/cardutil.h b/mythtv/libs/libmythtv/cardutil.h index 0eb8b06d13..b66809e076 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 &inputType); 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 805c480c38..69ad81e62c 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 f509d7ddba..ef7dfdae3c 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 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 310ed2ed09..7030f52a58 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 972527e74f..b19938aed1 100644
a b void TransportListEditor::Load() 260 260 type = "(DVB-S)"; 261 261 if (CardUtil::QAM == m_cardtype) 262 262 type = "(DVB-C)"; 263 if (CardUtil::DVBS2 == m_cardtype) 264 type = "(DVB-S2)"; 263 265 264 266 QString txt = QString("%1 %2 %3 %4 %5 %6 %7") 265 267 .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 fc6803a0ca..89f4faf3ee 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);
