Mailing List archive

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

[vdr] Re: DVD and AC3, it works perfectly!!!



On Wed, Sep 03, 2003 at 01:36:39PM +0200, Gregoire Favre wrote:
> On Wed, Sep 03, 2003 at 01:27:53PM +0200, Dr. Werner Fink wrote:
> 
> > About which patch do you speaking?  The bitstreamout 0.46e plugin
> > is a test version I've given away (hey you're the first feedback).
> > If you're say it works as it should then I'll put it to the
> > official bitstreamout site on sourceforge.
> 
> I am speaking about the patch (which is the same for quiete a lots of
> "released" (or not) bitstreamout for vdr-1.2.1 (audio diff I think...).
> Withtout the patch, I can hear "normal" sound, and then going to for
> example Pro7, it works very well (same if I play a DVD) but I can't get
> back to channel without AC3: no more sound, and my amplifier stay on DD.

You're talking about vdr-1.2.1-audio.dif ... the patch which
includes the `eit-busy-do-not-wait' change?  It also includes
some compiler optimizations (-funroll-loop and the architecture
switches of the used kernel).

Hmmm ... interesting.

> There are quiete a lot of positive feedback (on vdrportal) ;-)
> 
> I would really appreciate your comment on the including patch for VDR:
> could it be included in the "vanilla" VDR or not?

@Klaus: What do you think?  I don't know which of the changes
helps to avoid underruns of the DVD plugin.  I guess it is
the changes in eit.c which gives the DVD plugin more time
... the safe_read() may get sometimes EBUSY even if poll
gives success.  (AFAIK the DVD plugin uses no ringbuffer due
to synch problems with A/V and subtitles and menus from
private stream 2).


        Werner
--- Make.arch
+++ Make.arch	Mon May 19 15:54:21 2003
@@ -0,0 +1,23 @@
+#
+# Get the optimization of the used kernel
+#
+
+SUBARCH := $(shell uname -m|sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+ARCH	:= $(SUBARCH)
+
+all::
+
+ifneq ($(wildcard /usr/src/linux/.config),)
+  -include /usr/src/linux/.config
+else
+ifneq ($(wildcard /boot/vmlinuz.config),)
+  -include /boot/vmlinuz.config
+endif
+endif
+
+ifneq ($(wildcard /usr/src/linux/arch/$(ARCH)/Makefile),)
+  -include /usr/src/linux/arch/$(ARCH)/Makefile
+endif
+
+all::
+	@echo $(CFLAGS)
--- Makefile
+++ Makefile	Mon May 19 15:54:21 2003
@@ -11,8 +11,10 @@
 CC       ?= gcc
 CFLAGS   ?= -O2
 
+CXXARCH  ?= $(shell make -sf Make.arch|grep -v '^make') -funroll-loops
+
 CXX      ?= g++
-CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual
+CXXFLAGS ?= -g -O2 $(CXXARCH) -Wall -Woverloaded-virtual -pthread
 
 DVBDIR   = ../DVB
 DTVDIR   = ./libdtv
@@ -80,7 +82,7 @@
 # The main program:
 
 vdr: $(OBJS) $(DTVLIB)
-	$(CXX) $(CXXFLAGS) -rdynamic $(OBJS) $(NCURSESLIB) -ljpeg -lpthread -ldl $(LIBDIRS) $(DTVLIB) -o vdr
+	$(CXX) $(CXXFLAGS) -rdynamic $(OBJS) $(NCURSESLIB) -ljpeg -ldl $(LIBDIRS) $(DTVLIB) -o vdr
 
 # The font files:
 
--- eit.c
+++ eit.c	Thu Jun 12 18:27:55 CEST 2003
@@ -1249,11 +1249,12 @@
                   continue;
                // read section
                unsigned char buf[4096]; // max. allowed size for any EIT section
-               int r = safe_read(filters[a].handle, buf, sizeof(buf));
+               int r = read(filters[a].handle, buf, sizeof(buf));
                if (r > 3) // minimum number of bytes necessary to get section length
                {
                   int seclen = (((buf[1] & 0x0F) << 8) | (buf[2] & 0xFF)) + 3;
                   int pid = filters[a].pid;
+                  int err = 0;
                   if (seclen == r)
                   {
                      //dsyslog("Received pid 0x%04X with table ID 0x%02X and length of %4d\n", pid, buf[0], seclen);
@@ -1301,10 +1302,10 @@
                                  ctdt.SetSystemTime();
                               }
                            }
-                              /*XXX this comes pretty often:
                            else
-                              dsyslog("Time packet was not 0x70 but 0x%02x\n", (int)buf[0]);
-                              XXX*/
+                              // XXX this comes pretty often:
+                              // dsyslog("Time packet was not 0x70 but 0x%02x\n", (int)buf[0]);
+                              err = 1;
                            break;
 
                         case 0x12:
@@ -1338,14 +1339,21 @@
                            break;
                      }
                   }
-                  /*
                   else
-                     dsyslog("read incomplete section - seclen = %d, r = %d", seclen, r);
-                  */
+                     // dsyslog("read incomplete section - seclen = %d, r = %d", seclen, r);
+                     usleep(10);
+                  if (err)
+                     usleep(10);
                }
+               else // if !(r > 3)
+                  usleep(10);
             }
+            else // if !(pfd[a].revents & POLLIN)
+               usleep(10);
          }
       }
+      else // if (poll(pfd, NumUsedFilters, 1000) != 0)
+         usleep(10);
    }
 
    dsyslog("EIT processing thread ended (pid=%d)%s", getpid(), masterSIProcessor ? " - master" : "");

Home | Main Index | Thread Index