Skip to contentSkip to conversation

dvbstream reliability issues?

linux-dvb Adam Nielsen 2 participants 8 messages Mar 20, 2008 – Mar 29, 2008 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hi all,

I've recently started using dvbstream (instead of dvbrecord) to record shows using cron but I'm finding it to be very unreliable.

Depending on my reception quality, it has a tendency to segfault fairly regularly - enough that I wrote a script to reload it after a segfault so that I wouldn't miss my recording. With this set up it usually segfaults once every 15 minutes or so, and sometimes as often as every 4-5 minutes if the reception isn't so great.

Sometimes it doesn't segfault though, it just stops recording for some reason (the output file only grows by a few bytes a minute.) This is worse because it doesn't terminate, so my script isn't able to reload it to catch the rest of the recording.

For those people using dvbstream to do their recording, are any of you having issues like this?

I'm running CVS from 2008-02-24 and I'm using -prog to record based on the program instead of using PIDs (as our broadcasters here seem to change their PIDs without warning every couple of months.)

I'm hoping there's some easy fix for this, because I'd rather not have to try to get dvbrecord to work again!

Thanks,
Adam.

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#1 lore raw
Quoted 23 lines · On Thursday 20 March 2008 09:57:11 Adam Nielsen wrote:

Hi all,

I've recently started using dvbstream (instead of dvbrecord) to record shows using cron but I'm finding it to be very unreliable.

Depending on my reception quality, it has a tendency to segfault fairly regularly - enough that I wrote a script to reload it after a segfault so that I wouldn't miss my recording. With this set up it usually segfaults once every 15 minutes or so, and sometimes as often as every 4-5 minutes if the reception isn't so great.

Sometimes it doesn't segfault though, it just stops recording for some reason (the output file only grows by a few bytes a minute.) This is worse because it doesn't terminate, so my script isn't able to reload it to catch the rest of the recording.

For those people using dvbstream to do their recording, are any of you having issues like this?

I'm running CVS from 2008-02-24 and I'm using -prog to record based on the program instead of using PIDs (as our broadcasters here seem to change their PIDs without warning every couple of months.)

Quoted 6 lines

I'm hoping there's some easy fix for this, because I'd rather not have to try to get dvbrecord to work again!

Thanks,
Adam.

I use it for hours, even forgetting that it's recording, without segfaults.
Try to run it under gdb (after having compiled it with -g) and see with "bt" where it segfaults, or bugs can't be fixed

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#2 lore raw
Quoted 4 lines

I use it for hours, even forgetting that it's recording, without segfaults.
Try to run it under gdb (after having compiled it with -g) and see with "bt" where it segfaults, or bugs can't be fixed

What's your reception like? This particular card (DVico Fusion HDTV) seems to be somewhat less sensitive compared to my other cards, and I think getting corrupted data coming in is what breaks dvbstream. The recording itself is full of blips as if the reception is quite bad.

When the recording just stops (no crash) gdb doesn't seem to reveal anything amazing:

<Ctrl+C>
Program received signal SIGINT, Interrupt.
0xffffe410 in __kernel_vsyscall ()
(gdb) bt

#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7ebf77b in poll () from /lib/libc.so.6
#2  0x0804aeeb in main (argc=12, argv=0xbfe38484) at dvbstream.c:1516

(gdb) fr 2
#2 0x0804aeeb in main (argc=12, argv=0xbfe38484) at dvbstream.c:1516
1516 poll(pfds,1,500);
(gdb) cont
Continuing.
[Still no DVB data being written to disk]
<Ctrl+C>
Program received signal SIGINT, Interrupt.
0xffffe410 in __kernel_vsyscall ()
(gdb) bt

#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7ebf77b in poll () from /lib/libc.so.6
#2  0x0804aeeb in main (argc=12, argv=0xbfe38484) at dvbstream.c:1516

(gdb) fr 2
#2 0x0804aeeb in main (argc=12, argv=0xbfe38484) at dvbstream.c:1516
1516 poll(pfds,1,500);

If I kill dvbstream and reload it then all is fine, so it seems that maybe the card loses sync with the signal, and either dvbstream needs to retune the card, or perhaps the kernel driver should do that automatically.

When it crashes it looks like this:

Program received signal SIGSEGV, Segmentation fault. 0xb7ee153c in memcpy () from /lib/libc.so.6
(gdb) bt
#0 0xb7ee153c in memcpy () from /lib/libc.so.6
#1 0x08049714 in collect_section (section=0x815bef0, pusi=<value

     optimized out>, buf=0x3ffff59e <Address 0x3ffff59e out of bounds>,
     len=3221135360) at dvbstream.c:579

