Monday, January 6, 2014

MythTV and SBS in the Dandenong Ranges (Upwey, Selby)

I initially had quite a struggle to get SBS working in the hills where I live. Turns out that the default frequencies work fine for Melbourne in general, but in the hills (Upwey 3158, if you're interested) I had to specify different frequencies altogether. Why? We're in a radio shadow for the Mount Dandenong transmitters, so we rely on a series of repeaters. The list can be found here. Since I'm in Upwey, you might think that the Upwey repeater makes sense, but thanks to some cleverly-placed hills, I'm in the shadow for that too. In fact, our signal comes from Selby. The frequencies are the same, but the polarity differs (compare the publicity map PDF files: Upwey is vertical, Selby is horizontal).

Anyhoo... once I got the correct frequency (683.5 MHz) it all worked just fine and dandy. Until this week. What changed? According to the very helpful Alberto at SBS's Transmission Team, nothing has changed.

After a very great deal of thrashing around (details below), I found that the original definition for this transport specified a forward error correction type (fec_hi) of 2/3 which DOES NOT WORK any longer. Setting it to AUTO worked. To do this in the mythtv, run mythtv-setup, go to Channel Editor -> Edit Transports, select the 683500000 transport, and set the option "HP Coderate" to "Auto". Re-scan for channels, and hey presto, SBS channels will be working again. Or at least, this is what worked for me.

I arrived at this point via a fair bit of manual messing around, using mplayer and various dvb test tools. Here are some of the things that helped.

You can see the effect that the incorrect FEC rates have if you set the following lines in ~/.mplayer/channels.conf:

SBS ONE:683500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:161:81:785
SBS TWO:683500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_AUTO:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:162:83:786


The fifth field is the key here: FEC_2_3 vs. FEC_AUTO. Let's test each:

pyarra@mythbox:~$ mplayer dvb://1@"SBS ONE"
MPlayer svn r34540 (Ubuntu), built with gcc-4.6 (C) 2000-2012 MPlayer Team

Playing dvb://1@SBS ONE.
dvb_tune Freq: 683500000
Not able to lock to the signal on the given frequency, timeout: 30
dvb_tune, TUNING FAILED
ERROR, COULDN'T SET CHANNEL  23: Failed to open dvb://1@SBS ONE.


Exiting... (End of file)


And now someting that actually works:

pyarra@mythbox:~$ mplayer dvb://1@"SBS TWO"
MPlayer svn r34540 (Ubuntu), built with gcc-4.6 (C) 2000-2012 MPlayer Team

Playing dvb://1@SBS TWO.
dvb_tune Freq: 683500000
TS file format detected.
VIDEO MPEG2(pid=162) AUDIO MPA(pid=83) NO SUBS (yet)!  PROGRAM N. 0
... assorted babbling deleted ...


And up pops an mplayer window, showing SBS! yay!

I also used the DVB tool called "scan" to scan for channels:

pyarra@mythbox:~$ scan /usr/share/dvb/dvb-t/au-Melbourne-Upwey
scanning /usr/share/dvb/dvb-t/au-Melbourne-Upwey
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
initial transponder 662500000 1 3 9 3 1 1 0
initial transponder 620500000 1 3 9 3 1 1 0
initial transponder 641500000 1 3 9 3 1 1 0
initial transponder 711500000 1 3 9 3 1 1 0
initial transponder 683500000 1 2 9 3 1 2 0
>>> tune to: 662500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE
0x0000 0x0230: pmt_pid 0x0000 ABC -- ABC News 24 (running)
0x0000 0x0231: pmt_pid 0x0000 ABC -- ABC1 (running)
0x0000 0x0232: pmt_pid 0x0000 ABC -- ABC2 / ABC4 (running)
0x0000 0x0233: pmt_pid 0x0000 ABC -- ABC1 (running)
0x0000 0x0236: pmt_pid 0x0000 ABC -- ABC Dig Music (running)
0x0000 0x0237: pmt_pid 0x0000 ABC -- ABC Jazz (running)
0x0000 0x0234: pmt_pid 0x0000 ABC -- ABC3 (running)
Network Name 'ABC Melbourne'
>>> tune to: 620500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE
0x0000 0x0530: pmt_pid 0x0300 Seven Network -- 7 Digital (running)
0x0000 0x0531: pmt_pid 0x0310 Seven Network -- 7 Digital 1 (running)
0x0000 0x0532: pmt_pid 0x0320 Seven Network -- 7TWO (running)
0x0000 0x0533: pmt_pid 0x0330 Seven Network -- 7mate (running)
0x0000 0x0534: pmt_pid 0x0340 Seven Network -- 7 Digital (running)
0x0000 0x0537: pmt_pid 0x0370 (null) -- TV4ME (running)
0x0000 0x0538: pmt_pid 0x0380 Seven Network -- Fresh Ideas TV  (running)
Network Name 'Seven Network'
>>> tune to: 641500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE
0x0000 0x0430: pmt_pid 0x0100 Nine Network Australia -- Nine Melbourne (running)
0x0000 0x0431: pmt_pid 0x0101 Nine Network Australia -- GEM (running)
0x0000 0x0433: pmt_pid 0x0103 Nine Network Australia -- EXTRA (running)
0x0000 0x0434: pmt_pid 0x0104 Nine Network Australia -- EXTRA 2 (running)
0x0000 0x0432: pmt_pid 0x0102 Nine Network Australia -- GO! (running)
Network Name 'Nine Network Australia'
>>> tune to: 711500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE
0x0000 0x0631: pmt_pid 0x0101 Ten Melbourne -- ONE (running)
0x0000 0x0635: pmt_pid 0x0100 Ten Melbourne -- TEN Digital (running)
0x0000 0x0638: pmt_pid 0x0107 Ten Melbourne -- ELEVEN (running)
0x0000 0x0637: pmt_pid 0x0106 Ten Melbourne -- ONE (running)
0x0000 0x0636: pmt_pid 0x0108 Ten Melbourne -- TVSN (running)
0x0000 0x0639: pmt_pid 0x0109 Ten Melbourne -- SpreeTV (running)
Network Name 'Network TEN'
>>> tune to: 683500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE
WARNING: >>> tuning failed!!!
>>> tune to: 683500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE (tuning failed)
WARNING: >>> tuning failed!!!


Those lines at the end, where it tries and fails to tune to 683500000? Yeah, that'd be a problem.

So I made my own short frequency table file for testing - copied /usr/share/dvb/dvb-t/au-Melbourne-Upwey to ~/selby, took out everything except the 683500000 line, and started changing stuff at random till things came good. This was the winning combo:

pyarra@mythbox:~$ cat selby
# Australia / Melbourne (Selby Repeater)
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
# SBS
T 683500000 7MHz AUTO NONE QAM64 8k 1/8 NONE


I guess the next step is to submit my modified /usr/share/dvb/dvb-t/au-Melbourne-Selby to the package maintainer for inclusion. I think that MythTV doesn't use this particular file, not sure how I get this revised info upstream for MythTV. Also, not really sure if FEC_AUTO works for all types of DVB cards. If I had a way to determine the actual FEC values being used, that would be handy, but I do not know what they are or how to find out.

On the bright side: I fixed this in time to record a show I want to see from SBS. Yay for MythTV :-)

Update: list of all (?) frequencies here.

1 comment:

  1. Update: I sent in my patch, and the Selby table is now part of the linuxtv files

    ReplyDelete