Freesat channel numbering

Added by Tony Houghton over 2 years ago

It seems like tvheadend's support for Freesat has bit-rotted away to practically nothing, so I'm looking for a way to assign channel numbers automatically. I have a way of extracting all the info I need directly from the SI, but can't find a way to automate applying it to tvheadend. I think it might be possible to write them directly into the files in .hts/tvheadend/channel/config, but then I realised that all of them contain "number": 0. I have a DVB-T2 stick too, and tvheadend still has some support for Freeview left, so I do have some numbered channels. Perhaps the number field in channel/config files is only updated if a user manually overrides a channel number? So updating those from an external script could still work.

However, the only other clue to a channel's identity is its "services" field which contains an array with one entry, a 32-digit hex number. These don't correspond to any files I can find in .hts/tvheadend, nor in a dump of http://...:9981/xmltv. The xmltv data does include codes corresponding to the leafnames of channel/config files, but the only associated data is the channel name (and its LCN for the Freeview channels that are working). I really need to know the service_id and/or transport_id of each channel too, otherwise I won't know which is the correct version for my region when there are multiple channels with the same name like "ITV". tvheadend must maintain a mapping of its own channel ids to service_ids etc somewhere on disk, but where? AFAICT from the docs for epgdump etc, this info can't be extracted from its epg database either.

Replies (9)

RE: Freesat channel numbering - Added by Adrian Smith over 2 years ago

Tvheadend supports UK Freesat just fine if you map the services to channels via one of the Freesat bouquets - no need to map anything manually.

Assuming your dish is pointed at 28.2E you should have a bunch of BSkyB and Freesat Bouquets listed in the relevant tab. The Freesat ones are basically the ones where the name doesn't being with "BSkyB". The bouquets are divided into TV Regions (so that you get e.g. the right local BBC 1 on channel 101). There are three versions of each Freesat Bouquet: SD, HD and G2. Personally I've always used the relevant G2 bouquet for my area and it all works fine - including the automatic move of ITV HD from channel 111 to 103 last week.

In summary, no need to map the services to channels manually - use the bouquet.

RE: Freesat channel numbering - Added by Tony Houghton over 2 years ago

It probably still works for you because it's using config/associations that were set up in an earlier version that still worked, but in a fresh install you can't enable bouquets any more. I've made sure the Freesat grabbers are enabled and checked the box for the bouquet I want to use, to no avail. Selecting the bouquet and clicking the Force Scan button does nothing at all. Tvheadend can still detect the bouquets after a day or two of repeatedly scanning until it finds a service on 11425H that vlc will attempt to read long enough for tvheadend to find the BAT, and then carrying on faffing with it for another few hours (so that hasn't changed much), but it won't read LCNs from it any more. All the "bouquet" fields in channel/config/* are empty. Hm, that gives me an idea. Instead of filling in the "number" field in those files, what if I filled in the "bouquet" field instead...

I'm using 4.2.8. I upgraded to 4.3/git after being asked to on the issue tracker, but that seems to have the same problem, so I downgraded again. I say "seems" because it's hard to tell with all the the other scanning problems it has.

RE: Freesat channel numbering - Added by Tony Houghton over 2 years ago

I've tried setting the bouquet field in all the Freesat files in channel/config, but after that the bouquet fields are still all blank in tvheadend's channels list. Yes, I did stop tvheadend before changing the files, then started it again afterwards. It doesn't seem to have overwritten my changes to the files though.

BTW, I asked someone what 'G2' meant a few years ago. Apparently it's something to do with linking to IPTV, so I've always used HD instead.

RE: Freesat channel numbering - Added by Adrian Smith over 2 years ago

Hmmm. I'm running a self compiled version 4.3-1880~g2af3b9e2e. Been running that for quite a while and, now you mention it, I do remember having issues getting the bouquets to come in correctly. Should have thought of that earlier - sorry.

It's a while ago but my recollection is that on initial scan the bouquets weren't registered correctly. The give away was some incorrect data in the "Source" column of the Freesat bouquets when displayed in the "bouquets" tab (I'm attaching a picture of what mine look like now they're working okay). I seem to remember that the solution was to delete the Freesat bouquets that were picked up on the initial scan and simply leave it overnight to do its own thing. The second time round the bouquets came in properly and I was able to map channels from them. I had no luck using the "old trick" of trying to bring the corrected bouquet data in by playing a service on 11425H in VLC.

Would be interested to know if the above is similar to the issue you're seeing.

RE: Freesat channel numbering - Added by Adrian Smith over 2 years ago

