Blank screen when switching channels on same transponder with Dpid

Message ID 000001c6bf13$91ac9b90$1400a8c0@enterprise
State New
Headers

Commit Message

Tomas Berglund Aug. 13, 2006, 8:03 p.m. UTC
  Your workaround patch only prevent additional dpids to be set when dolby is disabled. I really would like to switch channels with
dolby enabled. The problem is that those additional pids are never removed....or set to false in SetPid(). 

Is there any other way to add additional pids without setting them with ciHandler->SetPid ? If AddPid() is used to set them, they
would be removed in cDevice::DelPid().

My folloving patch eliminates my problem, but don't work when switching to ch1 or ch2 with dolby as selected track.



Regards,
Tomas Berglund


> -----Ursprungligt meddelande-----
> Från: vdr-bounces@linuxtv.org 
> [mailto:vdr-bounces@linuxtv.org] För Klaus Schmidinger
> Skickat: den 12 augusti 2006 15:06
> Till: vdr@linuxtv.org
> Ämne: Re: [vdr] Blank screen when switching channels onsame 
> transponderwithDpid
> 
> Tomas Berglund wrote:
> > Now I can switch channels with Dpid without problem. The 
> following patch in cDvbDevice::SetChannelDevice fixes it.
> > The PRINTPIDs debug function now show adding and deleting Dpids.
> > 
> > But when I select the Dolby track my kernel panics... 
> Well.. I'm not Klaus ;-) 
> 
> Just tried you patch, and my system also freezed.
> 
> > @@ -849,15 +857,16 @@
> > 
> >    if (TurnOnLivePIDs) {
> >       SetAudioBypass(false);
> > -     if (!(AddPid(Channel->Ppid(), ptPcr) && 
> AddPid(Channel->Vpid(), ptVideo) && AddPid(Channel->Apid(0), 
> ptAudio))) {
> > +     if (!(AddPid(Channel->Ppid(), ptPcr) && 
> AddPid(Channel->Vpid(), ptVideo) && AddPid(Channel->Apid(0), 
> ptAudio) &&
> > AddPid(Channel->Dpid(0), ptDolby))) {
> 
> I guess the basic problem is with your CAM, which probably only
> supports a very limited number of PIDs to decode at the same time.
> 
> There is indeed an unsymmetry in the way VDR handles the additional
> live audio PIDs, which doesn't matter too much if the CAM is powerful
> enough to handle many PIDs. Once you switch to a different transponder
> the problem should be gone, since then all PIDs are cleared 
> in the CAM.
> 
> What I could suggest as a quick workaround is this:
> 
> --- dvbdevice.c 2006/06/11 09:03:55     1.159
> +++ dvbdevice.c 2006/08/12 12:42:12
> @@ -856,7 +856,8 @@
>        //XXX quick workaround for additional live audio PIDs:
>        if (ciHandler) {
>           ciHandler->SetPid(Channel->Apid(1), true);
> -        ciHandler->SetPid(Channel->Dpid(0), true);
> +        if (Setup.UseDolbyDigital)
> +           ciHandler->SetPid(Channel->Dpid(0), true);
>           }
>        if (IsPrimaryDevice())
>           AddPid(Channel->Tpid(), ptTeletext);
> 
> This would at least not set the DPID if you don't use Dolby.
> 
> The change you have suggested above actually sets up a PID
> filter in the DVB device for the DPID, which apparently causes
> trouble when actually trying to switch to live Dolby.
> 
> I can see that this is a bit messy right now, but improving the
> CAM handling is the first thing I'm going to do in version 1.5...
> 
> Klaus
> 
> _______________________________________________
> vdr mailing list
> vdr@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
  

Patch

--- ../vdr-1.4.1-4.untouched/dvbdevice.c        2006-06-11 11:03:55.000000000 +0200
+++ dvbdevice.c 2006-08-13 21:49:41.000000000 +0200
@@ -856,7 +856,13 @@ 
      //XXX quick workaround for additional live audio PIDs:
      if (ciHandler) {
         ciHandler->SetPid(Channel->Apid(1), true);
-        ciHandler->SetPid(Channel->Dpid(0), true);
+        if (Setup.UseDolbyDigital) {              // only set Dpid when dolby is used
+           if (Channel->Dpid(0) == 4614)
+             ciHandler->SetPid(4615, false);      // deactivate channel 2 Dpid before we set Dpid for channel 1
+           if (Channel->Dpid(0) == 4615)
+             ciHandler->SetPid(4614, false);      // deactivate channel 1 Dpid before we set Dpid for channel 2
+          ciHandler->SetPid(Channel->Dpid(0), true);
+           }
         }
      if (IsPrimaryDevice())
         AddPid(Channel->Tpid(), ptTeletext);