682 | | // send DVB-S setup |
683 | | if (diseqc_tree) |
684 | | { |
685 | | // configure for new input |
686 | | if (!same_input) |
687 | | diseqc_settings.Load(inputid); |
688 | | |
689 | | // execute diseqc commands |
690 | | if (!diseqc_tree->Execute(diseqc_settings, tuning)) |
691 | | { |
692 | | LOG(VB_GENERAL, LOG_ERR, LOC + |
693 | | "Tune(): Failed to setup DiSEqC devices"); |
694 | | return false; |
695 | | } |
696 | | |
697 | | // retrieve actual intermediate frequency |
698 | | DiSEqCDevLNB *lnb = diseqc_tree->FindLNB(diseqc_settings); |
699 | | if (!lnb) |
700 | | { |
701 | | LOG(VB_GENERAL, LOG_ERR, LOC + |
702 | | "Tune(): No LNB for this configuration"); |
703 | | return false; |
704 | | } |
705 | | |
706 | | if (lnb->GetDeviceID() != last_lnb_dev_id) |
707 | | { |
708 | | last_lnb_dev_id = lnb->GetDeviceID(); |
709 | | // make sure we tune to frequency, if the lnb has changed |
710 | | reset = first_tune = true; |
711 | | } |
712 | | |
713 | | intermediate_freq = lnb->GetIntermediateFrequency( |
714 | | diseqc_settings, tuning); |
715 | | |
716 | | // retrieve scr intermediate frequency |
717 | | DiSEqCDevSCR *scr = diseqc_tree->FindSCR(diseqc_settings); |
718 | | if (lnb && scr) |
719 | | { |
720 | | intermediate_freq = scr->GetIntermediateFrequency(intermediate_freq); |
721 | | } |
722 | | |
723 | | // if card can auto-FEC, use it -- sometimes NITs are inaccurate |
724 | | if (capabilities & FE_CAN_FEC_AUTO) |
725 | | can_fec_auto = true; |
726 | | |
727 | | // Check DVB-S intermediate frequency here since it requires a fully |
728 | | // initialized diseqc tree |
729 | | CheckFrequency(intermediate_freq); |
730 | | } |
731 | | |
732 | | LOG(VB_CHANNEL, LOG_INFO, LOC + "Old Params: " + prev_tuning.toString() + |
733 | | "\n\t\t\t" + LOC + "New Params: " + tuning.toString()); |
| 682 | LOG(VB_CHANNEL, LOG_INFO, LOC + "\nOld Params: " + prev_tuning.toString() + |
| 683 | "\nNew Params: " + tuning.toString()); |
| 697 | // send DVB-S setup |
| 698 | if (diseqc_tree) |
| 699 | { |
| 700 | // configure for new input |
| 701 | if (!same_input) |
| 702 | diseqc_settings.Load(inputid); |
| 703 | |
| 704 | // execute diseqc commands |
| 705 | if (!diseqc_tree->Execute(diseqc_settings, tuning)) |
| 706 | { |
| 707 | LOG(VB_GENERAL, LOG_ERR, LOC + |
| 708 | "Tune(): Failed to setup DiSEqC devices"); |
| 709 | return false; |
| 710 | } |
| 711 | |
| 712 | // retrieve actual intermediate frequency |
| 713 | DiSEqCDevLNB *lnb = diseqc_tree->FindLNB(diseqc_settings); |
| 714 | if (!lnb) |
| 715 | { |
| 716 | LOG(VB_GENERAL, LOG_ERR, LOC + |
| 717 | "Tune(): No LNB for this configuration"); |
| 718 | return false; |
| 719 | } |
| 720 | |
| 721 | if (lnb->GetDeviceID() != last_lnb_dev_id) |
| 722 | { |
| 723 | last_lnb_dev_id = lnb->GetDeviceID(); |
| 724 | // make sure we tune to frequency, if the lnb has changed |
| 725 | reset = first_tune = true; |
| 726 | } |
| 727 | |
| 728 | intermediate_freq = lnb->GetIntermediateFrequency( |
| 729 | diseqc_settings, tuning); |
| 730 | |
| 731 | // retrieve scr intermediate frequency |
| 732 | DiSEqCDevSCR *scr = diseqc_tree->FindSCR(diseqc_settings); |
| 733 | if (lnb && scr) |
| 734 | { |
| 735 | intermediate_freq = scr->GetIntermediateFrequency(intermediate_freq); |
| 736 | } |
| 737 | |
| 738 | // if card can auto-FEC, use it -- sometimes NITs are inaccurate |
| 739 | if (capabilities & FE_CAN_FEC_AUTO) |
| 740 | can_fec_auto = true; |
| 741 | |
| 742 | // Check DVB-S intermediate frequency here since it requires a fully |
| 743 | // initialized diseqc tree |
| 744 | CheckFrequency(intermediate_freq); |
| 745 | } |
| 746 | |