Automatically Tune to Strongest Duplicate Channel (1 Viewer)

vapourEyes

Portal Pro
July 31, 2013
144
43
Home Country
United Kingdom United Kingdom
At this point in the code, we could compare signal strength

I'd need to do something like below.

C#:
            if (currentDetail == null)
            {
              //add new channel
              exists = false;
              dbChannel = layer.AddNewChannel(channel.Name, channel.LogicalChannelNumber);
              dbChannel.SortOrder = 10000;
              if (channel.LogicalChannelNumber >= 1)
              {
                dbChannel.SortOrder = channel.LogicalChannelNumber;
              }
              dbChannel.IsTv = channel.IsTv;
              dbChannel.IsRadio = channel.IsRadio;
              dbChannel.Persist();
            }
            else
            {
              exists = true;
              //dbChannel = currentDetail.ReferencedChannel();
              if (signalStrength > dbChannel.signalStrength) // psuedo code
              {
                // add stronger channel // psuedo code
              }
            }

I am not sure where to get the signal strength for use at this point ?

curTuning.BandWidth ?
 
Last edited:

vapourEyes

Portal Pro
July 31, 2013
144
43
Home Country
United Kingdom United Kingdom
I seem to have a crude solution to test now.

A channel will over-write existing if and only if its signal strength surpasses a threshold:

C#:
              exists = true;
              dbChannel = null;

             if (RemoteControl.Instance.SignalLevel(_cardNumber) >= 40)
              {
                // add new strong channel
                dbChannel = layer.AddNewChannel(channel.Name, channel.LogicalChannelNumber);
              } else
              {
                dbChannel = currentDetail.ReferencedChannel();
              }

Just testing it now.
 
Last edited:

CyberSimian

Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    A channel will over-write existing if and only if its signal strength surpasses a threshold:
    I am not sure that a fixed threshhold is the right solution. :confused:

    The signal strength provided by tuner cards is an arbitrary number, and differs from one manufacturer to another (and quite possibly from one tuner-card model to another from the same manufacturer).

    I have one TBS card in my system, and one Pinnacle card. These cards return different signal strengths for the same MUX.

    During a scan, comparing signal strengths for different MUXes seems reasonable (since it does not matter what the signal strength value actually represents), but comparing the signal strength to a fixed value (or comparing the signal strength from one card with the signal strength from another card) does not seem like the right solution.

    -- from CyberSimian in the UK
     

    vapourEyes

    Portal Pro
    July 31, 2013
    144
    43
    Home Country
    United Kingdom United Kingdom
    I am not sure that a fixed threshhold is the right solution. :confused:

    The signal strength provided by tuner cards is an arbitrary number, and differs from one manufacturer to another (and quite possibly from one tuner-card model to another from the same manufacturer).

    I have one TBS card in my system, and one Pinnacle card. These cards return different signal strengths for the same MUX.
    That then means that this method is fundamentally flawed.
    I'm unsure of a solution that would work in that case.
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    That then means that this method is fundamentally flawed. I'm unsure of a solution that would work in that case.
    Most people perform a single scan that scans all of the MUXes defined in the tuning-parameters file. This of course uses the same tuner card for all of the MUXes in that scan.

    To select the strongest MUX where multiple are received for the same channel group (e.g. the "BBC1 SD" MUX), you would need to remember the signal strength received for each MUX during the scan, so that when you encountered a later MUX that duplicated an earlier MUX (e.g. a second "BBC1 SD" MUX), you would have available the signal strength for that earlier MUX, and be able to compare it with the signal strength for the later MUX. That comparison would allow you to decide which of those two MUXes to retain, and which to discard.

    The signal strength for each MUX needs to be retained only during the scan -- it is not meaningful to retain it long term, so there is no need to store it in the tuning database.

    Sadly, MP1 has too few active developers, and I don't want to discourage you if you would like to get involved in MP development. Also, most developers work on the features that they themselves want to use. (If I ever get involved in development, this is how I would decide what to work on.) However, I am not sure that implementing a "Pick strongest" option in "TV Server" provides the "best bang for the buck". :unsure:

    -- from CyberSimian in the UK
     

    vapourEyes

    Portal Pro
    July 31, 2013
    144
    43
    Home Country
    United Kingdom United Kingdom
    Thanks @CyberSimian ,

    I was indeed looking for per channel signal strength.
    I could use a ratio of current channel strength against max seen strength to use in a comparitor.
    I don't think its massive work to set a per channel sig strength with a maximum stored during tuning.

    This information then feeds the comparitor to decide which channel 'makes it' into the mapping section.

    If I find the time I may pick away at it, and update as I go for correct guidance.

    *** with the proviso that help may be in short supply as MP2 has focus.
     

    framug

    Super Moderator
  • Team MediaPortal
  • January 31, 2005
    5,884
    1,956
    South of France
    Home Country
    France France
    Hello,
    Oh, what memories !

    C#:
            if (_card.IsTunerLocked || _card.SignalLevel > 0 || _card.SignalQuality > 0)


    I was indeed looking for per channel signal strength.

    If you want to do that, I think you need to have a "card(s)/per channel signal strength".
    As CyberSimian explained, signals are differents depending on manufacturer/card(s).
    This will avoid problem if sometimes, you don't do the scan with the same card than before (case where you have more than one card in your computer).

    I could use a ratio of current channel strength against max seen strength to use in a comparitor.

    Don't forget that signal are fluctuating (ie : 1 time you will have a 66 value, for example, 10 minutes after, you could have a value of 75 for the same channel.

    B.R.
     

    vapourEyes

    Portal Pro
    July 31, 2013
    144
    43
    Home Country
    United Kingdom United Kingdom
    This is beginning to look like a can of worms.

    I have noticed that signals below about 30 (of whatever unit it is) dont render too well, hence setting an artificial limit may help to keep the strongest.
    I think, based on your input @framug and @CyberSimian this concept is possibly very tricky to complete properly and ultimately flawed, for the technical reasons outlined.

    The crude approximation I used above has tested out well though.
    I wiped all channels and brought them in from a scan all, then scan to my strongest 2. With the order that I do this now not so important.
    Which means I can tune using any number of cards, simultaneously for a good set of strong channels.

    It may be time to leave this for now and not consume anyone else's time.
     

    Users who are viewing this thread

    Top Bottom