Re: [vdr] found the problem (in xineliboutput) Re: vdr-sxfe segfaults when listening to radiochannles (vdr-1.7.9/1.7.12)

2010-02-15 Thread Marco Skambraks

hi,

I had/have the same problem
I found out that this feature produces the problem:
 Visualization: goom

if I turn it off I can switch to radio-channels and listen to it without 
any problems


Halim, the code lines you posted looks like a new a/v sync method
if "Visualization" is set to "goom"
xineliboutput or maybe xinelib adds some frames to the video stream

hth to solve the problem

marco

On Sat, 13 Feb 2010, Halim Sahin wrote:


Hi folks,
The segfault was introduced in xineliboutput's cvs between 28.01.2010
and 29.01.2010
The following change produces it:

--- xine_input_vdr.c.old2010-02-13 14:13:48.670894516 +0100
+++ xine_input_vdr.c2010-02-13 14:13:56.246141788 +0100
@@ -4,7 +4,7 @@
 * See the main source file 'xineliboutput.c' for copyright information and
 * how to reach the author.
 *
- * $Id: xine_input_vdr.c,v 1.289 2010/01/18 20:39:36 phintuka Exp $
+ * $Id: xine_input_vdr.c,v 1.291 2010/01/28 11:50:07 phintuka Exp $
 *
 */

@@ -62,6 +62,7 @@

#include "xine/adjustable_scr.h"
#include "xine/osd_manager.h"
+#include "xine/xvdr_metronom.h"

#include "xine_input_vdr.h"
#include "xine_input_vdr_net.h"
@@ -127,7 +128,7 @@
#  include  /* syscall(__NR_gettid) */
#endif

-static const char module_revision[] = "$Id: xine_input_vdr.c,v 1.289 2010/01/18 
20:39:36 phintuka Exp $";
+static const char module_revision[] = "$Id: xine_input_vdr.c,v 1.291 2010/01/28 
11:50:07 phintuka Exp $";
static const char log_module_input_vdr[] = "[input_vdr] ";
#define LOG_MODULENAME log_module_input_vdr
#define SysLogLeveliSysLogLevel
@@ -313,6 +314,9 @@
  uint8_t hd_stream : 1;/* true if current stream is HD */
  uint8_t sw_volume_control : 1;

+  /* metronom */
+  xvdr_metronom_t*metronom;
+
  /* SCR */
  adjustable_scr_t   *scr;
  int speed_before_pause;
@@ -1813,7 +1817,7 @@
  this->class->xine->config->update_num(this->class->xine->config,
"video.output.xv_deinterlace_method",
method >= 0 ? method : 0);
-  xine_set_param(this->stream, XINE_PARAM_VO_DEINTERLACE, method ? 1 : 0);
+  xine_set_param(this->stream, XINE_PARAM_VO_DEINTERLACE, !!method);

  return 0;
}
@@ -1935,7 +1939,7 @@
  return 0;
}

