stefantalpalaru / w_scan2

w_scan fork (channel scan tool which generates ATSC, DVB-C, DVB-S/S2 and DVB-T/T2 channels.conf files)
GNU General Public License v2.0
80 stars 22 forks source link

Find & output the LCN Logical Channel Number of DVB-T services #13

Closed tenzap closed 6 months ago

tenzap commented 4 years ago

Hello,

Would it be possible to support LCN (Logical Channel Number) with w_scan2 to order the channels corretly in the outputs ?

I'm using w_scan2 to create a list of tv channels to view through VLC with a USB rtl_sdr device on DVB-T in France.

w_scan2 finds the channels correctly, and I'm able to view them in vlc without a problem. But I would have expected that w_scan2 outputs the channel numbers as broadcasted.

I checked the source code and there is a function that seems to do that, but it doesn't really work as expected. I added this line to look what is happening in function "parse_logical_channel_descriptor" of descriptor.c, juste before the check of s==NULL

uint32_t logical_channel_number2;
logical_channel_number2 = (buf[p + 2] & 0x3F) << 8 | buf[p + 3];
info("LCN_TEST: %s %s %d: ServiceId: %d LogicalChannelNumber: %d\n",__FILE__,__FUNCTION__, __LINE__,service_id, logical_channel_number2);

I noticed that from all the services found (42), 10 are reported by this line, and among them, only 7 correspond to a found service. Moreover, for the TV services found, none actually gets its logical_channel_number set.

The command I used to search : ./w_scan2 -c FR -ft -R0 -v

You can find the output attached out3.gz

In Windows, with "Pouchin TV" (a french software) the logical channel number is found as soon as the channels of a same transponder are listed in the GUI (before swithcing to the next frequency to scan) The LCN seems to be handled in its source code in file parse.cpp line 253 (function parse_nit) Source code of pouchin tv is available here : http://www.pouchintv.fr/#L56

BTW, if that may help, here is a spec of descriptor 0x83 (not sure whether this is relevant and is line with the french implementation of LCN) https://tvheadend.org/issues/138

tenzap commented 4 years ago

In France, devices on the market are expected to conform to IEC/CENELEC 62216-1 (legal text : Arrêté du 27 décembre 2001 relatif aux caractéristiques des équipements de réception des services diffusés par voie hertzienne numérique terrestre)

eblanca commented 4 years ago

Subscribing to this topic, as this would actually be a very appreciated feature.

stefantalpalaru commented 6 months ago

Implemented in the "master" branch. Please test it.