minisatip icon indicating copy to clipboard operation
minisatip copied to clipboard

Slave adapters: "phantom power" adapter state

Open lars18th opened this issue 4 years ago • 1 comments

Hi @catalinii ,

Regarding the problems with Master-Slave tuners, partially fixed with the PR #830, I open a new issue to discuss about how to handle the pending problem.

First I describe the concrete problem:

  • When using slave tuners without power, if the master tuner goes off, then the slave tuner will not receive any data as the LNB has no power.

To address this concrete case, I suggest this idea:

  • First, in the command line parameters we need to enhance the -S --slave parameter to indicate if the slave adapter has no power. This could be implemented with this syntax: -S 2-4:0;5-7:1*. In this case tuners 2, 3 and 4 are slave of tuner 0 but they can power the LNB; however the tuners 5, 6 and 7 are slaves with no power of the tuner 1. So the tuner 1 is identified as "master power" tuner.
  • The second part is to implement inside the adapter abstraction a new status, called "phantom". In this state the adapter is idle, in the sense of inactive. But it continues to power the LNB. This new state is relevant as we can use it to drive master power tuners. The implementation requires to be concrete based on the real tuner. For example, for internal DVB tuners will be sufficient to leave the device open. But for SAT>IP devices it will be necessary to change from PLAY state (the previous state before the TEARDOWN) to PLAY with pids=0 (instead of the TEARDOWN), maintaining the same frequency and modulation. And for other tuners another particular implementation could be necessary. Take note that different types of tuners can be mixed inside a master-slave pairing. For example, one internal tuner can be the "master power" of three SAT>IP slaves with no power. So the new status requires to be handled at the adapter level.
  • Then, when a master tuner becomes free it will enter in the phantom state... until all slave tuners will become free. Futhermore, the master tuner could be selected when searching for free tuners, as it is really not used.
  • Finally, it only rests to enable the phatom state with master power tuners. In any other case, this intermediate state will not be in use. For this reason the command line parameter requires to identify the master power adapters. Because this enhanced logic has no sense with slave tuners that can provide the LNB power.

What you think about this strategy? Regards.

lars18th avatar Apr 17 '21 17:04 lars18th

Hi @catalinii ,

I feel I can implement in this way using the current vars rtsp_socket_closed, keep_adapter_open and can_keep_adapter_open inside the satipc module with small changes. However, I need to be sure if you agree with my proposal.

If you agree then please respond to this question:

  • If I'll close the RTSP socket in the satipc module, the upper layers (stream and adapter) will notice the difference, or they continue reading? I'll see any side effect with the socketworks loop? What I want to overcome is the select call that reads 0 length and closes the adapter.

I look forward to your reply. Regards.

lars18th avatar Apr 26 '21 09:04 lars18th