#2 0x0804b21b in main (argc=12, argv=0xbffe8084) at dvbstream.c:683

(gdb) fr 1
#1 0x08049714 in collect_section (section=0x815bef0, pusi=<value

     optimized out>, buf=0x3ffff59e <Address 0x3ffff59e out of bounds>,
     len=3221135360) at dvbstream.c:579

579 memcpy(&(section->buf[section->pos]), buf, len);

(gdb) fr 2
#2 0x0804b21b in main (argc=12, argv=0xbffe8084) at dvbstream.c:683
683 skip = collect_section(&(pmt->section), pusi, b, l);

It looks like the default CFLAGS do some optimisation - let me know if you need me to recompile it without this.

Cheers,
Adam.

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#3 lore raw
Quoted 18 lines · On Friday 21 March 2008 01:54:13 Adam Nielsen wrote:
Quoted 4 lines

I use it for hours, even forgetting that it's recording, without segfaults.
Try to run it under gdb (after having compiled it with -g) and see with "bt" where it segfaults, or bugs can't be fixed

What's your reception like? This particular card (DVico Fusion HDTV) seems to be somewhat less sensitive compared to my other cards, and I think getting corrupted data coming in is what breaks dvbstream. The recording itself is full of blips as if the reception is quite bad.

When the recording just stops (no crash) gdb doesn't seem to reveal anything amazing:

<Ctrl+C>
Program received signal SIGINT, Interrupt.
0xffffe410 in __kernel_vsyscall ()
(gdb) bt

Quoted 8 lines
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7ebf77b in poll () from /lib/libc.so.6
#2  0x0804aeeb in main (argc=12, argv=0xbfe38484) at

dvbstream.c:1516 (gdb) fr 2
#2 0x0804aeeb in main (argc=12, argv=0xbfe38484) at
dvbstream.c:1516 1516 poll(pfds,1,500);
(gdb) cont
Continuing.

poll() is used because the dvr device is opened in O_NONBLOCK mode, that can be replaced with the usual blocking mode (although if it makes a difference it's probably an indicator of a bug in the driver)

Quoted 15 lines

If I kill dvbstream and reload it then all is fine, so it seems that maybe the card loses sync with the signal, and either dvbstream needs to retune the card, or perhaps the kernel driver should do that automatically.

When it crashes it looks like this:

Program received signal SIGSEGV, Segmentation fault. 0xb7ee153c in memcpy () from /lib/libc.so.6
(gdb) bt
#0 0xb7ee153c in memcpy () from /lib/libc.so.6
#1 0x08049714 in collect_section (section=0x815bef0, pusi=<value

Quoted 4 lines
     optimized out>, buf=0x3ffff59e <Address 0x3ffff59e out of

bounds>, len=3221135360) at dvbstream.c:579 #2 0x0804b21b in main (argc=12, argv=0xbffe8084) at dvbstream.c:683

len is so big?? this must be an actual bug

Quoted 7 lines

(gdb) fr 1
#1 0x08049714 in collect_section (section=0x815bef0, pusi=<value

     optimized out>, buf=0x3ffff59e <Address 0x3ffff59e out of

bounds>, len=3221135360) at dvbstream.c:579
579 memcpy(&(section->buf[section->pos]), buf, len);

Quoted 9 lines

(gdb) fr 2
#2 0x0804b21b in main (argc=12, argv=0xbffe8084) at
dvbstream.c:683 683 skip = collect_section(&(pmt->section),
pusi, b, l);

It looks like the default CFLAGS do some optimisation - let me know if you need me to recompile it without this.

fortunately a peaceful easter of coding is coming :)

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#4 lore raw
Quoted 65 lines · On Friday 21 March 2008 09:52:01 Nico Sabbi wrote:
Quoted 18 lines · On Friday 21 March 2008 01:54:13 Adam Nielsen wrote:
Quoted 4 lines

I use it for hours, even forgetting that it's recording, without segfaults.
Try to run it under gdb (after having compiled it with -g) and see with "bt" where it segfaults, or bugs can't be fixed

What's your reception like? This particular card (DVico Fusion HDTV) seems to be somewhat less sensitive compared to my other cards, and I think getting corrupted data coming in is what breaks dvbstream. The recording itself is full of blips as if the reception is quite bad.

