diff -Naur mythtv-0.26-20120823-g6566c3c-old/mythtv/libs/libmythtv/diseqc.cpp mythtv-0.26-20120823-g6566c3c-new/mythtv/libs/libmythtv/diseqc.cpp
old
|
new
|
|
87 | 87 | |
88 | 88 | #define LOC QString("DiSEqCDevTree: ") |
89 | 89 | |
| 90 | bool diseqc_bus_already_reset = false; |
| 91 | |
90 | 92 | QString DiSEqCDevDevice::TableToString(uint type, const TypeTable *table) |
91 | 93 | { |
92 | 94 | for (; !table->name.isEmpty(); table++) |
… |
… |
|
709 | 711 | * \param hard_reset If true, the bus will be power cycled. |
710 | 712 | * \return True if successful. |
711 | 713 | */ |
712 | | bool DiSEqCDevTree::ResetDiseqc(bool hard_reset) |
| 714 | bool DiSEqCDevTree::ResetDiseqc(bool hard_reset, bool is_SCR) |
713 | 715 | { |
714 | 716 | Reset(); |
715 | 717 | |
… |
… |
|
721 | 723 | |
722 | 724 | SetVoltage(SEC_VOLTAGE_OFF); |
723 | 725 | usleep(DISEQC_POWER_OFF_WAIT); |
| 726 | diseqc_bus_already_reset = false; |
724 | 727 | } |
725 | 728 | |
726 | | // make sure the bus is powered |
727 | | SetVoltage(SEC_VOLTAGE_18); |
728 | | usleep(DISEQC_POWER_ON_WAIT); |
729 | | // some DiSEqC devices need more time. see #8465 |
730 | | usleep(DISEQC_POWER_ON_WAIT); |
731 | | |
732 | | // issue a global reset command |
733 | | LOG(VB_CHANNEL, LOG_INFO, LOC + "Resetting DiSEqC Bus"); |
734 | | if (!SendCommand(DISEQC_ADR_ALL, DISEQC_CMD_RESET)) |
| 729 | if (!diseqc_bus_already_reset || !is_SCR) |
735 | 730 | { |
736 | | LOG(VB_GENERAL, LOG_ERR, LOC + "DiSEqC reset failed" + ENO); |
737 | | return false; |
| 731 | // make sure the bus is powered |
| 732 | SetVoltage(SEC_VOLTAGE_18); |
| 733 | usleep(DISEQC_POWER_ON_WAIT); |
| 734 | // some DiSEqC devices need more time. see #8465 |
| 735 | usleep(DISEQC_POWER_ON_WAIT); |
| 736 | |
| 737 | // issue a global reset command |
| 738 | LOG(VB_CHANNEL, LOG_INFO, LOC + "Resetting DiSEqC Bus"); |
| 739 | if (!SendCommand(DISEQC_ADR_ALL, DISEQC_CMD_RESET)) |
| 740 | { |
| 741 | LOG(VB_GENERAL, LOG_ERR, LOC + "DiSEqC reset failed" + ENO); |
| 742 | return false; |
| 743 | } |
| 744 | |
| 745 | if (is_SCR) |
| 746 | diseqc_bus_already_reset = true; |
| 747 | } |
| 748 | else |
| 749 | { |
| 750 | LOG(VB_CHANNEL, LOG_INFO, LOC + "Skiping reset: already done for this SCR bus"); |
738 | 751 | } |
739 | 752 | |
740 | 753 | usleep(DISEQC_LONG_WAIT); |
… |
… |
|
742 | 755 | return true; |
743 | 756 | } |
744 | 757 | |
745 | | void DiSEqCDevTree::Open(int fd_frontend) |
| 758 | void DiSEqCDevTree::Open(int fd_frontend, bool is_SCR) |
746 | 759 | { |
747 | 760 | m_fd_frontend = fd_frontend; |
748 | 761 | |
749 | 762 | // issue reset command |
750 | | ResetDiseqc(false /* do a soft reset */); |
| 763 | ResetDiseqc(false, is_SCR); |
751 | 764 | } |
752 | 765 | |
753 | 766 | bool DiSEqCDevTree::SetVoltage(uint voltage) |
diff -Naur mythtv-0.26-20120823-g6566c3c-old/mythtv/libs/libmythtv/diseqc.h mythtv-0.26-20120823-g6566c3c-new/mythtv/libs/libmythtv/diseqc.h
old
|
new
|
|
96 | 96 | bool SendCommand(uint adr, uint cmd, uint repeats = 0, |
97 | 97 | uint data_len = 0, unsigned char *data = NULL); |
98 | 98 | |
99 | | bool ResetDiseqc(bool hard_reset); |
| 99 | bool ResetDiseqc(bool hard_reset, bool is_SCR); |
100 | 100 | |
101 | 101 | // frontend fd |
102 | | void Open(int fd_frontend); |
| 102 | void Open(int fd_frontend, bool is_SCR); |
103 | 103 | void Close(void) { m_fd_frontend = -1; } |
104 | 104 | int GetFD(void) const { return m_fd_frontend; } |
105 | 105 | |
diff -Naur mythtv-0.26-20120823-g6566c3c-old/mythtv/libs/libmythtv/dvbchannel.cpp mythtv-0.26-20120823-g6566c3c-new/mythtv/libs/libmythtv/dvbchannel.cpp
old
|
new
|
|
267 | 267 | // Turn on the power to the LNB |
268 | 268 | if (tunerType.IsDiSEqCSupported()) |
269 | 269 | { |
| 270 | |
270 | 271 | diseqc_tree = diseqc_dev.FindTree(GetCardID()); |
271 | 272 | if (diseqc_tree) |
272 | | diseqc_tree->Open(fd_frontend); |
| 273 | { |
| 274 | bool is_SCR = false; |
| 275 | |
| 276 | DiSEqCDevSCR *scr = diseqc_tree->FindSCR(diseqc_settings); |
| 277 | if (scr) |
| 278 | { |
| 279 | is_SCR = true; |
| 280 | LOG(VB_CHANNEL, LOG_INFO, LOC + "Requested DVB channel is on SCR system"); |
| 281 | } |
| 282 | else |
| 283 | LOG(VB_CHANNEL, LOG_INFO, LOC + "Requested DVB channel is on non-SCR system"); |
| 284 | |
| 285 | diseqc_tree->Open(fd_frontend, is_SCR); |
| 286 | } |
273 | 287 | } |
274 | 288 | |
275 | 289 | dvbcam->Start(); |