ERROR: video data stream broken on second dvb card , but szap works (include recording)

Message ID 45CDBF3F.1010600@gmx.de
State New
Headers

Commit Message

Reinhard Nissl Feb. 10, 2007, 12:49 p.m. UTC
  Hi,

Dieter Bloms wrote:

>>> Feb  9 12:02:00 video vdr: [30529] switching device 2 to channel 1
>>> Feb  9 12:02:09 video vdr: [30537] frontend 1 timed out while tuning to channel 1, tp 111836
>>> Feb  9 12:02:32 video vdr: [30603] ERROR: video data stream broken
>>>
>>> so why can I get ts streams from the second dvb card and vdr doesn't get
>>> any bytes ?
>> As you can see from the above lines, tuning fails for device 2 (=
>> frontend 1) as VDR reports a timeout about 10 seconds after switching to
>> this channel. VDR retries tuning in that case, but further reports are
>> suppressed for the next 60 seconds so you don't see a second timeout report.
>>
>> Finally, after 30 seconds, the recording thread issues an emergency exit
>> as it didn't see any data (=> video data stream broken) as the device
>> was not able to tune to the channel.
>>
>> Is your DiSEqC setup correct (in case you are using DiSEqC)?
> 
> I don't have a diseqc setup, I have a twin lnb and both dvb cards are
> connected directly.
> 
> It worked in the past, ok many timeouts, but after reloading the driver
> and restart of vdr it worked.
> 
> I was amazed that vdr can not tune to a channel and szap can do it
> without reloading the driver !
> 
> Maybe they use differnt methods to switch the channels.

szap always sends DiSEqC commands, so I'd suggest to use VDR's
diseqc.conf. It's default section "Full DiSEqC sequence" is identical to
the tuning sequence that szap uses.

You may want to try the attached szap and VDR patch. You'll then get
some output while tuning.

Bye.
  

Comments

Dieter Bloms Feb. 10, 2007, 4:19 p.m. UTC | #1
Hi,

On Sat, Feb 10, Reinhard Nissl wrote:

> szap always sends DiSEqC commands, so I'd suggest to use VDR's
> diseqc.conf. It's default section "Full DiSEqC sequence" is identical to
> the tuning sequence that szap uses.
> 
> You may want to try the attached szap and VDR patch. You'll then get
> some output while tuning.

doesn't my driver or card support diseqc ?

--snip
video:/tmp/szap # szap  -a 1 -p -i
reading channels from file '/root/.szap/channels.conf'

>>> RTL Television,RTL;RTL World
zapping to 5 'RTL Television,RTL;RTL World':
sat 0, frequency = 12187 MHz H, symbolrate 27500000, vpid = 0x00a3, apid = 0x0068 sid = 0x0069
using '/dev/dvb/adapter1/frontend0' and '/dev/dvb/adapter1/demux0'
FE_DISEQC_SEND_MASTER_CMD failed: Unknown error 524
FE_DISEQC_SEND_BURST failed: Operation not supported
couldn't find pmt-pid for sid 0069
status 1f | signal f700 | snr ffdc | ber 00000000 | unc 00000000 | FE_HAS_LOCK

>>> SAT.1;ProSiebenSat.1
zapping to 6 'SAT.1;ProSiebenSat.1':
sat 0, frequency = 12480 MHz V, symbolrate 27500000, vpid = 0x06ff, apid = 0x0700 sid = 0x0022
FE_DISEQC_SEND_MASTER_CMD failed: Unknown error 524
FE_DISEQC_SEND_BURST failed: Operation not supported
couldn't find pmt-pid for sid 0022
status 1f | signal fb00 | snr ffdc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
--snip--
  
Reinhard Nissl Feb. 10, 2007, 7:39 p.m. UTC | #2
Hi,

Dieter Bloms wrote:

>> szap always sends DiSEqC commands, so I'd suggest to use VDR's
>> diseqc.conf. It's default section "Full DiSEqC sequence" is identical to
>> the tuning sequence that szap uses.
>>
>> You may want to try the attached szap and VDR patch. You'll then get
>> some output while tuning.
> 
> doesn't my driver or card support diseqc ?

Don't know. But have you tried DiSEqC with VDR (menu Settings - LNB)?

You might get similar messages but on the other hand, it might work ;-)

Bye.
  
Dieter Bloms Feb. 10, 2007, 9:49 p.m. UTC | #3
Hi,

On Sat, Feb 10, Reinhard Nissl wrote:

