[mythtv] Analogue finetuning change between v0.18 and v0.19

Andrew M. Bishop amb at gedanken.demon.co.uk
Sun Feb 19 17:34:07 UTC 2006


In version 0.19 of MythTV the meaning of the finetune entry in the
channel table has changed to be different from that in version 0.18
and earlier.  More likely is that this is a bug since the original
meaning of the finetune value was to be the same as xawtv which is
also the finest tuning granularity that is available.

In version 0.18 the code in libmythtv/channels.cpp was like this:

-------------------- v0.18 --------------------
bool Channel::TuneTo(const QString &channum, int finetune)
{
...
    int frequency = curList[i].freq * 16 / 1000 + finetune;

    return TuneToFrequency(frequency);
}

bool Channel::TuneToFrequency(int frequency)
{
...
        vf.frequency = frequency;
        vf.type = V4L2_TUNER_ANALOG_TV;

        ioctlval = ioctl(videofd, VIDIOC_S_FREQUENCY, &vf);
...
}

-------------------- v0.18 --------------------

In version 0.19 the code in the same file now looks like this:

-------------------- v0.19 --------------------
bool Channel::TuneTo(const QString &channum, int finetune)
{
...
    int frequency = (curList[i].freq + finetune) * 1000;

    return Tune(frequency);
}

bool Channel::Tune(uint frequency, QString inputname, QString modulation)
{
...
        vf.frequency = (isTunerCapLow) ?
            ((int)(frequency / 62.5)) : (frequency / 62500);
...
        vf.type = V4L2_TUNER_ANALOG_TV;

        ioctlval = ioctl(videofd, VIDIOC_S_FREQUENCY, &vf);
...
}
-------------------- v0.19 --------------------

In the first case the V4L ioctl has vf.frequency equal to:

channel.freqid * (16/1000) + channel.finetune

In the second case vf.frequency is equal to:

(channel.freqid + channel.finetune) * 1000 * (16/1000000)

OR

channel.freqid * (16/1000) + channel.finetune * (16/1000)


To make mythtv work again in version 0.19 I have had to change all my
finetune values in the database by a factor of 1000/16, so they
changed from 12 to 750.  With such a large finetune value the change
in behaviour meant that the sound was not working.  Other users might
not see such a large change.

-- 
Andrew.
----------------------------------------------------------------------
Andrew M. Bishop                             amb at gedanken.demon.co.uk
                                      http://www.gedanken.demon.co.uk/


More information about the mythtv-dev mailing list