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.
I do computer stuff. When I solve a problem and it's not obvious, I document it here - it's a reference for myself, and hopefully, it can save other people out there days of problem solving, googling and assorted hair-tearing.
Monday, January 6, 2014
Monday, January 28, 2013
Word games, part two
Sometimes I wake up in the morning, and manage to get back to sleep. Other times, my brain starts ticking over, and there's no point shouting at it to go back to sleep. This morning was an example of the latter.
Specifically, I started trying to work out the nine-letter word from the Sunday Age, from memory. From there, I started thinking about this earlier bit of hackery, and how I really should have tried to solve the problem properly. So I came up with this:
#!/usr/bin/perl
my $DICT="/etc/dictionaries-common/words";
my $WORD=shift();
my $LC_WORD=lc($WORD);
my $SORTED_WORD=(join '', sort { $a cmp $b } split(//, $LC_WORD));
my $LENGTH=length($SORTED_WORD);
open FILE, $DICT or die $!;
while(<FILE>) {
chomp;
$CANDIDATE=(join '', sort { $a cmp $b } split(//, lc($_) ));
next if (length($CANDIDATE) ne $LENGTH);
print ("FOUND: $_\n") if($CANDIDATE eq $SORTED_WORD);
}
close FILE;
exit 0;
Perl is definitely not my favourite language (too many magic variables for my liking!) but it's quick, and it works.
Of course, plenty of other people have already solved this issue (and gone well beyond too, in this case) but that's not the point - it was an interesting exercise. My wife did ask "isn't that cheating?" but I kinda think if you write a program to solve the problem, it's arguable not really cheating. Right?
Specifically, I started trying to work out the nine-letter word from the Sunday Age, from memory. From there, I started thinking about this earlier bit of hackery, and how I really should have tried to solve the problem properly. So I came up with this:
#!/usr/bin/perl
my $DICT="/etc/dictionaries-common/words";
my $WORD=shift();
my $LC_WORD=lc($WORD);
my $SORTED_WORD=(join '', sort { $a cmp $b } split(//, $LC_WORD));
my $LENGTH=length($SORTED_WORD);
open FILE, $DICT or die $!;
while(<FILE>) {
chomp;
$CANDIDATE=(join '', sort { $a cmp $b } split(//, lc($_) ));
next if (length($CANDIDATE) ne $LENGTH);
print ("FOUND: $_\n") if($CANDIDATE eq $SORTED_WORD);
}
close FILE;
exit 0;
Perl is definitely not my favourite language (too many magic variables for my liking!) but it's quick, and it works.
Of course, plenty of other people have already solved this issue (and gone well beyond too, in this case) but that's not the point - it was an interesting exercise. My wife did ask "isn't that cheating?" but I kinda think if you write a program to solve the problem, it's arguable not really cheating. Right?
Friday, January 11, 2013
Radio scanners
In a diversion from the usual nerdy stuff, let's talk about radio scanners. Um, well maybe not a complete diversion, but it's not strictly a computer, so you see what I'm saying...
We live in a high fire danger area. The CFA website, fire ready app, ABC news radio... they're all good, but the information is not always timely, and there have been cases where they haven't coped under the high load of a high fire danger day. When you really want to know what's happening nearby, the CFA radio communications give you the best picture. Messages between VicFire (the dispatch centre) and the crews on the ground tell you a great deal about what's happening.
Currently we use an analog scanner - a Uniden Bearcat UBC93XLT, which has served us very well. We replaced the stock aerial with a ScanDucky and it's been terrific. Our scanner came from Dick Smith, but they don't list it anymore. They still list the 92 - similar, but without the rechargeable batteries (I always regarded the extra few dollars for the 93 well worth it - the scanner stays attached to the charger in the kitchen, and when we go mobile it's ready to rock). It looks like Dick Smith and (of all places!) OfficeWorks offer what looks like the "small" version of our scanner - this might be a good "for now" analog scanner (note: I haven't tried one of these, but some casual googling indicates this should do roughly what the 93 does - but caveat emptor - don't buy this assuming it will pick up CFA radio based on my non-recommendation - check that it supports the CFA frequencies). Our scanner's limited keypad was cryptic enough that I was forced to read the manual (I know! I hope they don't cancel my nerd badge for reading the manual... it just wasn't intuitive) so don't expect to open the box and use a scanner straight away.
Eventually CFA VicFire channels will go digital. At this stage the project is implementing digital for country areas, with outer metro to follow "eventually". Check which region you're in here. I'm told the fireground channels will stay on analog (these are the channels used for communication between the trucks working on the same incident, I can generally hear these if the incident is nearby). Anyhoo, digital: it gives the users the option to encrypt their conversations (as Police channels in metro areas already do) but I have been told by CFA sources that the digital channels will remain unencrypted, meaning we can still listen with our scanners. So I plan to upgrade to the Bearcat Digital 396 XT or similar. I assume that it will also receive the analog transmissions (needed for fireground channels) but please note that I cannot confirm this until I have one in my hot little hands. This guy has lots of useful information about these units. If it supports analog, we may have a UBC93XLT for sale... if not, we'll hang on to it.
We live in a high fire danger area. The CFA website, fire ready app, ABC news radio... they're all good, but the information is not always timely, and there have been cases where they haven't coped under the high load of a high fire danger day. When you really want to know what's happening nearby, the CFA radio communications give you the best picture. Messages between VicFire (the dispatch centre) and the crews on the ground tell you a great deal about what's happening.
Currently we use an analog scanner - a Uniden Bearcat UBC93XLT, which has served us very well. We replaced the stock aerial with a ScanDucky and it's been terrific. Our scanner came from Dick Smith, but they don't list it anymore. They still list the 92 - similar, but without the rechargeable batteries (I always regarded the extra few dollars for the 93 well worth it - the scanner stays attached to the charger in the kitchen, and when we go mobile it's ready to rock). It looks like Dick Smith and (of all places!) OfficeWorks offer what looks like the "small" version of our scanner - this might be a good "for now" analog scanner (note: I haven't tried one of these, but some casual googling indicates this should do roughly what the 93 does - but caveat emptor - don't buy this assuming it will pick up CFA radio based on my non-recommendation - check that it supports the CFA frequencies). Our scanner's limited keypad was cryptic enough that I was forced to read the manual (I know! I hope they don't cancel my nerd badge for reading the manual... it just wasn't intuitive) so don't expect to open the box and use a scanner straight away.
Eventually CFA VicFire channels will go digital. At this stage the project is implementing digital for country areas, with outer metro to follow "eventually". Check which region you're in here. I'm told the fireground channels will stay on analog (these are the channels used for communication between the trucks working on the same incident, I can generally hear these if the incident is nearby). Anyhoo, digital: it gives the users the option to encrypt their conversations (as Police channels in metro areas already do) but I have been told by CFA sources that the digital channels will remain unencrypted, meaning we can still listen with our scanners. So I plan to upgrade to the Bearcat Digital 396 XT or similar. I assume that it will also receive the analog transmissions (needed for fireground channels) but please note that I cannot confirm this until I have one in my hot little hands. This guy has lots of useful information about these units. If it supports analog, we may have a UBC93XLT for sale... if not, we'll hang on to it.
Saturday, November 10, 2012
Word games
So The Age publishes a word game - Target - in the weekend paper. The rules are simple: you get 9 letters, and have to make as many words of 4 letters or more out of them, and there is one of the letters which must be included in all words. You also have to figure out what the original 9-letter word was which got scrambled up to provide the 9 letters. I quite like the challenge of making words out of the letters, but I rarely figure out the 9-letter word. It frustrates me. In fact, so much that I seem to spend more time figuring out ways to write a program to solve it for me. Yeah, really.
Anyway, I couldn't be bothered doing it "properly" so I decided to do a quick command-line hack to solve it. Today's quiz had the letters H K I A R T B R M Witness the following ugliness:
There must be more elegant ways to achieve this, but still, it got the job done in a couple of minutes.
Oh, and the word was "birthmark" in case you wondered :-)
Edit: I solved this properly in perl today.
Anyway, I couldn't be bothered doing it "properly" so I decided to do a quick command-line hack to solve it. Today's quiz had the letters H K I A R T B R M Witness the following ugliness:
grep '^.........$' /usr/share/dict/words|grep 'k'|grep 'r'|grep 'm'| grep 'h' |grep -E '[i]{1}'|grep -E '[a]+'|grep -v '[eou]'
There must be more elegant ways to achieve this, but still, it got the job done in a couple of minutes.
Oh, and the word was "birthmark" in case you wondered :-)
Edit: I solved this properly in perl today.
Monday, September 10, 2012
NanoBSD 6.3 to 8.0 - what do I need to change?
Upgrading some NanoBSD boxes from FreeBSD 6.3 to 8.0, and adding BGP functionality along the way. A couple of config changes that are required:
pw useradd "_bgpd" -u 130 -c "BGP Daemon" -d /var/empty -s /sbin/nologin
mount /cfg
cp /etc/group /cfg
cp /etc/passwd /cfg
cp /etc/pwd.db /cfg
cp /etc/spwd.db /cfg
mount -u -o ro /
Starting ntpd.
ERROR: only one configfile option allowed
ntpd - NTP daemon program - Ver. 4.2.4p5
In /cfg/rc.conf, change this:
ntpd_enable="YES"
ntpd_flags="-g -p /var/run/ntpd.pid -f /etc/ntpd.drift -c /etc/ntp.conf -t 3"
to this:
ntpd_enable="YES"
ntpd_config="/etc/ntp.conf" # ntpd(8) configuration file
ntpd_flags="-p /var/run/ntpd.pid -f /etc/ntpd.drift -t 3"
ifconfig_ath0="ssid bsdbox media autoselect mode 11g mediaopt hostap up"
... to this...
wlans_ath0="wlan0"
create_args_wlan0="wlanmode hostap"
ifconfig_wlan0="ssid bsdbox media autoselect mode 11g mediaopt hostap up"
Edit /cfg/hostapd.conf and change interface=ath0 to interface=wlan0
Edit /cfg/rc.conf and change the bridge members so that ath0 is removed, and wlan0 added
FAILURE - READ_DMA status=51 error=10 LBA=15625215
ad0: FAILURE - READ_DMA status=51 error=10 LBA=15625215
Apparently it's just FreeBSD's way to tell you to relax and have fun :-) PfSense info on it over here
You can also relax about this error:
Starting named.
named[1302]: the working directory is not writable
That's because at boot, /etc/namedb/ isn't writable, but it becomes so when the mfs (RAM disk ) is mounted there. I think...
Enable BGP
- add /cfg/local/bgpd.conf and edit to suit (hint: AS and IP addresses ought to match what is assigned for the site)
- add openbgpd_enable="YES" to /cfg/rc.conf
- add _bgpd user account to /etc/passwd and /etc/group like this:
pw useradd "_bgpd" -u 130 -c "BGP Daemon" -d /var/empty -s /sbin/nologin
mount /cfg
cp /etc/group /cfg
cp /etc/passwd /cfg
cp /etc/pwd.db /cfg
cp /etc/spwd.db /cfg
mount -u -o ro /
NTPD changes
On boot, ntpd fails to start with errors such as:Starting ntpd.
ERROR: only one configfile option allowed
ntpd - NTP daemon program - Ver. 4.2.4p5
In /cfg/rc.conf, change this:
ntpd_enable="YES"
ntpd_flags="-g -p /var/run/ntpd.pid -f /etc/ntpd.drift -c /etc/ntp.conf -t 3"
to this:
ntpd_enable="YES"
ntpd_config="/etc/ntp.conf" # ntpd(8) configuration file
ntpd_flags="-p /var/run/ntpd.pid -f /etc/ntpd.drift -t 3"
Wireless access point
Change ath0 interface config from this:ifconfig_ath0="ssid bsdbox media autoselect mode 11g mediaopt hostap up"
... to this...
wlans_ath0="wlan0"
create_args_wlan0="wlanmode hostap"
ifconfig_wlan0="ssid bsdbox media autoselect mode 11g mediaopt hostap up"
Edit /cfg/hostapd.conf and change interface=ath0 to interface=wlan0
Edit /cfg/rc.conf and change the bridge members so that ath0 is removed, and wlan0 added
Other stuff
- add "kern.maxfilesperproc=4096" to /cfg/sysctl.conf so that newer version of bind can start
FAILURE - READ_DMA status=51
ad0: FAILURE - READ_DMA status=51
Apparently it's just FreeBSD's way to tell you to relax and have fun :-) PfSense info on it over here
You can also relax about this error:
Starting named.
named[1302]: the working directory is not writable
That's because at boot, /etc/namedb/ isn't writable, but it becomes so when the mfs (RAM disk ) is mounted there. I think...
DMA and Ultra DMA
Transcend UDMA 16GB CF cards do not work reliably - they will not boot on power-up (this is in a Soekris net5501). I can get them to boot by letting boot fail, drop into COMBios over serial, issue a reboot, then and only then will it boot. I suspect this is related to DMA levels supported by the net5501. Obviously not reliable enough for our purposes, so I have ordered some DMA66 SanDisk 4GB cards.Monday, July 9, 2012
FreeBSD: show outgoing SMTP connections
To show active NAT sessions: pfctl -s state
To show just those going to SMTP ports: pfctl -s state | awk '$7 ~ /:25$/'
Helpful to find outgoing NAT sessions that might be caused by a spambot like, oh, let's say maybe cutwail.
And to show all SMTP sessions, both directions:
pfctl -s state | awk '$7 ~ /:25$/||$3 ~ /:25$/'
To show just those going to SMTP ports: pfctl -s state | awk '$7 ~ /:25$/'
Helpful to find outgoing NAT sessions that might be caused by a spambot like, oh, let's say maybe cutwail.
And to show all SMTP sessions, both directions:
pfctl -s state | awk '$7 ~ /:25$/||$3 ~ /:25$/'
Tuesday, May 29, 2012
Install as another (administrative) user on Windows XP
Gotta love it when you get an install package as an .exe file - right click and "Run As" to install it as an admin account. All good. But when you get an .msi do you really have to log out, then log in as an administrative user, just to install it? I've always known there must be a better way to do it, but it finally irritated me enough to find out. The trick is to use the runas command:
Some gotchas:
C:\Documents and Settings\myUser>runas /user:domain\admin-account "msiexec /i \"C:\Documents and Settings\myUser\My Documents\Downloads\someInstaller.msi\""
Some gotchas:
- you must include the whole command you're passing to runas in quotes
- if the path to the MSI file has spaces in it, you must put it in quotes
- you can't nest quotes, so you'll have to use a backslash to escape the inner set of quotes
Subscribe to:
Posts (Atom)