DVB has an optional descriptor (tag 0x83) that contains a Logical channel number, as well as a 'visible' bit, for the various services (channels) in a stream. Parsing and using these would greatly improve the ability of a DVB scan to match up with the EPG data, since it appears that the LCN's in the broadcast (at least in the requester's London market) do match the numbers that Schedules Direct provides.
As far as I can tell, a DVB scan currently is returning
onid-tsid-sid-idx(name)broadcastType;9018-12294-14576-1(ADULT Studio 66)DVB-T;
where:
onid = Original Network ID (9018)
tsid = Transport Stream ID (12294)
sid = Service ID (14576)
idx = index number (1)
name = Channel Name (ADULT Studio 66)
broadcastType = Broadcast Type (DVB-T)
the issue is that idx is just a relatively arbitrary number, simply incrementing from 1 for each channel the scan finds and adds to it's list (the above example was the first channel found in his scan). Instead of the index, we need to lookup the logical channel number, in the 0x83 descriptor if available, and pass THAT as the 4th parameter in the scanresult. The same LCN descriptor contains a bit that sets whether a service should be visible or not. I think we should throw out channels that are explicitly marked as non-visible.
Unfortunately, this is handled in the native tuner code, and I am VERY weak on .c. I'm pretty sure on some of the steps, but the code jumps around a lot between different files. I'm think we need to do at least the following:
In native/ax/Channel-2/Channel.h:
add a couple items to the CHANNEL_DATA struct:
int32_t visible; //-1=unknown, 0=not-visible, 1=visible
int32_t logicalNum; // -1= unknown, >0=logical channel number to show in guide
In native/ax/Channel-2/Channel.c:
add some code to skip over channels with visible=0, and make a log entry to such.
search through the NIT associated with the stream/channel to find if any LCN entries match the currently looked at service, and if so, set the visible and logicalNum properties of the channel.
if logicalNum >0 then use that instead of index when building scanresult.
In native/ax/Native2.0/NativeCore/DVBPSIParser.c
add some code to parse out the LCN table in UnpackNIT, and add a LCN Table to the nit object.
Currently, the scanresult is being generated prior to the NIT being looked up, so that would also have to change, sicne the NIT parsing would need to be done prior.
I would really like to get this done. DVB regions have always had to do so much manual manipulation to get their channels setup anyway, due to the EPG situations over there, but with good EPG data now, they really SHOULDN'T have to do that. I think this could help quite a bit.
from request here: https://forums.sagetv.com/forums/showthread.php?p=597380&postcount=130
DVB has an optional descriptor (tag 0x83) that contains a Logical channel number, as well as a 'visible' bit, for the various services (channels) in a stream. Parsing and using these would greatly improve the ability of a DVB scan to match up with the EPG data, since it appears that the LCN's in the broadcast (at least in the requester's London market) do match the numbers that Schedules Direct provides.
As far as I can tell, a DVB scan currently is returning onid-tsid-sid-idx(name)broadcastType;9018-12294-14576-1(ADULT Studio 66)DVB-T; where: onid = Original Network ID (9018) tsid = Transport Stream ID (12294) sid = Service ID (14576) idx = index number (1) name = Channel Name (ADULT Studio 66) broadcastType = Broadcast Type (DVB-T)
the issue is that idx is just a relatively arbitrary number, simply incrementing from 1 for each channel the scan finds and adds to it's list (the above example was the first channel found in his scan). Instead of the index, we need to lookup the logical channel number, in the 0x83 descriptor if available, and pass THAT as the 4th parameter in the scanresult. The same LCN descriptor contains a bit that sets whether a service should be visible or not. I think we should throw out channels that are explicitly marked as non-visible.
Unfortunately, this is handled in the native tuner code, and I am VERY weak on .c. I'm pretty sure on some of the steps, but the code jumps around a lot between different files. I'm think we need to do at least the following: In native/ax/Channel-2/Channel.h:
In native/ax/Channel-2/Channel.c:
In native/ax/Native2.0/NativeCore/DVBPSIParser.c
Currently, the scanresult is being generated prior to the NIT being looked up, so that would also have to change, sicne the NIT parsing would need to be done prior.
I would really like to get this done. DVB regions have always had to do so much manual manipulation to get their channels setup anyway, due to the EPG situations over there, but with good EPG data now, they really SHOULDN'T have to do that. I think this could help quite a bit.