Channel switching bug (logical error ?) | Page 2

Discussion in '1.0 final and SVN Builds' started by Al_Capone, January 31, 2009.

  1. tanstaafl

    tanstaafl Portal Member

    Joined:
    December 19, 2007
    Messages:
    13
    Likes Received:
    0
    Occupation:
    Computational Linguist (unemployed)
    Location:
    Uppsala
    Ratings:
    +0 / 0
    Home Country:
    Sweden Sweden
    Al_Capone,
    you're describing the problem just fine.
    Problem is, neither Ronilse nor Flokel can reproduce. That makes logs from your end important. Maybe there's something quirky at your end, and maybe your logs can identify what it is. So post your logs! =)


     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Al_Capone
    • Premium Supporter

    Al_Capone MP Donator

    Joined:
    September 26, 2006
    Messages:
    527
    Likes Received:
    13
    Gender:
    Male
    Ratings:
    +19 / 1
    Home Country:
    Norway Norway
    Show System Specs
    WOW.
    one major mistake by me ! (i just reproduced it again)
    it is not "select channel1" and press next channel 2 times per second.

    it is not "select channel1" and press next channel 2 times per second like 15 times !
    you will see channels change , until you suddenly get no info, and then Radio comes on.

    the following logs are produced like this:
    1.- I emptied both log-directories.
    2.- started mediaportal "channel1" was selected.
    3- *fullscreen selected.*
    4.- I pressed "ch+" like ~10 times
    5.- I ended up at a radio station.


    Please try this new way to reproduce yourself, select channel1 , then press (two presses per second) for "previous" channel as many times as you need, pretend that you are trying to browse around your whole channel list.
     
  4. tanstaafl

    tanstaafl Portal Member

    Joined:
    December 19, 2007
    Messages:
    13
    Likes Received:
    0
    Occupation:
    Computational Linguist (unemployed)
    Location:
    Uppsala
    Ratings:
    +0 / 0
    Home Country:
    Sweden Sweden
    Just having a quick look at the code.
    Shouldn't TvPlugin.TvHome.ZapToNextChannel's else-clause be setting local variable currentChan to m_zapChannel like in ZapToPreviousChannel?

    Minor issue, seems it's only used locally to write to log.

    Code (Text):
    1.  
    2.  /// <summary>
    3.     /// Changes to the next channel in the current group.
    4.     /// </summary>
    5.     /// <param name="useZapDelay">If true, the configured zap delay is used. Otherwise it zaps immediately.</param>
    6.     public void ZapToNextChannel(bool useZapDelay)
    7.     {
    8.       Channel currentChan = null;
    9.       int currindex;
    10.       if (m_zapchannel == null)
    11.       {
    12.         currindex = GetChannelIndex(Channel);
    13.         currentChan = Channel;
    14.       }
    15.       else
    16.       {
    17.         currindex = GetChannelIndex(m_zapchannel); // Zap from last zap channel
    18. //***********************************************************************        
    19. currentChan = Channel;   // TANSTAAFL: HERE, compare to below
    20. //***********************************************************************
    21.       }
    22.       GroupMap gm;
    23.       Channel chan;
    24.       //check if channel is visible
    25.       //if not find next visible
    26.       do
    27.       {
    28.         // Step to next channel
    29.         currindex++;
    30.         if (currindex >= CurrentGroup.ReferringGroupMap().Count)
    31.         {
    32.           currindex = 0;
    33.         }
    34.         gm = (GroupMap) CurrentGroup.ReferringGroupMap()[currindex];
    35.         chan = (Channel) gm.ReferencedChannel();
    36.       } while (!chan.VisibleInGuide);
    37.  
    38.       TVHome.UserChannelChanged = true;
    39.       m_zapchannel = chan;
    40.       Log.Info("Navigator:ZapNext {0}->{1}", currentChan.DisplayName, m_zapchannel.DisplayName);
    41.       if (GUIWindowManager.ActiveWindow == (int) (int) GUIWindow.Window.WINDOW_TVFULLSCREEN)
    42.       {
    43.         if (useZapDelay)
    44.         {
    45.           m_zaptime = DateTime.Now.AddMilliseconds(m_zapdelay);
    46.         }
    47.         else
    48.         {
    49.           m_zaptime = DateTime.Now;
    50.         }
    51.       }
    52.       else
    53.       {
    54.         m_zaptime = DateTime.Now;
    55.       }
    56.     }
    57.  
    58.     /// <summary>
    59.     /// Changes to the previous channel in the current group.
    60.     /// </summary>
    61.     /// <param name="useZapDelay">If true, the configured zap delay is used. Otherwise it zaps immediately.</param>
    62.     public void ZapToPreviousChannel(bool useZapDelay)
    63.     {
    64.       Channel currentChan = null;
    65.       int currindex;
    66.       if (m_zapchannel == null)
    67.       {
    68.         currentChan = Channel;
    69.         currindex = GetChannelIndex(Channel);
    70.       }
    71.       else
    72.       {
    73. //***************************************************************
    74.         currentChan = m_zapchannel; // <--- TANSTAAFL: and HERE
    75. //***************************************************************
    76.         currindex = GetChannelIndex(m_zapchannel); // Zap from last zap channel
    77.       }
    78.       GroupMap gm;
    79.       Channel chan;
    80.       //check if channel is visible
    81.       //if not find next visible
    82.       do
    83.       {
    84.         // Step to prev channel
    85.         currindex--;
    86.         if (currindex < 0)
    87.         {
    88.           currindex = CurrentGroup.ReferringGroupMap().Count - 1;
    89.         }
    90.         gm = (GroupMap) CurrentGroup.ReferringGroupMap()[currindex];
    91.         chan = (Channel) gm.ReferencedChannel();
    92.       } while (!chan.VisibleInGuide);
    93.  
    94.       TVHome.UserChannelChanged = true;
    95.       m_zapchannel = chan;
    96.       Log.Info("Navigator:ZapPrevious {0}->{1}",
    97.                currentChan.DisplayName, m_zapchannel.DisplayName);
    98.       if (GUIWindowManager.ActiveWindow == (int) (int) GUIWindow.Window.WINDOW_TVFULLSCREEN)
    99.       {
    100.         if (useZapDelay)
    101.         {
    102.           m_zaptime = DateTime.Now.AddMilliseconds(m_zapdelay);
    103.         }
    104.         else
    105.         {
    106.           m_zaptime = DateTime.Now;
    107.         }
    108.       }
    109.       else
    110.       {
    111.         m_zaptime = DateTime.Now;
    112.       }
    113.     }
    114.  
    115.  
     
  5. x4mer
    • Premium Supporter

    x4mer MP Donator

    Joined:
    November 8, 2007
    Messages:
    306
    Likes Received:
    24
    Gender:
    Male
    Occupation:
    Service Tech
    Location:
    Toronto
    Ratings:
    +24 / 0
    Home Country:
    Canada Canada
    Show System Specs
    Al_Capone

    Just tried to reproduce this with RTSP on & off, & could not reproduce the problem. I have no radio stations scanned in on TV server though.

    Do you have channels listed in TV server above the channel at the top of your guide?

    I think the channel up/down will include these channels in the cycle, even if you have them unchecked. If some of them are radio channels, that incorrectly are set as TV by your provider, then that could explain the problem you're having. If this is the case, use SQL management studio to change the type on these channels to radio, & they won't be part of the TV section at all anymore, they'll move to the radio section.
     
  6. Al_Capone
    • Premium Supporter

    Al_Capone MP Donator

    Joined:
    September 26, 2006
    Messages:
    527
    Likes Received:
    13
    Gender:
    Male
    Ratings:
    +19 / 1
    Home Country:
    Norway Norway
    Show System Specs
    Thanks for trying to reproduce,
    no Tvchannels does not contain radio channels, (I've attached my channel-list)
    I guess the logs at least confirm that this does, in fact, happens ,so you do not think I am crazy ? :)

    (attached my channel export)
     

    Attached Files:

    • export.xml
      File size:
      30.6 KB
      Uploaded:
      February 23, 2009
      Views:
      105
  7. x4mer
    • Premium Supporter

    x4mer MP Donator

    Joined:
    November 8, 2007
    Messages:
    306
    Likes Received:
    24
    Gender:
    Male
    Occupation:
    Service Tech
    Location:
    Toronto
    Ratings:
    +24 / 0
    Home Country:
    Canada Canada
    Show System Specs
    The first 1/3 of your channel list are radio stations. Your Telenor channel group contains many radio stations, & the bottom of your telenor group has


    <map ChannelName="Radio1 Rock" SortOrder="10000" />
    <map ChannelName="Veronika" SortOrder="10000" />
    <map ChannelName="Radio Mila" SortOrder="10000" />
    <map ChannelName="Scandinavia Sat. R" SortOrder="10000" />
    <map ChannelName="Radio One" SortOrder="10000" />
    <map ChannelName="Radio 10" SortOrder="10000" />
    <map ChannelName="Radio NOROC" SortOrder="10000" />
    <map ChannelName="NRK Alltid Folkemusikk" SortOrder="10000" />
    <map ChannelName="NRK Alltid Klassisk" SortOrder="10000" />
    <map ChannelName="NRK Alltid Nyheter" SortOrder="10000" />
    <map ChannelName="YLE Puhe" SortOrder="10000" />


    Looking at your MP log, your channel flipping was fine till you reached Star! as seen here2009-02-20

    23:06:17.227483 [Debug][MPMain]: ZapNextChannel()
    2009-02-20 23:06:17.267541 [Info.][MPMain]: Navigator:ZapNext NRK1->VH1
    2009-02-20 23:06:17.267541 [Debug][MPMain]: UpdateOSD()
    2009-02-20 23:06:17.577987 [Info.][MPMain]: TVHome:OnNextChannel()
    2009-02-20 23:06:17.577987 [Debug][MPMain]: ZapNextChannel()
    2009-02-20 23:06:17.618045 [Info.][MPMain]: Navigator:ZapNext NRK1->VH1 Classic
    2009-02-20 23:06:17.618045 [Debug][MPMain]: UpdateOSD()
    2009-02-20 23:06:17.878419 [Info.][MPMain]: TVHome:OnNextChannel()
    2009-02-20 23:06:17.878419 [Debug][MPMain]: ZapNextChannel()
    2009-02-20 23:06:17.918477 [Info.][MPMain]: Navigator:ZapNext NRK1->Star!
    2009-02-20 23:06:17.918477 [Debug][MPMain]: UpdateOSD()
    2009-02-20 23:06:18.238937 [Info.][MPMain]: TVHome:OnNextChannel()
    2009-02-20 23:06:18.238937 [Debug][MPMain]: ZapNextChannel()
    2009-02-20 23:06:18.289009 [Info.][MPMain]: Navigator:ZapNext NRK1->KISS
    2009-02-20 23:06:18.289009 [Debug][MPMain]: UpdateOSD()
    2009-02-20 23:06:18.399168 [Info.][MPMain]: Exception :confused:ystem.NullReferenceException: Object reference not set to an instance of an object.
    at TvPlugin.TvZapOsd.ShowPrograms()




    The one following Star in the list (KISS) is a radio station according to your channel list. From that point on in your channel list, there are TV & Radio stations sharing the same sort order as seen here



    <map ChannelName="History Channel" SortOrder="21" />
    <map ChannelName="Hallmark" SortOrder="22" />
    <map ChannelName="MTV" SortOrder="23" />
    <map ChannelName="VH1" SortOrder="24" />
    <map ChannelName="VH1 Classic" SortOrder="25" />
    <map ChannelName="Star!" SortOrder="26" />
    <map ChannelName="KISS" SortOrder="26" />
    <map ChannelName="Alpha Radio" SortOrder="27" />
    <map ChannelName="Eurosport" SortOrder="27" />
    <map ChannelName="Eurosport 2" SortOrder="28" />
    <map ChannelName="Radio Norge" SortOrder="28" />
    <map ChannelName="Radio Paris Oslo" SortOrder="29" />
    <map ChannelName="Disney Channel" SortOrder="29" />
    <map ChannelName="Toon Disney" SortOrder="30" />
    <map ChannelName="EXPRES Bratislava" SortOrder="30" />
     
    • Like Like x 1
  8. Al_Capone
    • Premium Supporter

    Al_Capone MP Donator

    Joined:
    September 26, 2006
    Messages:
    527
    Likes Received:
    13
    Gender:
    Male
    Ratings:
    +19 / 1
    Home Country:
    Norway Norway
    Show System Specs
    Thank you - sounds strange, I did not even knew that a television list could contain radio channels.
    Will check it out soon, and test/confirm/fix.
     
  9. Al_Capone
    • Premium Supporter

    Al_Capone MP Donator

    Joined:
    September 26, 2006
    Messages:
    527
    Likes Received:
    13
    Gender:
    Male
    Ratings:
    +19 / 1
    Home Country:
    Norway Norway
    Show System Specs
    Yes. My export file lists channels that are not displayed in "TV server configuration"

    both "All channels" and "telenor" sortorder lists contains radio channels.
    I removed all radio-channels from sortorder-lists - doing so solved the problem.

    should any tuning-info for radio stations be in this list ?
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!