After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 732643 - dvbcam: error witing TPDU (5): Input/output error afther being connected
dvbcam: error witing TPDU (5): Input/output error afther being connected
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.4.0
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-07-02 17:17 UTC by steven vanden branden
Modified: 2018-11-03 13:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstreamer trace (21.06 KB, application/octet-stream)
2014-07-02 17:17 UTC, steven vanden branden
Details
free to air log BVN (690.51 KB, application/octet-stream)
2014-07-22 08:01 UTC, steven vanden branden
Details
encrypted channel 'vier' log (136.48 KB, application/octet-stream)
2014-07-22 08:02 UTC, steven vanden branden
Details
encrypted channel 4 log complete (375.23 KB, application/octet-stream)
2014-07-22 08:46 UTC, steven vanden branden
Details
vier encrypted channel log (81.19 KB, text/plain)
2014-07-22 10:52 UTC, steven vanden branden
Details

Description steven vanden branden 2014-07-02 17:17:04 UTC
Created attachment 279792 [details]
gstreamer trace

when trying to use gstreamer to record video encrypted with a ci smartcard from tv  vlaanderen (dvb-s channel) the cam card gets connected and the slot gets defined , but a little later the connection gets input/output problems 

dvbcam camtransport.c:243:cam_tl_connection_write_tpdu: error witing TPDU (5): Input/output error


i use a tbs 5980 with a driver that is updated to latest git code. watching without the encryption works fine.

see stack trace (short version) with is run together with the gnome-dvb-deamon gst1.0 that is still in development.

 the following error also happens at some point before it:

0:07:44.121090623  5096 0x7f41f40034f0 ERROR                 dvbcam camapplication.c:334:session_data_cb: unexpected APDU length 20 expected 26

i also noticed that it opens 3 new sessions in the run? is this normal?

greetings
Steven
Comment 1 steven vanden branden 2014-07-02 17:18:20 UTC
i must add i had to increase the wait time between connecting attemps of the cam module to 1 sec because otherwise the cam module fails to start in time.
Comment 2 Edward Hervey 2014-07-03 05:49:51 UTC
alas there's no "safe" way to deal with the various CAM modules out there. Most take a very long time to respond, so the current behaviour is to retry at least 5 times at different intervals (and for the first tries you see that error/warning).

Can you try just with gst-launch ?
I'm not sure what the gnome-dvb-daemon is using/doing, but if they store/update the dvb-channels.conf, you could test it from the command line:

gst-launch-1.0 playbin uri="dvb://<channel_name>"

And provide GST_DEBUG=3,dvb*:6,cam*:6 logs for both an encrypted and unencrypted channel.
Comment 3 steven vanden branden 2014-07-03 08:23:28 UTC
how to define the location of the channels file (its in DVBv5 format) so i can use one in the local folder?
Comment 4 steven vanden branden 2014-07-18 13:10:51 UTC
can you please provide my the command to use to test this? and any files needed?
Comment 5 steven vanden branden 2014-07-18 13:26:55 UTC
this is what i get when running the above command. 
where do i have to put the DVB channel configuration file or how to find out?


