Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Driver 0.8.1 and encrypted channels



Ralph Metzler wrote:
> 
> Klaus Schmidinger writes:
>  > I just realized that recording doesn't work an more with today's
>  > CVS driver version. Ralph, have you modified the multiplexing?
>  > If so, I'll have to adjust VDR's frame scanner to cope with the
>  > new muxing.
>  >
>  > Those who use the latest driver should be warned that recording might not
>  > work. I'll see what I can do about that tomorrow.
>  >
> 
> It's not a bug, it's a feature :-)
> 
> No, really, the header information was wrong in the old versions.
> The correction also changes the header length a little but this should
> be no problem if you parse it according to specs.
> If you want details ask/blame Marcus :-)

I have adapted VDR to the new video data muxing of the current CVS
driver version and have attached a patch against VDR's dvbapi.c of
version 0.7. For those who want to try the current CVS driver, please
apply this patch to dvbapi.c from the official VDR version 0.7.

The good news is that as far as I was able to observe there is no more
picture "jumping" - a major improvement! Well done, Marcus&Ralph!

However, recordings taken from the ZDF channel (even with 'cat', so
VDR can be ruled out) show heavy audio dropouts when replayed.
If a ZDF recording taken with the current CVS driver is replayed
with driver 0.8.1 it still shows audio dropouts, although not that
many.
Ralph said in another message:

> Klaus Schmidinger writes:
>  > > Setting a PES filter for the teletext PID and decoding it is no problem
>  > > but displaying it with full teletext color depth (4bit?) on the OSD
>  > > might be.
>  > 
>  > VDR currently uses the OSD in 4bit color mode, and I have found a TT font
>  > that should be usable with the maximum possible resolution the OSD can
>  > provide in that mode.
>  > 
>  > BTW: Thanks, Ralph, for re-enabling the OSD in the resolution used by VDR :-)
> 
> Well, another 20KB less video buffer. 
> Please tell me if you get any problems with playback of files that
> used to work fine before.
 
Maybe we're facing this problem here? If so, would it be possible to
turn off TT insertion during replay and temporarily freeing up these
20KB of memory? I suppose it would be acceptable if TT didn't work
during replay.

Maybe, though, this would still not solve the problem, since the audio
dropouts also occur when replaying with driver 0.8.1, so there might
still be a muxing problem here.

Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________

-- Attached file included as plaintext by Listar --
-- File: dvbapi.c.diff

--- dvbapi.c	2001/01/18 19:53:54	1.50
+++ dvbapi.c	2001/01/27 11:04:55
@@ -821,7 +821,9 @@
 
   int Length = GetPacketLength(Offset);
   if (Length <= Available()) {
-     for (int i = Offset; i < Offset + Length; i++) {
+     int i = Offset + 8; // the minimum length of the video packet header
+     i += Byte(i) + 1;   // possible additional header bytes
+     for (; i < Offset + Length; i++) {
          if (Byte(i) == 0 && Byte(i + 1) == 0 && Byte(i + 2) == 1) {
             switch (Byte(i + 3)) {
               case SC_PICTURE: *PictureType = GetPictureType(i);
@@ -840,8 +842,6 @@
   // Positions to the start of a data block (skipping everything up to
   // an I-frame if not synced) and returns the block length.
 
-  int LastPackHeader = -1;
-
   pictureType = NO_PICTURE;
 
   //XXX remove this once the buffer is handled with two separate threads:
@@ -853,8 +853,6 @@
   for (int i = 0; Available() > MINVIDEODATA && i < MINVIDEODATA; i++) {
       if (Byte(i) == 0 && Byte(i + 1) == 0 && Byte(i + 2) == 1) {
          switch (Byte(i + 3)) {
-           case SC_PHEAD:   LastPackHeader = i;
-                            break;
            case SC_VIDEO:   {
                               int pt = NO_PICTURE;
                               int l = ScanVideoPacket(&pt, i);
@@ -862,21 +860,13 @@
                                  return 0; // no useful data found, wait for more
                               if (pt != NO_PICTURE) {
                                  if (pt < I_FRAME || B_FRAME < pt) {
-                                   esyslog(LOG_ERR, "ERROR: unknown picture type '%d'", pt);
-                                   }
+                                    esyslog(LOG_ERR, "ERROR: unknown picture type '%d'", pt);
+                                    }
                                  else if (pictureType == NO_PICTURE) {
                                     if (!synced) {
-                                       if (LastPackHeader == 0) {
-                                          if (pt == I_FRAME)
-                                             synced = true;
-                                          }
-                                       else if (LastPackHeader > 0) {
-                                          Skip(LastPackHeader);
-                                          LastPackHeader = -1;
-                                          i = 0;
-                                          break;
-                                          }
-                                       else { // LastPackHeader < 0
+                                       if (pt == I_FRAME)
+                                          synced = true;
+                                       else {
                                           Skip(i + l);
                                           i = 0;
                                           break;
@@ -885,13 +875,15 @@
                                     if (synced)
                                        pictureType = pt;
                                     }
-                                 else if (LastPackHeader > 0)
-                                    return LastPackHeader;
                                  else
                                     return i;
                                  }
+                              else if (!synced) {
+                                 Skip(i + l);
+                                 i = 0;
+                                 break;
+                                 }
                               i += l - 1; // -1 to compensate for i++ in the loop!
-                              LastPackHeader = -1;
                             }
                             break;
            case SC_AUDIO:   i += GetPacketLength(i) - 1; // -1 to compensate for i++ in the loop!
@@ -2182,7 +2174,8 @@
         freq -= Setup.LnbFrequLo;
      else
         freq -= Setup.LnbFrequHi;
-     front.pnr       = 0;
+     front.channel_flags = Ca ? DVB_CHANNEL_CA : DVB_CHANNEL_FTA;
+     front.pnr       = Pnr;
      front.freq      = freq * 1000000UL;
      front.diseqc    = Diseqc;
      front.srate     = Srate * 1000;
@@ -2198,7 +2191,7 @@
         currentChannel = ChannelNumber;
         // If this DVB card can't receive this channel, let's see if we can
         // use the card that actually can receive it and transfer data from there:
-        if (Ca && Ca != Index() + 1) {
+        if (this == PrimaryDvbApi && Ca && Ca != Index() + 1) {
            cDvbApi *CaDvbApi = GetDvbApi(Ca, 0);
            if (CaDvbApi) {
               if (!CaDvbApi->Recording()) {
@@ -2403,7 +2396,7 @@
 {
   lastScan = lastActivity = time(NULL);
   currentChannel = 0;
-  lastChannel = 1;
+  lastChannel = 0;
 }
 
 void cEITScanner::Activity(void)



--- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index