When the recording just stops (no crash) gdb doesn't seem to reveal anything amazing:

<Ctrl+C>
Program received signal SIGINT, Interrupt.
0xffffe410 in __kernel_vsyscall ()
(gdb) bt

Quoted 8 lines
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7ebf77b in poll () from /lib/libc.so.6
#2  0x0804aeeb in main (argc=12, argv=0xbfe38484) at

dvbstream.c:1516 (gdb) fr 2
#2 0x0804aeeb in main (argc=12, argv=0xbfe38484) at
dvbstream.c:1516 1516 poll(pfds,1,500);
(gdb) cont
Continuing.

poll() is used because the dvr device is opened in O_NONBLOCK mode, that can be replaced with the usual blocking mode (although if it makes a difference it's probably an indicator of a bug in the driver)

Quoted 13 lines

If I kill dvbstream and reload it then all is fine, so it seems that maybe the card loses sync with the signal, and either dvbstream needs to retune the card, or perhaps the kernel driver should do that automatically.

When it crashes it looks like this:

Program received signal SIGSEGV, Segmentation fault. 0xb7ee153c in memcpy () from /lib/libc.so.6
(gdb) bt
#0 0xb7ee153c in memcpy () from /lib/libc.so.6
#1 0x08049714 in collect_section (section=0x815bef0, pusi=<value

Quoted 4 lines
     optimized out>, buf=0x3ffff59e <Address 0x3ffff59e out of

bounds>, len=3221135360) at dvbstream.c:579 #2 0x0804b21b in main (argc=12, argv=0xbffe8084) at dvbstream.c:683

len is so big?? this must be an actual bug

Quoted 12 lines

(gdb) fr 1
#1 0x08049714 in collect_section (section=0x815bef0, pusi=<value

     optimized out>, buf=0x3ffff59e <Address 0x3ffff59e out of

bounds>, len=3221135360) at dvbstream.c:579
579 memcpy(&(section->buf[section->pos]), buf, len);

(gdb) fr 2
#2 0x0804b21b in main (argc=12, argv=0xbffe8084) at
dvbstream.c:683 683 skip = collect_section(&(pmt->section),
pusi, b, l);

Quoted 5 lines
Quoted 2 lines

It looks like the default CFLAGS do some optimisation - let me know if you need me to recompile it without this.

fortunately a peaceful easter of coding is coming :)

should be fixed in cvs

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#5 lore raw
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines

When it crashes it looks like this:

should be fixed in cvs

Thanks Nico! I'm testing it now - I'll let you know how I go.

I've also added some default settings for Australia, if you would like to add them to dvb_defaults.h:

#ifdef AUSTRALIA

/* AUSTRALIA settings */

#define DVB_T_LOCATION              "Australia"
#define BANDWIDTH_DEFAULT           BANDWIDTH_7_MHZ
#define HP_CODERATE_DEFAULT         FEC_3_4  /* SBS is FEC_2_3 */
#define CONSTELLATION_DEFAULT       QAM_64
#define TRANSMISSION_MODE_DEFAULT   TRANSMISSION_MODE_8K
#define GUARD_INTERVAL_DEFAULT      GUARD_INTERVAL_1_16
#define HIERARCHY_DEFAULT           HIERARCHY_NONE

#endif

I also got a few errors come up when I compiled, some of which may lead to other problems - I'm not sure whether this is because I'm running on 64-bit now or what.

tune.c: In function ‘tune_it’:
tune.c:254: warning: format ‘%d’ expects type ‘int’, but argument 8 has
type ‘long unsigned int’
tune.c:254: warning: format ‘%d’ expects type ‘int’, but argument 9 has
type ‘long unsigned int’
tune.c:254: warning: format ‘%d’ expects type ‘int’, but argument 10 has
type ‘long unsigned int’

dvbstream.c:483:1: warning: "setbit" redefined /usr/include/sys/param.h:45:1: warning: this is the location of the
previous definition

dvbstream.c: In function ‘parse_ts_packet’:
dvbstream.c:854: warning: control reaches end of non-void function

Cheers,
Adam.

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#7 lore raw
Quoted 1 line

Adam, please report if the version in cvs fixed your problems

Sorry Nico, yes, since testing your update I haven't had a single crash.
The card still drops the signal when the reception isn't great and
dvbstream doesn't realise that has happened, but as far as the crashes go the same programmes that used to have 15-20 crashes in them now have none!

Many thanks for fixing this!

Cheers,
Adam.

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb