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 765731 - dvbsrc: DVB-T2 tuning failure
dvbsrc: DVB-T2 tuning failure
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.9.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-28 14:56 UTC by Russel Winder
Modified: 2016-10-31 14:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
DVBv3 format channels file. (23.01 KB, text/plain)
2016-04-28 14:56 UTC, Russel Winder
  Details
WinTV SD log (1.95 MB, application/x-xz)
2016-04-28 14:57 UTC, Russel Winder
  Details
WinTV HD Log (244.60 KB, application/x-xz)
2016-04-28 14:58 UTC, Russel Winder
  Details
PC-TV SD Log (1.59 MB, application/x-xz)
2016-04-28 14:58 UTC, Russel Winder
  Details
PC-TV HD Log (252.83 KB, application/x-xz)
2016-04-28 14:58 UTC, Russel Winder
  Details
PC-TV HD Log 2016-05-09 11:30 (1.05 MB, application/x-xz)
2016-05-09 11:32 UTC, Russel Winder
  Details
dvb/parsechannels: do not guess delsys at zap parsing (2.09 KB, patch)
2016-05-11 23:43 UTC, Reynaldo H. Verdejo Pinochet
none Details | Review
dvb: fix autodetection and tuning of DVB-T2 broadcasts (8.92 KB, patch)
2016-05-13 09:16 UTC, Reynaldo H. Verdejo Pinochet
none Details | Review
PC Tv 292e HD 2016-05-14 (3.16 MB, application/x-xz)
2016-05-14 08:08 UTC, Russel Winder
  Details
PC TV 292e SD 2016-05-14 (1.18 MB, application/x-xz)
2016-05-14 08:08 UTC, Russel Winder
  Details
dvb: fix autodetection and tuning of DVB-T2 broadcasts (9.97 KB, patch)
2016-05-15 08:28 UTC, Reynaldo H. Verdejo Pinochet
committed Details | Review

Description Russel Winder 2016-04-28 14:56:44 UTC
Created attachment 326949 [details]
DVBv3 format channels file.

As requested on the email list, a bug report :-)

I have two USB adapters that support HD: WinTV-soloHD and PC-TV 292e. I am not sure what version information I can get and is appropriate.

I have provided outputs for "BBC NEWS" (SD channel) and "BBC NEWS HD" (HD channel) for both of them to show they behave the same.
Comment 1 Russel Winder 2016-04-28 14:57:42 UTC
Created attachment 326950 [details]
WinTV SD log
Comment 2 Russel Winder 2016-04-28 14:58:05 UTC
Created attachment 326951 [details]
WinTV HD Log
Comment 3 Russel Winder 2016-04-28 14:58:31 UTC
Created attachment 326952 [details]
PC-TV SD Log
Comment 4 Russel Winder 2016-04-28 14:58:54 UTC
Created attachment 326953 [details]
PC-TV HD Log
Comment 5 Reynaldo H. Verdejo Pinochet 2016-05-04 07:03:14 UTC
The parsing logic is wrongly assuming DVB-T for your T2 channels
(delsys property) and this is leading to a tuning failure for your
hd ones. I will see whether I can add some logic to switch to T2
based on the parsed parameters, but in the mean time, you have a
couple of options to help debug this further:

1.- Forcibly set delsys to 16 (DVB-T2) in your code, see if it
flies :)

2.- Try with Thiago's dvbv5 parsing code from #764957 This will
likely be pushed to master soon and we can really use some help
testing different delivery system paths (you need to apply both
patches and use a dvbv5 formated channels.conf file)

2.- Build a manual pipeline around dvbsrc setting delsys=16
and confirm we are on the right path.

Thanks for your help!
Comment 6 Reynaldo H. Verdejo Pinochet 2016-05-06 23:35:09 UTC
Hey Russel, I pushed some improvements to the delsys
autodetection logic today and included a rule to select
DVB-T2 for QAM_256 (not supported by DVB-T). Can you
give it a try and report back?

Module: gst-plugins-bad
Branch: master
Commit: 5b1191cb4c08e17c56a097e9ed1ed58becb2bb93
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=5b1191cb4c08e17c56a097e9ed1ed58becb2bb93

Author: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Date:   Wed May  4 16:32:19 2016 -0700

dvbsrc: smarten-up delsys autodetection logic
Comment 7 Russel Winder 2016-05-07 09:48:35 UTC
I rebuilt all the GStreamer repositories this morning (my script automatically pulls, so yes I am up to date :-), but no joy.

Is there a way of knowing which plugin is being used so as to know that it is the newly built one and not the one from the system installation (which is not going to work until a new version is in Debian and Fedora). 

In the interim I will try forcing delsys to T2 and see what happens.
Comment 8 Tim-Philipp Müller 2016-05-07 10:02:22 UTC
gst-inspect-1.0 dvbsrc | grep -i -e file -e date
Comment 9 Russel Winder 2016-05-07 10:15:52 UTC
|> gst-inspect-1.0 dvbsrc | grep -i -e file -e date
  Filename                 /home/users/russel/Built/lib/gstreamer-1.0/libgstdvb.so
  Source release date      2016-05-07 08:31 (UTC)

|> gst-launch-1.0 playbin uri="dvb://BBC NEWS HD"
Setting pipeline to PAUSED ...
0:00:10.032992139 12106      0x23cccf0 ERROR                 dvbsrc gstdvbsrc.c:1980:gst_dvbsrc_start:<dvbsrc0> Not able to lock on to the dvb channel
ERROR: Pipeline doesn't want to pause.
Setting pipeline to NULL ...
Freeing pipeline ...

(gst-launch-1.0:12106): GLib-GObject-CRITICAL **: g_object_get: assertion 'G_IS_OBJECT (object)' failed
Caught SIGSEGV
Comment 10 Russel Winder 2016-05-07 14:57:21 UTC
Sadly it is going to be fairly impossible to sensible test this with the Me TV code per se. So I guess using gst-launch-1.0 is the only way forward. Is there a place I can pick up a reasonable command line to run a dvbsrc plugin without letting playbin be in charge?
Comment 11 Reynaldo H. Verdejo Pinochet 2016-05-09 07:50:14 UTC
Hi Russel, thanks for trying out. Can you please attach
a debug log for the playbin run you used on comment #9?
I think it might still be selecting DVB-T but would like
to confirm. Thank you.
Comment 12 Russel Winder 2016-05-09 11:04:44 UTC
Testing with a newly built GStreamer:

|> gst-inspect-1.0 dvbsrc | grep -i -e file -e date
  Filename                 /home/users/russel/Built/lib/gstreamer-1.0/libgstdvb.so
  Source release date      2016-05-09 06:39 (UTC)

and the log using the command in 9 but with lots more logging to be attached shortly.
Comment 13 Russel Winder 2016-05-09 11:32:54 UTC
Created attachment 327508 [details]
PC-TV HD Log 2016-05-09 11:30

Using the newer version of dvbsrc, attempt to tune to an HD channel.
Comment 14 Reynaldo H. Verdejo Pinochet 2016-05-11 23:43:48 UTC
Created attachment 327669 [details] [review]
dvb/parsechannels: do not guess delsys at zap parsing

Can you give this one a try over an
up-to-date copy of master and report
back with a debug log please? Your
last ones still show a wrong delsys
auto selection being made. We might
still need to tweak the T2 parameter
set up so don't feel too bad if it
still fails :)

Thank you!
Comment 15 Russel Winder 2016-05-12 10:06:15 UTC
Applying the patch causes no channel to be tunable: SD channels fail to tune exactly as HD channels.

Assuming I applied it correctly, I thought I had, the post application diff looked identical.

Reverting the patch returns to SD tunability but no HD tunability.
Comment 16 Reynaldo H. Verdejo Pinochet 2016-05-12 18:41:43 UTC
OK, I know whats going on. I will work on an updated
patch but in the mean time, it would be nice if you
can attach a debug log of (at least) the failing SD
tuning so I can confirm. Thank you.
Comment 17 Reynaldo H. Verdejo Pinochet 2016-05-13 09:16:38 UTC
Created attachment 327767 [details] [review]
dvb: fix autodetection and tuning of DVB-T2 broadcasts

Please try this new patch on top of -bad's current head, it has been
squashed from separate changes on my local tree that aim to improve
delsys autodetection. Make sure you try both your SD and HD broadcasts
and attach debug logs of both runs here for further inspection. Your
problem is two folded, misdetection of DVB-T2 broadcasts as DVB-T and
quite probably a malformed FE_SET_PROPERTY ioctl for the former. This
patch mostly deals with the misdetection so while it might not solve
your problem completely it should bring us an step closer.
Comment 18 Russel Winder 2016-05-14 08:06:48 UTC
With the Git repository fully up to date SD works and HD fails as previously. Apply only 327767 and not the early patch results in HD working and SD failing. So there is clearly an indicator here of something that will result in both SD and HD working! Log files will be appended shortly.
Comment 19 Russel Winder 2016-05-14 08:08:11 UTC
Created attachment 327856 [details]
PC Tv 292e HD 2016-05-14
Comment 20 Russel Winder 2016-05-14 08:08:49 UTC
Created attachment 327857 [details]
PC TV 292e SD 2016-05-14
Comment 21 Reynaldo H. Verdejo Pinochet 2016-05-15 08:28:48 UTC
Created attachment 327917 [details] [review]
dvb: fix autodetection and tuning of DVB-T2 broadcasts

