The BBC have rejigged their DVB-T configuration, with the result that, as of Wednesday, Radios 1 through 4 stopped working. They did broadcast warnings in advance, explaining how to rescan channels to continue to receive those stations. As is often the case, doing things with MythTV turned out to be a little more complicated than with bog-standard consumer receivers. I can’t be the only person to have been affected, and I hope that this solution will help.

On Wednesday, as predicted, my MythTV box could no longer receive Radio 4. I fired up mythtv-setup and rescanned the available channels. It found Radio 4 and the rest, and everything looked fine. But when I tried to tune to any of the channels, it didn’t work. I’d see (L_S) Partial Lock in the tuning window, followed after a few seconds by the tuning timeout message. A partial lock can be caused by a poor signal, but I have an exceptionally good signal here, and the statistics were showing a signal strength of 94%—so it couldn’t be that.

I wondered whether the transmission changes had resulted in an incompatibility with MythTV. I wondered whether I should upgrade my installation. I even started looking at the prices of new hardware online with a view to building a better, faster, smaller, quieter MythTV box.

In the meantime, I let it lie, and grabbed the radio programmes I’d missed via the Listen Again service (using a combination of MPlayer and LAME to rip and transcode the useless streaming Real audio to MP3s).

This evening, I came across a more helpful technical explanation of the changes:

BBC Radio 1, 2, 3, 4 on Freeview (digital terrestrial television)
On the morning of Wednesday 3 October, following the installation of new equipment, BBC Radio 1, 2, 3 and 4 on Freeview moved into the same space as the other BBC radio services – from multiplex A to multiplex B. Channel numbers have not changed, but you will need to rescan your Freeview receiver to make sure you can continue to hear these networks – see your instruction manual or our advice on rescanning your receiver. No other services or other platforms are affected.

That gave me somewhere to start, so I SSH’d in and had a peek at the channel table in MythTV’s database. (Incidentally, this has an exceptionally confused database schema with no consistent naming strategy.)

mysql -umythtv -p mythconverg
mysql> select * from channel where name like '%Radio 4%' \G

There were two entries for Radio 4. That couldn’t be right! What’s more, they were pointing at different multiplexes. In my case, that was multiplex IDs 3 and 4. The obvious hypothesis was that the old channel entries hadn’t been deleted or replaced by the new ones, and were being selected in preference to the newer ones by the backend software.

Using the useful hint from the quote above, that all the BBC stations were now on the same multiplex, it was easy enough to work it out.

mysql> select channum, name, mplexid from channel
where channum >= 700 and channum < 706;
+---------+-------------+---------+
| channum | name        | mplexid |
+---------+-------------+---------+
| 705     | BBC R5 Live |       4 | 
| 701     | 1Xtra BBC   |       4 | 
| 700     | BBC Radio 1 |       3 | 
| 702     | BBC Radio 2 |       3 | 
| 703     | BBC Radio 3 |       3 | 
| 704     | BBC Radio 4 |       3 | 
| 700     | BBC Radio 1 |       4 | 
| 702     | BBC Radio 2 |       4 | 
| 703     | BBC Radio 3 |       4 | 
| 704     | BBC Radio 4 |       4 | 
+---------+-------------+---------+
8 rows in set (0.00 sec)

BBC R5 Live and 1Xtra BBC appeared once on multiplex ID 4, whilst the other stations appeared twice each, on multiplex IDs 3 and 4. Multiplex ID 4 was therefore the correct one.

Before proceeding, I took a quick backup dump of the database.

mysqldump -umythtv -p mythconverg | gzip > mythconverg.gz.sql

I then deleted the bogus channel entries:

mysql> delete from channel where channum >= 700 and channum < 706
and mplexid=3;

After restarting mythbackend, Radios 1 to 4 worked once more!

I know that MythTV handles the case when a station on a multiplex changes, because it successfully picked up the change when Virgin 1 replaced FTN earlier this week, but it doesn’t appear to expect a station to shift multiplexes, and doesn’t know to remove the old entry when this happens. It shouldn’t be a hard problem to solve.

I love MythTV for what it does—on a good day, it can do stuff that the commercial competition won’t (can you imagine a Sky+ receiver identifying and skipping ads?!)—but, like much open source software, it’s really not suitable for anyone who isn’t ready and willing to delve into its viscera once in a while. It’s hard to set up, and sometimes hard to keep running. I approach it as a project to tinker with, and I’m very happy with it overall, but I recognise that I’m not a typical user who just wants to watch TV.