> Don't know. But have you tried DiSEqC with VDR (menu Settings - LNB)?

no, because I didn't install any diseqc switches.
I had also an empty diseqc.conf

> You might get similar messages but on the other hand, it might work ;-)

ok, now I have installed the default diseqc.conf and activate diseqc in
vdr setup menu.
After a shutdown (and turn off the computer for about 10 seconds) the
second card works, even with these two errors:

t: 1171143367,692, c: 0, r: 0, a: ==============================================
t: 1171143387,098, c: 1, r: 0, a: ----------------------------------------------
t: 1171143387,099, c: 1, r: 0, a: ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF)
t: 1171143387,100, c: 1, r: 0, a: ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_13)
t: 1171143387,118, c: 1, r: -1, a: ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd)
t: 1171143387,138, c: 1, r: -1, a: ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_A)
t: 1171143387,158, c: 1, r: 0, a: ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_ON)
t: 1171143387,160, c: 1, r: 0, a: ioctl(fd_frontend, FE_SET_FRONTEND, &Frontend)
t: 1171143387,288, c: 1, r: 0, a: ==============================================

Either the power off has resolved the error or activating diseqc.
but now if I deactivate diseqc the cards work, too .

Very strange.

Thank you very much for your help, for the future I will activate
diseqc.
  
Reinhard Nissl Feb. 11, 2007, 10:57 a.m. UTC | #4
Hi,

Dieter Bloms wrote:

> t: 1171143387,098, c: 1, r: 0, a: ----------------------------------------------
> t: 1171143387,099, c: 1, r: 0, a: ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF)
> t: 1171143387,100, c: 1, r: 0, a: ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_13)
> t: 1171143387,118, c: 1, r: -1, a: ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd)
> t: 1171143387,138, c: 1, r: -1, a: ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_A)
> t: 1171143387,158, c: 1, r: 0, a: ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_ON)
> t: 1171143387,160, c: 1, r: 0, a: ioctl(fd_frontend, FE_SET_FRONTEND, &Frontend)
> t: 1171143387,288, c: 1, r: 0, a: ==============================================
> 
> Either the power off has resolved the error or activating diseqc.
> but now if I deactivate diseqc the cards work, too .
> 
> Very strange.
> 
> Thank you very much for your help, for the future I will activate
> diseqc.

Well, I've just had a further look into the tuning code of VDR. With
DiSEqC disabled, VDR simply executes the commands FE_SET_VOLTAGE,
FE_SET_TONE and FE_SET_FRONTEND without any extra delay between these
ioctl() calls.

I'd like you to do some further tests by modifying diseqc.conf:

A) let's remove FE_DISEQC_SEND_MASTER_CMD and FE_DISEQC_SEND_BURST

S19.2E  11700 V  9750  t v W15 W15 W15 t
S19.2E  99999 V 10600  t v W15 W15 W15 T
S19.2E  11700 H  9750  t V W15 W15 W15 t
S19.2E  99999 H 10600  t V W15 W15 W15 T

B) let's reduce the time to wait

S19.2E  11700 V  9750  t v W15 t
S19.2E  99999 V 10600  t v W15 T
S19.2E  11700 H  9750  t V W15 t
S19.2E  99999 H 10600  t V W15 T

C) omit the time to wait

S19.2E  11700 V  9750  t v t
S19.2E  99999 V 10600  t v T
S19.2E  11700 H  9750  t V t
S19.2E  99999 H 10600  t V T

D) omit the initial FE_SET_TONE

S19.2E  11700 V  9750  v t
S19.2E  99999 V 10600  v T
S19.2E  11700 H  9750  V t
S19.2E  99999 H 10600  V T

Test D) is identical to disabling DiSEqC in VDR's setup menu.

I assume that either B) or C) will be the shortest sequence that still
works in your case.

Bye.
  
Dieter Bloms Feb. 11, 2007, 11:37 a.m. UTC | #5
Hi Reinhard,

On Sun, Feb 11, Reinhard Nissl wrote:

> I'd like you to do some further tests by modifying diseqc.conf:

I will do each setup for about 1 week and will see, if I miss some
recordings and let you about the results.