-static int  set_playback_speed(vdr_input_plugin_t *this, int speed)
+static int set_trick_speed(vdr_input_plugin_t *this, int speed, int backwards)
{
/*  speed:
  <0 - show each abs(n)'th frame (drop other frames)
@@ -1955,6 +1959,8 @@
return -2;
  }

+  this->metronom->set_trickspeed(this->metronom, backwards ? speed : 0);
+
  if(speed > 1 || speed < -1) {
reset_scr_tuning(this, -1);
this->is_trickspeed = 1;
@@ -1981,6 +1987,11 @@
  return 0;
}

+static int reset_trick_speed(vdr_input_plugin_t *this)
+{
+  return set_trick_speed(this, 1, 0);
+}
+
static void send_meta_info(vdr_input_plugin_t *this)
{
  if(this->slave_stream) {
@@ -2263,10 +2274,10 @@
  xine_usec_sleep(50*1000);

  /* keep our own demux happy while playing another stream */
-  set_playback_speed(this, 1);
+  reset_trick_speed(this);
  this->live_mode = 1;
  set_live_mode(this, 0);
-  set_playback_speed(this, 1);
+  reset_trick_speed(this);
  reset_scr_tuning(this, this->speed_before_pause = XINE_FINE_SPEED_NORMAL);
  this->slave_stream->metronom->set_option(this->slave_stream->metronom,
   METRONOM_PREBUFFER, 9);
@@ -2902,7 +2913,7 @@

  } else if(!strncasecmp(cmd, "TRICKSPEED ", 11)) {
err = (1 == sscanf(cmd+11, "%d", &tmp32)) ?
-  set_playback_speed(this, tmp32) :
+  set_trick_speed(this, tmp32, !!strstr(cmd+13, "Back")) :
  CONTROL_PARAM_ERROR;

  } else if(!strncasecmp(cmd, "STILL ", 6)) {
@@ -2938,13 +2949,13 @@

  } else if(!strncasecmp(cmd, "MASTER ", 7)) {
if(1 == sscanf(cmd+7, "%d", &tmp32))
-  this->fixed_scr = tmp32 ? 1 : 0;
+  this->fixed_scr = !!tmp32;
else
  err = CONTROL_PARAM_ERROR;

  } else if(!strncasecmp(cmd, "VOLUME ", 7)) {
if(1 == sscanf(cmd+7, "%d", &tmp32)) {
-  int sw = strstr(cmd, "SW") ? 1 : 0;
+  int sw = !!strstr(cmd, "SW");
  if(!sw) {
xine_set_param(stream, XINE_PARAM_AUDIO_VOLUME, tmp32);
xine_set_param(stream, XINE_PARAM_AUDIO_MUTE, tmp32<=0 ? 1 : 0);
@@ -2994,7 +3005,7 @@
  } else if(!strncasecmp(cmd, "AUDIOSTREAM ", 12)) {
if(!this->slave_stream) {
#if 0
-  int ac3 = strncmp(cmd+12, "AC3", 3) ? 0 : 1;
+  int ac3 = !strncmp(cmd+12, "AC3", 3);
  if(1 == sscanf(cmd+12 + 4*ac3, "%d", &tmp32)) {
pthread_mutex_lock(&this->lock);
this->audio_stream_id = tmp32;
@@ -3016,7 +3027,7 @@
int old_ch  = _x_get_spu_channel(stream);
int max_ch  = xine_get_stream_info(stream, 
XINE_STREAM_INFO_MAX_SPU_CHANNEL);
int ch  = old_ch;
-int ch_auto = strstr(cmd+10, "auto") ? 1 : 0;
+int ch_auto = !!strstr(cmd+10, "auto");
int is_dvd  = 0;

if (this->slave_stream

Re: [vdr] No Audio on ATSC Qam256 or OTA..

2010-02-15 Thread Rob Davis
My Cable provider or VDR seems to mess up the audio pid regularly for
various channels.  Is there a way (or patch) that I can keep the update
pids on, except for the apids?  They move the vpids around about once a
month, so keeping vpid updating depending on sid is worthwhile,
otherwise I would turn off the updatepids line.

On Mon, 2009-12-14 at 00:03 -0500, Alex Lasnier wrote:
> Klaus Schmidinger wrote:
> > On 02.08.2009 19:22, Alex Lasnier wrote:
> >> Klaus Schmidinger wrote:
> >>> On 07/30/09 01:05, Rob Davis wrote:
>  Stile wrote:
> > On Tue, Jun 23, 2009 at 12:43 PM, Rob Davis
> > wrote:
> >  
> >> Alex Lasnier wrote:
> >>   
> >>> Rob Davis wrote:
> >>>
> >>> 
>  I have it normally connected to Comcast cable which should pipe
>  through
>  a bunch of FTV channels using QAM256. These I can see and hear in
>  kaffeine with AC97 audio. However, in VDR it appears to change the
>  pids
>  automatically so that the audio stops working. If I manually change
>  VDR
>  to not auto update and put the APID in then it squeeks rather than
>  works. However, streaming to mplayer using streamdev seems to work.
>  (It
>  does the same this with OTA channels too - although I can only get 4
>  with a portable antenna.)
> 
>  
> >>> ATSC uses only AC-3 audio, so the Apid should be 0 and the Dpid
> >>> needs to
> >>> be set appropriately. Since the sound squeaks, whatever value you
> >>> have
> >>> set for the Apid should be the Dpid.
> >>>
> >>> For example,
> >>>
> >>> WIFR-Wx:495000:M256:C:0:1984:0;Dpid:0:0:2:0:0:0
> >>>
> >>>
> >>>   
> >> Perfect... Thanks
> >>
> >> Is there a way to keep auto update on, but stop Comcast from sending
> >> wrong pids?  It keeps settings all audio options to 0 and some vpids
> >> too?
> >>
> >> 
> > The streamtype for those AC3 PIDs is 0x81. Adding this to pat.c will
> > add the digital PIDs correctly.
> >
> > --- pat.c~2009-06-22 12:28:08.0 -0400
> > +++ pat.c2009-06-22 13:32:48.461538560 -0400
> > @@ -432,6 +432,9 @@
> >   }
> >}
> >break;
> > +case 0x81: // AC3 DPIDs
> > + Dpids[NumDpids++] = stream.getPid();
> > + break;
> >//default: printf("PID: %5d %5d %2d %3d %3d\n",
> > pmt.getServiceId(), stream.getPid(), stream.getStreamType(),
> > pmt.getVersionNumber(), Channel->Number());//XXX
> >}
> >  for (SI::Loop::Iterator it; (d =
> > (SI::CaDescriptor*)stream.streamDescriptors.getNext(it,
> > SI::CaDescriptorTag)); ) {
> >
> >   
>  Perfect.  I wonder if this could go in the atscepg patch?
> >>> Can you try if this also works if you insert the line
> >>>
> >>> case 0x81: // AC3 DPIDs
> >>>
> >>> after the line
> >>>
> >>> //XXX case 8: // STREAMTYPE_13818_DSMCC
> >>>
> >>> instead? I'm asking because I'd like to see whether there are
> >>> also language descriptors available...
> >>>
> >>> Klaus
> >> Yes, language descriptors are present. However, ATSC also uses 0x81 as
> >> the AC3 descriptor tag. So we need another
> >>
> >> case 0x81:
> >>
> >> after
> >>
> >> case SI::AC3DescriptorTag:
> > 
> > In case this is still current, can you please send me a (tested) patch?
> > 
> > Klaus
> > 
> 
> Sure, please see the attached patch.
> 
> plain text document attachment (vdr-1.7.10-atsc.diff)
> diff -ur vdr-1.7.10.orig/dvbdevice.c vdr-1.7.10/dvbdevice.c
> --- vdr-1.7.10.orig/dvbdevice.c   2009-06-06 07:17:20.0 -0400
> +++ vdr-1.7.10/dvbdevice.c2009-11-22 13:26:57.0 -0500
> @@ -319,6 +319,16 @@
>   tuneTimeout = DVBT_TUNE_TIMEOUT;
>   lockTimeout = DVBT_LOCK_TIMEOUT;
>   }
> +  else if (frontendType == SYS_ATSC) {
> + // ATSC
> + SETCMD(DTV_DELIVERY_SYSTEM, frontendType);
> + SETCMD(DTV_FREQUENCY, FrequencyToHz(channel.Frequency()));
> + SETCMD(DTV_INVERSION, channel.Inversion());
> + SETCMD(DTV_MODULATION, channel.Modulation());
> + 
> + tuneTimeout = DVBT_TUNE_TIMEOUT;
> + lockTimeout = DVBT_LOCK_TIMEOUT; 
> + }
>else {
>   esyslog("ERROR: attempt to set channel with unknown DVB frontend type");
>   return false;
> @@ -904,7 +914,7 @@
>return type == cSource::stNone
>|| type == cSource::stCable && (frontendType == SYS_DVBC_ANNEX_AC || 
> frontendType == SYS_DVBC_ANNEX_B)
>|| type == cSource::stSat   && (frontendType == SYS_DVBS || 
> frontendType == SYS_DVBS2)
> -  || type == cSource::stTerr  && (frontendType == SYS_DVBT);
> +  || type == cSource::stTerr  && (frontendType == SYS_DVBT || 
> frontendType ==

Re: [vdr] No Audio on ATSC Qam256 or OTA..

2010-02-15 Thread Timothy D. Lenz
You can just turn off updates in vdr setup menu. Then it shouldn't 
change anything and you can do it manually


On 2/15/2010 11:07 AM, Rob Davis wrote:

My Cable provider or VDR seems to mess up the audio pid regularly for
various channels.  Is there a way (or patch) that I can keep the update
pids on, except for the apids?  They move the vpids around about once a
month, so keeping vpid updating depending on sid is worthwhile,
otherwise I would turn off the updatepids line.

On Mon, 2009-12-14 at 00:03 -0500, Alex Lasnier wrote:

Klaus Schmidinger wrote:

On 02.08.2009 19:22, Alex Lasnier wrote:

Klaus Schmidinger wrote:

On 07/30/09 01:05, Rob Davis wrote:

Stile wrote:

On Tue, Jun 23, 2009 at 12:43 PM, Rob Davis
wrote:


Alex Lasnier wrote:


Rob Davis wrote:



I have it normally connected to Comcast cable which should pipe
through
a bunch of FTV channels using QAM256. These I can see and hear in
kaffeine with AC97 audio. However, in VDR it appears to change the
pids
automatically so that the audio stops working. If I manually change
VDR
to not auto update and put the APID in then it squeeks rather than
works. However, streaming to mplayer using streamdev seems to work.
(It
does the same this with OTA channels too - although I can only get 4
with a portable antenna.)



ATSC uses only AC-3 audio, so the Apid should be 0 and the Dpid
needs to
be set appropriately. Since the sound squeaks, whatever value you
have
set for the Apid should be the Dpid.

For example,

WIFR-Wx:495000:M256:C:0:1984:0;Dpid:0:0:2:0:0:0




Perfect... Thanks

Is there a way to keep auto update on, but stop Comcast from sending
wrong pids?  It keeps settings all audio options to 0 and some vpids
too?



The streamtype for those AC3 PIDs is 0x81. Adding this to pat.c will
add the digital PIDs correctly.

--- pat.c~2009-06-22 12:28:08.0 -0400
+++ pat.c2009-06-22 13:32:48.461538560 -0400
@@ -432,6 +432,9 @@
   }
}
break;
+case 0x81: // AC3 DPIDs
+ Dpids[NumDpids++] = stream.getPid();
+ break;
//default: printf("PID: %5d %5d %2d %3d %3d\n",
pmt.getServiceId(), stream.getPid(), stream.getStreamType(),
pmt.getVersionNumber(), Channel->Number());//XXX
}
  for (SI::Loop::Iterator it; (d =
(SI::CaDescriptor*)stream.streamDescriptors.getNext(it,
SI::CaDescriptorTag)); ) {



Perfect.  I wonder if this could go in the atscepg patch?

Can you try if this also works if you insert the line

 case 0x81: // AC3 DPIDs

after the line

 //XXX case 8: // STREAMTYPE_13818_DSMCC

instead? I'm asking because I'd like to see whether there are
also language descriptors available...

Klaus

Yes, language descriptors are present. However, ATSC also uses 0x81 as
the AC3 descriptor tag. So we need another

case 0x81:

after

case SI::AC3DescriptorTag:


In case this is still current, can you please send me a (tested) patch?

Klaus



Sure, please see the attached patch.

plain text document attachment (vdr-1.7.10-atsc.diff)
diff -ur vdr-1.7.10.orig/dvbdevice.c vdr-1.7.10/dvbdevice.c
--- vdr-1.7.10.orig/dvbdevice.c 2009-06-06 07:17:20.0 -0400
+++ vdr-1.7.10/dvbdevice.c  2009-11-22 13:26:57.0 -0500
@@ -319,6 +319,16 @@
   tuneTimeout = DVBT_TUNE_TIMEOUT;
   lockTimeout = DVBT_LOCK_TIMEOUT;
   }