Just to complete the picture of my configuration:

  • IDLE Scan muxes is disabled for my Freesat network
  • EPG module for 11425H Mux is manually set to "UK: Freesat"
  • EPG Scan is set to "Disabled" for all other Freesat muxes (and EPG Module is blank)

So when I said earlier that I left it overnight "to do its own thing" I guess the Freesat bouquets were picked up again when 11425H was tuned to do the overnight EPG scan.

Hope that helps.

RE: Freesat channel numbering - Added by Tony Houghton over 2 years ago

After your previous message I deleted all the Freesat services and all the bouquets and started another scan. It picked up the Freesat bouquets quite quickly this time.

I didn't realise I had to explicitly set the EPG grabber for each mux; I'm sure I haven't done that before, and I've definitely never disabled it for all the other muxes. Thankfully it does actually let you change the setting for all selected muxes at once, otherwise that would be quite a chore. It should be possible to scan either for events or for services/bouquets on any Freesat mux, not just 11425H, because they all carry the full set of data [1], but 11425H transfers the EIT at a much faster rate and has a different set of non-standard PIDs from the others.

Anyway, I set the EPG modules as you suggested, and forced another network scan, but it hasn't made a difference so far. Should I delete the services and scan again, and/or force an EPG grab and/or wait for tvheadend to schedule one? The bouquets and LCNs should be read during a services scan, and an EPG grab should just read events from the EIT. This apparent overlap just makes it confusing.

[1] I think it used to be the case that each mux carried data for all Freesat muxes except itself, so you had to scan at least 2, but lately I've found they carry their own data too.

Edit: The LCNs have turned up after all! At first they were only in the EPG, then they also showed up in the Channels list after remapping, but the LCN column in the Services list still contains nothing except 0 for all the Freesat channels.

And thanks for your help, which proved crucial.

RE: Freesat channel numbering - Added by Adrian Smith over 2 years ago

What does the Freesat bouquet data look like now you have rescanned i.e. what does the data in the "source" field look like? Can you provide a screen shot?

You don't HAVE to disable the EPG scan for the other muxes it's just my preference to stop needless activities taking place. I was only providing details of my configuration as an example of something that's working rather than a statement of any sort of master setup guide.

I don't have the evidence from the time (it was January this year) but my memory is that the Freesat muxes "looked wrong" when picked up by a initial (or forced) mux scan. I spent hours trying to figure out what was going on and finally spotted that the data "source" field for the Freesat bouquets didn't look right. I can't remember the specifics but, for example, for a "good bouquet" it might be something like "dvb-freesat://dvbs,28.2E,0118,21" but mine were showing as something like "dvb-freesat://dvbs,28.2E,-1, -1" (I have no idea what those last two numbers represent).

Deleting the bouquets and rescanning the muxes brought them back consistently with the wrong data. By pure chance one night, having given up banging my head against a brick wall for one day, I just left it overnight (with the "broken" bouquets having already been deleted). "Magically", in the morning, the bouquets had been recreated with what looked like good data. I tried to map the channels from one of them and it finally worked.

I'm guessing that some sort of scheduled overnight scan brought the bouquet data in in a way that was somehow different from the way it is brought in when doing a mux scan.

RE: Freesat channel numbering - Added by Adrian Smith over 2 years ago

Sorry was replying and didn't see your edit.

Glad you've got some channels mapped at last!

RE: Freesat channel numbering - Added by Tony Houghton over 2 years ago

The source for my bouquet (England HD: South/Meridian S) is dvb-freesat://dvbs,28.2E,0110,28. I don't think it's ever looked "off" with anything like -1 instead of those numbers. I think I can shed light on those BTW. What tvheadend calls a bouquet is actually a combination of a DVB bouquet and a region code which I think is a Freesat extension to the standard (Sky seem to have a similar extension). The 0110 corresponds to the bouquet_id (in hexadecimal) I've found for England HD in my own scanner, and 28 (decimal) is the region code.

PS I happened to notice that the non-Freesat scanner had found Channel 4 HD on one of the sat muxes. This isn't officially part of Freesat any more because of an argument between Freesat and C4, but the actual stream is still there for Sky customers, and it's unencrypted. I've configured tvh to use Freeview's EPG for it, but if anyone who doesn't also have Freeview on the same box is interested, I should be able to provide a mapping of Channel 4 SD service IDs to regions. I don't think there's much variation in the actual programmes, but I have noticed the adverts are different if I choose the "wrong" region. I should think HD gets the same as the London region.