Automatically Tune to Strongest Duplicate Channel (1 Viewer)

vapourEyes

Portal Pro
July 31, 2013
142
43
United Kingdom United Kingdom
Country flag
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
142
43
United Kingdom United Kingdom
Country flag
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,025
    1,260
    Southampton
    United Kingdom United Kingdom
    Country flag
    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
    142
    43
    United Kingdom United Kingdom
    Country flag
    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,025
    1,260
    Southampton
    United Kingdom United Kingdom
    Country flag
    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
    142
    43
    United Kingdom United Kingdom
    Country flag
    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
    4,539
    549
    South of France
    France France
    Country flag
    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
    142
    43
    United Kingdom United Kingdom
    Country flag
    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 (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    vapourEyes Automatically Re-Tune Periodically Improvement Suggestions 1
    S TV-Server MP1 - Automatic search doesn't work Installation, configuration support 2
    W [solved] [FIXED] Survivor season 40 not automatically matching My TVSeries 1
    G Switch to new channel at begining of program automatically Feature Requests 0
    C How do I get MediaPortal to separate recording files by channel and month? General 2
    H MP1.21F video database scan, can it be scheduled to automatically run in background General Support 5
    Steve.Rayner61 Online Videos - Automatic Updates fails 'Automatic update disabled. Check your internet connection' OnlineVideos 10
    greybox 1.20 final does not update video duration automatically 1.20 10
    greybox 1.20 final does not update video duration automatically 1.20 Pre Release 1
    M TV Server can't tune to some DVB-S multiplexes while other software can General 0
    bribbon [Pending] DVB-C Tuning Parameters: Switzerland.UPC Cablecom [NID 43020] v.7.xml Submit: EPG-Grabbers and tuningdetails 0
    J DVB-S2 card fails to tune? Subchannel count increasing Television (MyTV frontend and TV-Server) 3
    M Tuning channels with quad tuner question General 6
    E [solved] Vodafone Kabel dvb-c Braunschweig Tuning Liste (Stand 31.01.2019) TV / Streaming 0
    A VB-IP SPAIN Movistar plus tunning details (Update 26 dec 2018) Submit: EPG-Grabbers and tuningdetails 1
    M Wrong DVB-T tuning parameters for Sweden, Vannas - Granlundsberget 1.20 Pre Release 1
    U Client cannot tune channels General 1
    Charlie TV [solved] Channels disappeared after transmitter changes (Midhurst) General Support 4
    Top Bottom