+  else if (frontendType == SYS_ATSC) {
+ // ATSC
+ SETCMD(DTV_DELIVERY_SYSTEM, frontendType);
+ SETCMD(DTV_FREQUENCY, FrequencyToHz(channel.Frequency()));
+ SETCMD(DTV_INVERSION, channel.Inversion());
+ SETCMD(DTV_MODULATION, channel.Modulation());
+
+ tuneTimeout = DVBT_TUNE_TIMEOUT;
+ lockTimeout = DVBT_LOCK_TIMEOUT;
+ }
else {
   esyslog("ERROR: attempt to set channel with unknown DVB frontend type");
   return false;
@@ -904,7 +914,7 @@
return type == cSource::stNone
|| type == cSource::stCable&&  (frontendType == SYS_DVBC_ANNEX_AC || 
frontendType == SYS_DVBC_ANNEX_B)
|| type == cSource::stSat&&  (frontendType == SYS_DVBS || frontendType 
== SYS_DVBS2)
-  || type == cSource::stTerr&&  (frontendType == SYS_DVBT);
+  || type == cSource::stTerr&&  (frontendType == SYS_DVBT || frontendType 
== SYS_ATSC);
  }

  bool cDvbDevice::ProvidesTransponder(const cChannel *Channel) const
diff -ur vdr-1.7.10.orig/pat.c vdr-1.7.10/pat.c
--- vdr-1.7.10.orig/pat.c   2009-08-16 11:01:03.0 -0400
+++ vdr-1.7.10/pat.c2009-11-22 13:31:37.0 -0500
@@ -389,6 +389,7 @@
break;
case 5: // STREAMTYPE_13818_PRIVATE
case 6: // STREAMTYPE_13818_PES_PRIVATE
+  case 0x81: // ATSC AC-3
//XXX case 8: // STREAMTYPE_13818_DSMCC
{
int dpid = 0;
@@ -397,6 +398,7 @@
for (SI::Loop::Itera