> A) let's remove FE_DISEQC_SEND_MASTER_CMD and FE_DISEQC_SEND_BURST
> 
> S19.2E  11700 V  9750  t v W15 W15 W15 t
> S19.2E  99999 V 10600  t v W15 W15 W15 T
> S19.2E  11700 H  9750  t V W15 W15 W15 t
> S19.2E  99999 H 10600  t V W15 W15 W15 T
> 
> B) let's reduce the time to wait
> 
> S19.2E  11700 V  9750  t v W15 t
> S19.2E  99999 V 10600  t v W15 T
> S19.2E  11700 H  9750  t V W15 t
> S19.2E  99999 H 10600  t V W15 T
> 
> C) omit the time to wait
> 
> S19.2E  11700 V  9750  t v t
> S19.2E  99999 V 10600  t v T
> S19.2E  11700 H  9750  t V t
> S19.2E  99999 H 10600  t V T
> 
> D) omit the initial FE_SET_TONE
> 
> S19.2E  11700 V  9750  v t
> S19.2E  99999 V 10600  v T
> S19.2E  11700 H  9750  V t
> S19.2E  99999 H 10600  V T
> 
> Test D) is identical to disabling DiSEqC in VDR's setup menu.
> 
> I assume that either B) or C) will be the shortest sequence that still
> works in your case.

I will begin with A .... to get a stables setup first, because it is not
so depressing ;)
  
Dieter Bloms Feb. 15, 2007, 6:07 a.m. UTC | #6
Hi,

On Sun, Feb 11, Dieter Bloms wrote:

> > I'd like you to do some further tests by modifying diseqc.conf:
> 
> I will do each setup for about 1 week and will see, if I miss some
> recordings and let you about the results.

