Testing with tunetest

Sometimes if there are problems testing with iTele then I will ask you to test with tunetest. You can get tunetest here: http://www.defyne.org/dvb/tunetest-v0.3.1.zip. Expand the zip file onto your Desktop.

Tunetest is a command-line utility. So you need to run it from Terminal. Open a Terminal and in it type:

cd Desktop
./tunetest
That will launch tunetest and attach to and activate the first MMInput device that it finds (which should be the only one when testing). Tunetest will then present you with a prompt for commands. Type 'help' for a terse summary of the available commands.

There are four steps to perform when testing with tunetest. If you fail to get past any of them then the standard information I require is the output from the tunetest command into its Terminal window, as well as the output into the system log during the execution of those steps. To get the system log output, open up a second Terminal window and type 'tail -f /var/log/system.log' into it. Do that before you run tunetest in case there is an error with activation. (Make sure you send me the output of both of these windows. It is very frustrating to only have half the picture!)

The first step in testing is whether or not it can activate the MMInput device. If you get to the tunetest prompt when you run it then you have already done this step.

The second step is to tune to a channel and get a lock on it. Figure out what the frequency of the channel you want to tune to is. There are many references on the web for the channel numbers and frequencies of digital TV signals in your area. I won't list them here as there are too many - if in doubt, try google. Some references will just list available channel numbers and not frequencies, but there are many charts converting channel numbers into frequencies. Be warned, however - different regions have different charts - e.g. USA, UK, Germany, Australia are all different. You will also need to know the bandwidth for the channel you want to tune to. Generally speaking, Europe uses 8MHz, Australia uses 7MHz, and the US uses 6MHz. But some channels in Germany are 7MHz. Anyway, you have to figure this one out too.

The paragraph above applies to terrestrial channels only. For satellite channels the information you need is the transponder frequency, polarity and symbol rate. This guide does not yet go into the details of testing a satellite device with tunetest.

So, when you know the frequency and bandwidth of the channel you want to tune, there are two commands to use in tunetest to tell them to it. First set the bandwidth:

bandwidth X
Where X is the bandwidth in MHz. Now attempt to tune to the frequency:
tune X
Where X is the frequency in Hz. e.g. to tune to 177.5MHz you would type:
tune 177500000

When you hit enter on that tune command, tunetest will print out the dictionary of properties it is sending the to driver. Then it will launch into a loop that monitors the tuning progress and signal levels of the channel. It will print out a line of information every second. Press return to stop monitoring this and return to the prompt. If you want to reenter the loop without selecting a different frequency, use the 'watch' command (which takes no arguments) to do so.

In the output you will see three hexadecimal numbers. Bigger is generally better, so 0x00000000 is the worst and 0xFFFFFFFF is the best. The progress value (the first number) is the most reliable. When it is 0x00000000 you can see no signal at all, and when it is 0xFFFFFFFF you have full lock and packets are ready to come out of the hardware and over to your Mac. The quality and strength values are much more dodgy and at best will give you a rough idea of what's going on - don't worry about them too much.

If you have no antenna problems, the driver is working properly, and you tuned to a channel that you can actually receive, then you will see all F's in the progress field. In that case you have finished this step. If not, then there is a problem with one of those three things. Check the antenna, check the settings for the channel, maybe try a few different channels and see if you can pick up anything. If not, then let me know what you did (send both the tunetest output and the tail of the /var/log/system.log file) and we'll see if the trouble lies in the driver.

The third step is to get the data off the device and into your Mac, by turning on filling of the data pond. You do this with the 'fill' command. That command takes an optional argument being the file to save the data out into. The data will be in the form of a transport stream. But to start off with, do not try to save out the data, just enter the command without any arguments:

fill
That will launch a loop that prints out the number of blobs (packets) received five times a second. Again, press return to stop it and return to the prompt. If you are seeing data come out of the device, then that's great! You have completed this step.

The fourth and final step is to save that data to a file and see if you can play it with VLC (VideoLan Client). Use the fill command and this time select a file to save it into, for example:

fill test.ts
Let it record a few seconds, maybe 20 or 30 seconds. You will see that the file grows very quickly! When you are done, press enter to stop filling and close the file. You can then try playing it back with VLC. Note that this will only work for MMInput devices that can send the full transport stream. USB1.1 devices like the Nova-T USB and the DEC will only save a very small part of the stream, not enough to play back with VLC. If you are testing one of those let me know when you get to this step and I'll tell you what to do from there.

To quit tunetest type 'quit' at the prompt or press control-C. Note that you should never unplug your device (if it is a USB device) while tunetest is running. Also you must never let your Mac go to sleep while tunetest is running. Doing either of these will most likely crash your Mac with a kernel panic (or worse!) and at best prevent the drivers from working until you reboot.

OK, again, good luck with tunetest, and let me know how you get on!
{P^/