Bug #2605
Freeview LCNs not picked up
100%
Description
Not all of my Freeview services are being assigned LCNs - only the HD (DVB-T2) channels get numbered.
Where I live, 3 transmitters provide services: Dover, Heathfield and Bluebell Hill. My aerial is pointed at and tuned to Dover (C/D group). Despite this, I can usually pick up 2 muxes from Heathfield, even with the aerial pointing about 180 deg away from it, and it looks like I'm getting some signal from Bluebell Hill as well (about 90 deg off the aerial axis).
Bluebell Hill signal is not strong enough to receive services but I do seem to be getting metadata from there. If I run dvbsnoop while tvh is scanning Dover muxes, the NITs for SD muxes all report the Bluebell Hill frequencies. The NIT for the HD mux doesn't report any frequencies (as decoded by dvbsnoop). Something seems to be stopping me getting NITs from Dover - either a bug in tvh or tvh not being able to compensate for a bug elsewhere (in the driver?) I'm assuming tvh is rejecting the Bluebell Hill NITs because they have the wrong frequency, albeit with the same transport stream and network IDs as Dover.
If it's relevant, I'm not getting any signal strength or quality figures from the dongle (August T210).
Files
History
Updated by Jaroslav Kysela almost 10 years ago
Provide '--trace nit,sdt,bat' for the mux without LCNs...
Updated by Graham H almost 10 years ago
Jaroslav Kysela wrote:
Provide '--trace nit,sdt,bat' for the mux without LCNs...
I tried this but failed. I can't seem to stop tvh - it keeps restarting immediately.
Updated by Graham H almost 10 years ago
OK. stopped it but now what?
tvheadend --trace nit,sdt,bat > logfile doesn't produce anything
Updated by Jaroslav Kysela almost 10 years ago
You should compile tvh with --enable-trace . It's not available in packages.
Updated by Graham H almost 10 years ago
OK. Here you go.
Frequecies: uk-Dover
Network Discovery off
Skip Initial Scan on
Idle Scan on
Bluebell Hill frequencies are:
C46 674MHz PSB1/BBCA 20kW 64QAM All BBC TV and radio
C43 650MHz PSB2/D3+4 20kW 64QAM Basic ITV, channel 4 and 5
C40+ 686.167MHz PSB3/BBCB 20kW 256QAM HD channels
C45 666MHz COM4/SDN 20kW 64QAM Various TV and radio
C39+ 618.167MHz COM5/ArqA 20kW 64QAM Various TV and radio
C54 738MHz COM6/ArqB 20kW 64QAM Various TV and radio
C32 562MHz COM7 4kW 256QAM Extra HD, BBC4 etc.
Many thanks for the prompt responses
Updated by Jaroslav Kysela almost 10 years ago
... subscription: 000F: "epggrab" subscribing to mux, weight: 3, adapter: "Silicon Labs Si2168 : DVB-T #0", network: "Dover", mux: "730MHz", hostname: "<N/A>", username: "<N/A>", client: "<N/A>" 2015-01-07 17:28:36.978 [ DEBUG]:sdt: onid 233A (9018) tsid 104C (4172) 2015-01-07 17:28:36.978 [ DEBUG]:sdt: sid 104C (4172) running 4 free_ca 0 2015-01-07 17:28:36.978 [ TRACE]:sdt: dtag 48 dlen 17 2015-01-07 17:28:36.978 [ TRACE]:sdt: dtag 73 dlen 12 2015-01-07 17:28:36.978 [ TRACE]:sdt: type 01 (1) name [BBC ONE S East] provider [] def_auth [fp.bbc.co.uk] 2015-01-07 17:28:39.952 [ TRACE]:nit: dtag 5F dlen 4 2015-01-07 17:28:39.952 [ TRACE]:nit: private 0000233A 2015-01-07 17:28:39.952 [ TRACE]:nit: dtag 83 dlen 84 2015-01-07 17:28:39.952 [ DEBUG]:nit: sid 4172 lcn 1
So you should have LCN for "BBC ONE S East" set to 1 . I see LCNs for all received channels.
Updated by Graham H almost 10 years ago
- File tvheadendChannels.png tvheadendChannels.png added
Yes the LCNs are there in the stream but they are not in the Channel/EPG table (see attached). BTW you have missed out the line directly above dtag 5F dlen 4:
2015-01-07 17:28:39.952 [ DEBUG]:nit: DVBT freq 674000000 bw 8MHz cons QAM/64 hier NONE code_rate 2/3:AUTO guard 1/32 trans 8k
2015-01-07 17:28:39.952 [ TRACE]:nit: dtag 5F dlen 4
2015-01-07 17:28:39.952 [ TRACE]:nit: private 0000233A
2015-01-07 17:28:39.952 [ TRACE]:nit: dtag 83 dlen 84
2015-01-07 17:28:39.952 [ DEBUG]:nit: sid 4172 lcn 1
If I understand you correctly this NIT is being broadcast on 730MHz but here's a part associated with 674MHz, which is not a Dover frequency. Does tvh take any notice of that delivery system descriptor? I couldn't find any dsds with Dover frequencies in the log, hence my theory above. The LCNs for HD channels do not have a dsd, but seem to be identified by a mux ID, eg at line 2201:
2015-01-07 17:23:58.552 [ DEBUG]:nit: onid 233A (9018) tsid 4083 (16515) mux 0x9209370
2015-01-07 17:23:58.552 [ TRACE]:nit: dtag 41 dlen 21
2015-01-07 17:23:58.552 [ DEBUG]:nit: service 4440 (17472) type 19 (25)
2015-01-07 17:23:58.552 [ DEBUG]:nit: service 4500 (17664) type 19 (25)
2015-01-07 17:23:58.552 [ DEBUG]:nit: service 4484 (17540) type 19 (25)
2015-01-07 17:23:58.552 [ DEBUG]:nit: service 44C3 (17603) type 19 (25)
2015-01-07 17:23:58.552 [ DEBUG]:nit: service 4600 (17920) type 19 (25)
2015-01-07 17:23:58.552 [ DEBUG]:nit: service 46C0 (18112) type 19 (25)
2015-01-07 17:23:58.552 [ DEBUG]:nit: service 4F80 (20352) type 16 (22)
2015-01-07 17:23:58.552 [ TRACE]:nit: dtag 7F dlen 4
2015-01-07 17:23:58.552 [ TRACE]:nit: dtag 5F dlen 4
2015-01-07 17:23:58.552 [ TRACE]:nit: private 0000233A
2015-01-07 17:23:58.552 [ TRACE]:nit: dtag 83 dlen 28
2015-01-07 17:23:58.552 [ DEBUG]:nit: sid 18112 lcn 123
2015-01-07 17:23:58.552 [ DEBUG]:nit: sid 17603 lcn 103
2015-01-07 17:23:58.552 [ DEBUG]:nit: sid 17920 lcn 105
2015-01-07 17:23:58.552 [ DEBUG]:nit: sid 20352 lcn 45
2015-01-07 17:23:58.552 [ DEBUG]:nit: sid 17540 lcn 101
2015-01-07 17:23:58.552 [ DEBUG]:nit: sid 17472 lcn 102
2015-01-07 17:23:58.552 [ DEBUG]:nit: sid 17664 lcn 104
so there can be no confusion about whether these LCNs are relevant to this broadcast. It's puzzling as to why Dover (and Heathfield, I think) are broadcasting information about Bluebell Hill frequencies, but if that's the problem, I hope it can be sorted out.
Updated by Jaroslav Kysela almost 10 years ago
Graham Horner wrote:
Yes the LCNs are there in the stream but they are not in the Channel/EPG table (see attached). BTW you have missed out the line directly above dtag 5F dlen 4:
2015-01-07 17:28:39.952 [ DEBUG]:nit: DVBT freq 674000000 bw 8MHz cons QAM/64 hier NONE code_rate 2/3:AUTO guard 1/32 trans 8k
It's not relevant. These mux parameters are for other muxes (not for the current mux). It's for the fast auto-discovery. The subscription line shows which mux is tuned.
Do you see LCNs in the service grid (configuration) ?
The LCN should be associated to service in src/input/mpegts/dvb_psi.c line 457 .
Updated by Graham H almost 10 years ago
- File tvheadendServices.png tvheadendServices.png added
Jaroslav Kysela wrote:
Do you see LCNs in the service grid (configuration) ?
No. See attached. BTW it's 3.9.2328~g6605d5e I'm using.
Updated by Graham H almost 10 years ago
Jaroslav Kysela wrote:
It's not relevant. These mux parameters are for other muxes (not for the current mux). It's for the fast auto-discovery. The subscription line shows which mux is tuned.
I'm sorry, my c is a bit rusty, and I don't have an IDE set up, but I think it is relevant. When you get to the dsd referring to 674MHz, mux is pointed to that at line 1461 of dvb_psi.c. It then finds the services, but presumably doesn't store them because Network discovery is turned off. When it gets to the LCNs, seems to me it can't find a matching service at line 449.
This morning I turned Network discovery on, and sure enough LCNs were found for all the Bluebell Hill services, but the Dover service LCNs remain blank (0).
Updated by Jaroslav Kysela almost 10 years ago
I see. You're right. TSID 4192 is in both SDT and NIT tables, although NIT table shows another mux on different frequency. Perhaps, there some wrong tsid check.
Could you add mpegts to trace (--trace nit,sdt,bat,mpegts) to monitor TSID changes for a mux ?
Updated by Graham H almost 10 years ago
Jaroslav Kysela wrote:
Could you add mpegts to trace (--trace nit,sdt,bat,mpegts) to monitor TSID changes for a mux ?
Attached. Network discovery off.
FWIW, I was playing around earlier and I think I had some success with this little hack. I don't know enough about your code generally to know if I'm using the right symbols, but maybe you get the idea:
lcn:;
int found = 0;
if (dvb_desc_local_channel(mt->mt_name, dptr, dlen, dtag, mux, bi))
found = 1;>mt_name, dptr, dlen, dtag, mtmux, bi)) // where *mtmux = mt->mt_mux
if (dvb_desc_local_channel(mt
found = -1;
return found;
break;
It should work if all the LCNs are broadcast on all the muxes, which I think is true from the attached log. I got it to populate services on two of the Dover muxes before scans started failing. It may be you have to cycle through all the muxes on the transmitter(s) you are interested in and allocate each LCN to any and all corresponding sids you find.
Updated by Jaroslav Kysela almost 10 years ago
I don't see any problem. All muxes are allocated except one for tsid 0xA000 (40960). OK, basically, I don't know where to look, because I don't know which LCNs are missing.
Could we start again with one mux where the services have missing LCNs ? Just start with an empty config, configure only one mux (one which have services with completely missing LCNs) and try to scan it multiple times (if you edit the mux, you can set the scan status to pending multiple times to force new scan).
Updated by Graham H almost 10 years ago
- File logfile8 logfile8 added
- File logfile7 logfile7 added
- File tvheadend.zip tvheadend.zip added
OK, here are 3 files. Logfile7 is from re-starting tvh to the end of the first scan. I deleted all services and muxes through the web interface, loaded up the uk-Dover frequencies file and deleted all but one mux then enabled the adapter. Logfile8 is after re-starting tvh and several scans as you asked. The zip is all the config files after the first scan. None of the services have been given LCNs. These files were identical after several more scans except for the one file in epggrab/otamux, where the only difference was in the 'complete' line.
HTH
Updated by Jaroslav Kysela almost 10 years ago
OK. We have SDT (tableid 42 = current mux) for onid 9018 tsid 4172. There is also service is service with id 4172 (BBC ONE S East). In nit table, there is also service 4172 with lcn 1 for onid 9018 tsid 4172. So everything should be straight and the code in dvb_psi.c - function dvb_desc_local_channel() line 457 should be called, but appearently it isn't.
2015-01-08 22:21:11.005 [ INFO]:subscription: 0001: "scan" subscribing to mux, weight: 4, adapter: "Silicon Labs Si2168 : DVB-T #0", network: "Dover one mux", mux: "706MHz", hostname: "<N/A>", username: "<N/A>", client: "<N/A>" 2015-01-08 22:21:12.690 [ TRACE]:sdt: pid 11 tableid 42 extraid 00000000233a104c len 724 2015-01-08 22:21:12.694 [ DEBUG]:sdt: onid 233A (9018) tsid 104C (4172) 2015-01-08 22:21:12.695 [ TRACE]:mpegts: 706MHz in Dover one mux - set onid 233A (9018) 2015-01-08 22:21:12.695 [ DEBUG]:sdt: sid 104C (4172) running 4 free_ca 0 2015-01-08 22:21:12.695 [ TRACE]:sdt: dtag 48 dlen 17 2015-01-08 22:21:12.695 [ TRACE]:sdt: dtag 73 dlen 12 2015-01-08 22:21:12.695 [ TRACE]:sdt: type 01 (1) name [BBC ONE S East] provider [] def_auth [fp.bbc.co.uk] 2015-01-08 22:21:12.695 [ TRACE]:sdt: type changed / old 01 (1) 2015-01-08 22:21:12.695 [ TRACE]:sdt: cridauth changed 2015-01-08 22:21:12.695 [ TRACE]:sdt: name changed 2015-01-08 22:21:12.695 [ DEBUG]:sdt: nicename Dover one mux/706MHz/BBC ONE S East 2015-01-08 22:21:13.010 [ DEBUG]:nit: network 3032 (12338) [South East] 2015-01-08 22:21:13.010 [ DEBUG]:nit: onid 233A (9018) tsid 104C (4172) mux 0xb6604df0 2015-01-08 22:21:13.010 [ TRACE]:nit: dtag 41 dlen 63 2015-01-08 22:21:13.010 [ DEBUG]:nit: service 104C (4172) type 01 (1) 2015-01-08 22:21:13.010 [ DEBUG]:nit: sid 4172 lcn 1
If you don't want to dig to it, could you give me cca 60 seconds of the this whole mux dump (use the link in the mux grid - configuration - and wget or curl to get the contents).
Updated by Graham H almost 10 years ago
I've grabbed it - 170MB which would take all afternoon to send on my connection. However, I now have a hack which works. I just tell tvh to ignore delivery system descriptors. I'm assuming this has no side effects except disabling network discovery but I'm testing longer term now to see what happens. The hack is at line 1455 in dvb_psi.c:
case DVB_DESC_TERR_DEL:
if (dtag == DVB_DESC_SAT_DEL)
mux = dvb_desc_sat_del(mm, onid, tsid, dptr, dlen);
else if (dtag == DVB_DESC_CABLE_DEL)
mux = dvb_desc_cable_del(mm, onid, tsid, dptr, dlen);
else if (onid != 0x233A) // ignore if UK DVB-T
mux = dvb_desc_terr_del(mm, onid, tsid, dptr, dlen);
if (mux && onid != 0x233A) { // ignore if UK DBV-T - this may not be necessary - don't know what tsid is at this point
mpegts_mux_set_onid(mux, onid);
mpegts_mux_set_tsid(mux, tsid, 0);
}
break;
This stops mux being pointed at nothing (line 612 of logfile7). Let me know if you still want the stream dump.
Updated by Graham H almost 10 years ago
Or indeed, more elegantly:
case DVB_DESC_TERR_DEL: if (onid == 0x233A) break; case DVB_DESC_SAT_DEL: case DVB_DESC_CABLE_DEL: if (dtag == DVB_DESC_SAT_DEL) mux = dvb_desc_sat_del(mm, onid, tsid, dptr, dlen); else if (dtag == DVB_DESC_CABLE_DEL) mux = dvb_desc_cable_del(mm, onid, tsid, dptr, dlen); else mux = dvb_desc_terr_del(mm, onid, tsid, dptr, dlen); if (mux) { mpegts_mux_set_onid(mux, onid); mpegts_mux_set_tsid(mux, tsid, 0); } break;
Updated by Jaroslav Kysela almost 10 years ago
Thinking about this issue, the problem is probably that you have 2 muxes with same TSID but on different frequency. The current TVH code matches only TSID, so if the wrong mux is matched, the service operations are handled for this wrong mux. The loop in the NIT callback should iterate through all muxes with matching TSID to assign service details like LCNs..
Updated by Graham H almost 10 years ago
I think it's like this. Within the UK South East Region, there are about 40 transmitter masts. They all broadcast the same services with the same transport stream IDs, serviceIDs and the same LCNs but on different frequencies. It seems they therefore all carry the same service information, which includes the transport delivery system descriptors for Bluebell Hill. That is, Freeview/DigitalUK don't bother to re-encode the tdsds for each transmitter. When tvh finds a tdsd it doesn't already know it tries to create a new one, which succeeds if network discovery is on, but fails otherwise. I think it must therefore try to match both the tsid and the frequency.
The problem is that when the subsequent LCN entries are parsed, they are assigned to services from this new mux (if it exists) or discarded (if it doesn't). So yes, you could go through all the muxes matching tsids (and that was my first thought) but all it needs is to get it to ignore the tdsds completely. I can't really see they are any use, anyway, are they mandatory in the DVB standard?
Correct me if I'm wrong - I'm new to tvh and DVB standards - but I'm pretty sure my hack will work across the UK. The only thing I don't understand is why the issue hasn't been raised before. Maybe most people don't use the pre-set LCNs and just make up their own.
Updated by Jaroslav Kysela almost 10 years ago
- Status changed from New to Fixed
- % Done changed from 0 to 100
Applied in changeset commit:tvheadend|eed4d8cdc5e9fab6c0de5411586f2dd84b690d4d.
Updated by Graham H almost 10 years ago
- File logfile1501121224 logfile1501121224 added
Built 2347 from the git master (your site reports 2346 build failed). Result is exactly the same as under 2328. With Network Discovery off, no LCNs except on the HD mux. With Network Discovery on, Bluebell Hill frequencies are added to the muxes table and their services are assigned LCNs but Dover's LCNs remain blank.
If you want that stream dump, how do I send it?
Updated by Graham H almost 10 years ago
In case I was not clear, this is not fixed. Please revert status.
Updated by Jaroslav Kysela almost 10 years ago
OK. The idea was correct, but the implementation missed one thing. It should be fixed in v3.9-2373-g30cc0a7 .