no diseqc setup works stabel for me :(
Also the Full DiSEqC sequence from default diseqc.conf doesn't work
a few hours after reboot and sometime it doesn't work directly after
reboot.
But I can switch the channel with szap and get the TS stream from
/dev/dvb/adapter1/dvr0 every time, even vdr can't record I only stop vdr
and do not a reload of the driver.

I did some tests with szap:

o I can only get the TS stream with the default lnb type or -l UNIVERSAL
o if I use another lnb type like ENHANCED, I can switch, but don't get
  any data.
o The ioctls are the same if I use diseqc with vdr, but as I said
  before, I didn't get any data a few hours after reboot of the system,
  and sometime I didn't get any data directly after reboot.
o If I use szap, I can switch the channels and get the ts stream every
  time (via cat /dev/dvb/adapter1/dvr0 > /tmp/bla).
o the first status is 01 and it has no lock all others are 1f and it has
  a lock (as seen below).
o when I call szap the second time (with the same channel) the first
  status is 01 and then 1f, too.
o maybe vdr does have to wait a longer time ?

What lnb type vdr is using, when I enable diseqc in vdr menu ?
I can't configure any frequenz after activate diseqc.

Here the output from your patched szap:

video:/tmp/szap # ./szap -l UNIVERSAL -a 1 -r -c /etc/vdr/channels.conf -n 2
reading channels from file '/etc/vdr/channels.conf'
zapping to 2 'Das Erste;ARD':
sat 0, frequency = 11836 MHz H, symbolrate 27500000, vpid = 0x0065, apid = 0x0066 sid = 0x0068
using '/dev/dvb/adapter1/frontend0' and '/dev/dvb/adapter1/demux0'
t: 1171518269.386, c: 1, r: 0, a: ----------------------------------------------
t: 1171518269.386, c: 1, r: 0, a: ioctl(fd, FE_SET_TONE, SEC_TONE_OFF)
t: 1171518269.389, c: 1, r: 0, a: ioctl(fd, FE_SET_VOLTAGE, v) (v = SEC_VOLTAGE_18)
t: 1171518269.408, c: 1, r: 0, a: ioctl(fd, FE_DISEQC_SEND_MASTER_CMD, &cmd->cmd)
t: 1171518269.576, c: 1, r: 0, a: ioctl(fd, FE_DISEQC_SEND_BURST, b) (b = SEC_MINI_A)
t: 1171518269.700, c: 1, r: 0, a: ioctl(fd, FE_SET_TONE, t) (t = SEC_TONE_ON)
t: 1171518269.702, c: 1, r: 0, a: ioctl(fefd, FE_SET_FRONTEND, &tuneto)
status 01 | signal f700 | snr e330 | ber 00000000 | unc fffffffe |
status 1f | signal f700 | snr f866 | ber 00000000 | unc fffffffe | FE_HAS_LOCK
status 1f | signal f700 | snr f8ea | ber 00000000 | unc fffffffe | FE_HAS_LOCK
status 1f | signal f700 | snr f8cd | ber 00000000 | unc fffffffe | FE_HAS_LOCK
status 1f | signal f700 | snr f8aa | ber 00000000 | unc fffffffe | FE_HAS_LOCK
status 1f | signal f700 | snr f887 | ber 00000000 | unc fffffffe | FE_HAS_LOCK
status 1f | signal f700 | snr f8a4 | ber 00000000 | unc fffffffe | FE_HAS_LOCK
status 1f | signal f700 | snr f93c | ber 00000000 | unc fffffffe | FE_HAS_LOCK
status 1f | signal f700 | snr f8ad | ber 00000000 | unc fffffffe | FE_HAS_LOCK
status 1f | signal f700 | snr f8a9 | ber 00000000 | unc fffffffe | FE_HAS_LOCK
status 1f | signal f700 | snr f93f | ber 00000000 | unc fffffffe | FE_HAS_LOCK
status 1f | signal f700 | snr f88a | ber 00000000 | unc fffffffe | FE_HAS_LOCK
status 1f | signal f700 | snr f8e8 | ber 00000000 | unc fffffffe | FE_HAS_LOCK
status 1f | signal f700 | snr f81b | ber 00000000 | unc fffffffe | FE_HAS_LOCK
status 1f | signal f700 | snr f911 | ber 00000000 | unc fffffffe | FE_HAS_LOCK
  
Dieter Bloms Feb. 16, 2007, 12:48 p.m. UTC | #7
Hi,

On Thu, Feb 15, Dieter Bloms wrote:

> no diseqc setup works stabel for me :(
> Also the Full DiSEqC sequence from default diseqc.conf doesn't work
> a few hours after reboot and sometime it doesn't work directly after
> reboot.
> But I can switch the channel with szap and get the TS stream from
> /dev/dvb/adapter1/dvr0 every time, even vdr can't record I only stop vdr
> and do not a reload of the driver.
> 
> I did some tests with szap:
> 
> o I can only get the TS stream with the default lnb type or -l UNIVERSAL
> o if I use another lnb type like ENHANCED, I can switch, but don't get
>   any data.
> o The ioctls are the same if I use diseqc with vdr, but as I said
>   before, I didn't get any data a few hours after reboot of the system,
>   and sometime I didn't get any data directly after reboot.
> o If I use szap, I can switch the channels and get the ts stream every
>   time (via cat /dev/dvb/adapter1/dvr0 > /tmp/bla).
> o the first status is 01 and it has no lock all others are 1f and it has
>   a lock (as seen below).
> o when I call szap the second time (with the same channel) the first
>   status is 01 and then 1f, too.
> o maybe vdr does have to wait a longer time ?

I can reproduce following:

vdr can record from senders on V polarisation like sat1, prosieben ...
even without reloading the driver.
vdr can not record from any sender on H polarisation like ard, zdf ...
even with reloading the driver it doesn't work.
This explains, that I got some recording and some not.

Does anybody know what can be the different between H and V polarisation ?
  
bastlir Feb. 16, 2007, 1:43 p.m. UTC | #8
On Friday 16 February 2007 13:48, Dieter Bloms wrote:
> Hi,
>
> On Thu, Feb 15, Dieter Bloms wrote:
> > no diseqc setup works stabel for me :(
>
> I can reproduce following:
>
> vdr can record from senders on V polarisation like sat1, prosieben ...
> even without reloading the driver.
> vdr can not record from any sender on H polarisation like ard, zdf ...
> even with reloading the driver it doesn't work.
> This explains, that I got some recording and some not.
>
> Does anybody know what can be the different between H and V polarisation ?
Hi,

supply voltage at central wire of koax cable. It seems you have or DVB card or 
LNB damaged. Test these parts with another receiver or/and another LNB.
  
Dieter Bloms Feb. 17, 2007, 4:59 p.m. UTC | #9
Hi,

On Fri, Feb 16, bastlir wrote:

> > vdr can record from senders on V polarisation like sat1, prosieben ...
> > even without reloading the driver.
> > vdr can not record from any sender on H polarisation like ard, zdf ...
> > even with reloading the driver it doesn't work.
> > This explains, that I got some recording and some not.
> >
> > Does anybody know what can be the different between H and V polarisation ?
> Hi,
> 
> supply voltage at central wire of koax cable. It seems you have or DVB card or 
> LNB damaged. Test these parts with another receiver or/and another LNB.

my primary dvb card works fine on both of my Twin-LNB connectors.
I can switch the second card via szap and get a video stream via
"cat /dev/dvb/adapter1/dvr0 > /tmp/bla" on H and V channels.
VDR doesn't get data any data from H channels, but gets data from V
channels.
I will try to strace vdr and szap to get any difference, maybe they do
it in a different way.
  

Patch

--- ../vdr-1.4.5-orig/dvbdevice.c	2006-08-14 11:38:32.000000000 +0200
+++ dvbdevice.c	2007-02-01 21:38:44.000000000 +0100
@@ -176,6 +176,13 @@  static unsigned int FrequencyToHz(unsign
   return f;
 }
 
+#include <sys/time.h>
+static double now() { timeval t; gettimeofday(&t, 0); return t.tv_sec + t.tv_usec / 1e6; }
+static int check(int c, int r, char *a, double t) { fprintf(stderr, "t: %.3lf, c: %d, r: %d, a: %s\n", t, c, r, a); return r; } 
+#define CHECK4(s) ::check(cardIndex, 0, s, ::now())
+#define CHECK3(s) ::check(cardIndex, s, #s, ::now())
+#define CHECK2(s) CHECK(::check(cardIndex, s, #s, ::now()))
+
 bool cDvbTuner::SetFrontend(void)
 {
   dvb_frontend_parameters Frontend;
@@ -195,12 +202,12 @@  bool cDvbTuner::SetFrontend(void)
                   for (char *CurrentAction = NULL; (da = diseqc->Execute(&CurrentAction)) != cDiseqc::daNone; ) {
                       switch (da) {
                         case cDiseqc::daNone:      break;
-                        case cDiseqc::daToneOff:   CHECK(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF)); break;
-                        case cDiseqc::daToneOn:    CHECK(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_ON)); break;
-                        case cDiseqc::daVoltage13: CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_13)); break;
-                        case cDiseqc::daVoltage18: CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18)); break;
-                        case cDiseqc::daMiniA:     CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_A)); break;
-                        case cDiseqc::daMiniB:     CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_B)); break;
+                        case cDiseqc::daToneOff:   CHECK2(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF)); break;
+                        case cDiseqc::daToneOn:    CHECK2(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_ON)); break;
+                        case cDiseqc::daVoltage13: CHECK2(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_13)); break;
+                        case cDiseqc::daVoltage18: CHECK2(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18)); break;
+                        case cDiseqc::daMiniA:     CHECK2(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_A)); break;
+                        case cDiseqc::daMiniB:     CHECK2(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_B)); break;
                         case cDiseqc::daCodes: {
                              int n = 0;
                              uchar *codes = diseqc->Codes(n);
@@ -208,7 +215,7 @@  bool cDvbTuner::SetFrontend(void)
                                 struct dvb_diseqc_master_cmd cmd;
                                 memcpy(cmd.msg, codes, min(n, int(sizeof(cmd.msg))));
                                 cmd.msg_len = n;
-                                CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd));
+                                CHECK2(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd));
                                 }
                              }
                              break;