gst-launch-1.0 playbin uri="dvb://SYFY"
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstURIDecodeBin:uridecodebin0: Couldn't find DVB channel configuration file
Additional debug info:
gsturidecodebin.c(1404): gen_source_element (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
No element accepted URI 'dvb://SYFY'
Setting pipeline to NULL ...
Freeing pipeline ...
Comment 6 steven vanden branden 2014-07-18 13:42:01 UTC
i debugged the code and found the path to put the channels file,

i have seen in the code that only zap files will work? or are dvbv5 files also supported? anyway i will test next week to see if i can get the log :p

bbasebin parsechannels.c:69:parse_channels_conf_from_file:<source> parsing '/home/steven/.config/gstreamer-1.0/dvb-channels.conf'
Comment 7 steven vanden branden 2014-07-22 08:01:09 UTC
Created attachment 281358 [details]
free to air log BVN
Comment 8 steven vanden branden 2014-07-22 08:02:09 UTC
Created attachment 281359 [details]
encrypted channel 'vier' log
Comment 9 steven vanden branden 2014-07-22 08:46:14 UTC
Created attachment 281366 [details]
encrypted channel 4 log complete
Comment 10 steven vanden branden 2014-07-22 08:57:40 UTC
i think this might be related to the problem:

 if (ioctl (fe_fd, FE_READ_STATUS, &status) ||
+      ioctl (fe_fd, FE_READ_SIGNAL_STRENGTH, &_signal) ||
+      ioctl (fe_fd, FE_READ_SNR, &snr) ||
+      ioctl (fe_fd, FE_READ_BER, &ber) ||
+      ioctl (fe_fd, FE_READ_UNCORRECTED_BLOCKS, &uncorrected_blocks)) {
+    GST_WARNING_OBJECT (src, "Failed to get statistics from the device");
+    return;
+  }

i guess that one (or more) of these fail so it gets the warning and returns, why and how to check i do not know, is htere a way (program) to run these commands (ioctl) manually or to see the return values?
Comment 11 steven vanden branden 2014-07-22 09:29:23 UTC
ok i adjusted the code and recompiledit

 its the ioctl (fe_fd, FE_READ_UNCORRECTED_BLOCKS, &uncorrected_blocks) that fails and that makes the method return over and over.

now i do not know where in the driver to find the problem?
Comment 12 steven vanden branden 2014-07-22 09:40:36 UTC
or is this not required for the good working of gstreamer? then we can just ingnore the uncorrected blocks and set them to 0 for example if the FE_READ_UNCORRECTED_BLOCKS is not implemented in the driver?
Comment 13 steven vanden branden 2014-07-22 10:52:34 UTC
Created attachment 281377 [details]
vier encrypted channel log

excuse me , but the channel info was not correct now it complains only about this:

dvbcam camtransport.c:237:cam_tl_connection_write_tpdu:[00m writing TPDU 82 (CREATE_T_C) connection 1 (size:5)
dvbcam camtransport.c:243:cam_tl_connection_write_tpdu:[00m error witing TPDU (22): Ongeldig argument
dvbcam camtransport.c:370:cam_tl_create_connection:[00m Failed sending initial connection message .. but retrying
Comment 14 steven vanden branden 2014-07-22 11:25:40 UTC
i figured out it takes more then 3 seconds for the cam to get in working state:

this was done with also raising the wait time to 1 sec , ill check if the 1 second had influence or not.

see maybe the timeout should be raised to about 5 seconds?
Comment 15 steven vanden branden 2014-07-22 11:38:50 UTC
it goes well with the normal retry mode but only 5 seconds total instead of 2.5

but new problem comes up:

dvbcam camapplication.c:334:session_data_cb: unexpected APDU length 20 expected 26

afther that every time this :

dvbcam camtransport.c:500:cam_tl_read_all: error reading TPDU from module: -12
 -->CAM_RETURN_TRANSPORT_TIMEOUT

raising the polling to 1 sec and the read timout to 5 sec changes nothing.

should i try lowering it?

so the error starts with a APDU thats too short? afther that every read fails.
Comment 16 Reynaldo H. Verdejo Pinochet 2014-08-22 23:41:12 UTC
(In reply to comment #6)
> i debugged the code and found the path to put the channels file,
> 
> i have seen in the code that only zap files will work? or are dvbv5 files also
> supported? anyway i will test next week to see if i can get the log :p
> [..]

The channels.conf parsing code can only deal with ZAP formated
files right now. Adding dvbv5 format support is on my TODO but
I haven't get around doing it yet. Also, watch out for GStreamer
having problems parsing your ZAP formatted conf, as there
are multiple variations among scanning tools and while the
order of the parameters seems to be usually the same for DVB-S
the value units change.
Comment 17 Reynaldo H. Verdejo Pinochet 2014-08-22 23:43:37 UTC
(In reply to comment #5)
> this is what i get when running the above command. 
> where do i have to put the DVB channel configuration file or how to find out?
> [..]

You can set the GST_DVB_CHANNELS_CONF env var at launch time
to specify where your channels.conf file is located.
Comment 18 Reynaldo H. Verdejo Pinochet 2014-08-22 23:58:15 UTC
(In reply to comment #10)
> i think this might be related to the problem:
> 
>  if (ioctl (fe_fd, FE_READ_STATUS, &status) ||
> +      ioctl (fe_fd, FE_READ_SIGNAL_STRENGTH, &_signal) ||
> +      ioctl (fe_fd, FE_READ_SNR, &snr) ||
> +      ioctl (fe_fd, FE_READ_BER, &ber) ||
> +      ioctl (fe_fd, FE_READ_UNCORRECTED_BLOCKS, &uncorrected_blocks)) {
> +    GST_WARNING_OBJECT (src, "Failed to get statistics from the device");
> +    return;
> +  }
> 
> i guess that one (or more) of these fail so it gets the warning and returns,
> why and how to check i do not know, is htere a way (program) to run these
> commands (ioctl) manually or to see the return values?

Are you actually getting this warning? I don't see it in your log.

Whatever the case the block you pasted from _output_frontend_stats()
does needs some work. Those ioctl need to wrapped around LOOP_WHILE_EINTR
(as they can a do return EINTR from time to time) for example but
I'm pretty sure this is not the reason for your failure. Don't take
my word for granted though and try commenting out the calls to
gst_dvbsrc_output_frontend_stats () and see for yourself. You should
see no difference.
Comment 19 steven vanden branden 2014-08-23 06:28:05 UTC
thanks for your input here but i must say the only error appearing now (afther changing to correct zap file and increasing the times trying) is this one

it goes well with the normal retry mode but only 5 seconds total instead of 2.5

but new problem comes up:

dvbcam camapplication.c:334:session_data_cb: unexpected APDU length 20 expected
26

afther that every time this :

dvbcam camtransport.c:500:cam_tl_read_all: error reading TPDU from module: -12
 -->CAM_RETURN_TRANSPORT_TIMEOUT


so the error starts with a APDU thats too short? afther that every read fails.
Comment 20 GStreamer system administrator 2018-11-03 13:24:38 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/157.