Hi, thanks for testing. Attached patch should sort out
the issue. The main problem here is some DVB-T
parameter-sets also describe perfectly valid DVB-T2
broadcasts. Approach is to set the delivery system
to DVB-T in those cases and only set delsys to DVB-T2
when we are absolutely sure it can't be the former
(like when QAM_256 is required).

Please test and report back, make sure to include debug
logs for sd and hd channels if further debugging ends
up being required. Remember to apply the patch over a fresh
master head.
Comment 22 Russel Winder 2016-05-15 12:16:53 UTC
Looks like both BBC NEWS and BBC NEWS HD play fine with this patch applied to master 044ed50190a756a83f2b7c26bfd2d49c4b5e448e using gst-launch-1.0 playbin anyway…

Building Me TV and running it, SD fails and HD works. I am not sure how best to sort this out. I need first to ensure correct libraries being used and if the problem persists, get appropriate debugging logs.

I'll report back with more news when I have it.
Comment 23 Russel Winder 2016-05-15 13:42:42 UTC
Seems to have been a glitch of unattributable cause. From what I can tell Me TV is now handling HD as well as SD.

However I think there is an indication that GStreamer is not handling low signals strengths as well as dvbv5-zap: dvbsrc is failing to lock at signal strengths dvbv5-zap is happy to lock. This is though a completely different issue and so belongs elsewhere.

What might be connected is that dvbsrc is not always able to lock when changing from one channel to another whereas is it can when trying for the first time. Again though this is not directly connected to the problem of this bug report.

I'd say this change should be committed and this bug closed.
Comment 24 Reynaldo H. Verdejo Pinochet 2016-05-15 18:02:49 UTC
Thanks for trying this out and confirming it works. I will be
pushing these soon. Regarding unstable locking / tuning problems
please open a new bug report as you see fit, I'm currently working
on this code so I should be able to react quick enough. Again,
Thanks for your help in getting this fixed.
Comment 25 Reynaldo H. Verdejo Pinochet 2016-05-16 00:19:08 UTC
Review of attachment 327917 [details] [review]:

Pushed a modified patch as a part of the changeset that prepared
this solution to be possible:

commit 10b020095ba4a11834f919dfcaa5b154c6ea7bdf
Author: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Date:   Sun May 15 00:41:12 2016 -0700

    dvbsrc: special case detection when DVB-T and T2 seem valid
    
    There is no way to tell one over the other when parameters
    seem valid for DVB-T and DVB-T2 and the adapter supports
    both. Reason to go with the former here is that, from
    experience, most DVB-T2 channels out there seem to use
    parameters that are not valid for DVB-T, like QAM_256
Comment 26 Reynaldo H. Verdejo Pinochet 2016-05-16 00:24:56 UTC
This is working now but we need to keep in mind that autodetecting
the delivery system is not 100% accurate and we need to move
to (additionally) support dvbv5 channels.conf format so autodetection
becomes unnecessary. There's a patch for this already:

https://bugzilla.gnome.org/show_bug.cgi?id=764957
Comment 27 Russel Winder 2016-05-16 05:58:16 UTC
Just to confirm some success: Me TV (which is really just a playbin-based application can now show DVB-T and DVB-T2 channels. However, there is usually what is reported as a tuning lock fail, if the playbin is "retuned", i.e. the playbin is stopped, an new mrl set, and the playbin started. This could be bad use of playbin, or it could be a problem in playbin or dvbsrc. This cannot be investigated using gst-play-1.0, and Me TV is not an appropriate test for this, so a small C application has to be written to show the error and be the test. Once this test code is written and the problem can be reliably reproduced I'll post a bug report.
Comment 28 Reynaldo H. Verdejo Pinochet 2016-05-16 06:31:14 UTC
Hi Russel, thanks for the follow up. I'd suggest starting by writing
a gst-validate scenario over dvbsrc (writing to fakesink) to change
channels, see how that works and iterate over by adding the rest of
the elements we are interested in. This should make a lot easier to
isolate where the problem is.
Comment 29 Russel Winder 2016-05-16 07:40:04 UTC
It turns out the problem is very simple. Switching from one SD channel to another is fine, switching from one HD channel to another is fine. Switching from SD to HD or HD to SD causes a tuning fail and crash. I guess it is now time for a new bug report.
Comment 30 Russel Winder 2016-05-16 07:47:11 UTC
Re Comment 29 I have created https://bugzilla.gnome.org/show_bug.cgi?id=766501