@@ -285,7 +292,7 @@  bool cDvbTuner::SetFrontend(void)
          esyslog("ERROR: attempt to set channel with unknown DVB frontend type");
          return false;
     }
-  if (ioctl(fd_frontend, FE_SET_FRONTEND, &Frontend) < 0) {
+  if (CHECK3(ioctl(fd_frontend, FE_SET_FRONTEND, &Frontend)) < 0) {
      esyslog("ERROR: frontend %d: %m", cardIndex);
      return false;
      }
@@ -306,11 +313,13 @@  void cDvbTuner::Action(void)
           case tsIdle:
                break;
           case tsSet:
+CHECK4("----------------------------------------------");
                tunerStatus = SetFrontend() ? tsTuned : tsIdle;
                Timer.Set(tuneTimeout);
                continue;
           case tsTuned:
                if (Timer.TimedOut()) {
+CHECK4("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
                   tunerStatus = tsSet;
                   diseqcCommands = NULL;
                   if (time(NULL) - lastTimeoutReport > 60) { // let's not get too many of these
@@ -328,6 +337,7 @@  void cDvbTuner::Action(void)
                   continue;
                   }
                else if (Status & FE_HAS_LOCK) {
+if (tunerStatus != tsLocked) CHECK4("==============================================");
                   if (LostLock) {
                      isyslog("frontend %d regained lock on channel %d, tp %d", cardIndex, channel.Number(), channel.Transponder());