As nobody replied to my first message, I'll try it again:
The code to retrieve the locked frequency in alps_bsrv2.c
is obviously wrong:
case FE_GET_FRONTEND:
{
struct dvb_frontend_parameters *p = arg;
s32 afc;
afc = ((int)((char)(ves1893_readreg (i2c, 0x0a) << 1)))/2;
afc = (afc * (int)(p->u.qpsk.symbol_rate/8))/16;
p->frequency += afc;
that's just a straightforward implementation of the formula given in the
ves1893 reference manual.It will look something like this in the end:
case FE_GET_FRONTEND:
{
struct dvb_frontend_parameters *p = arg;
s32 afc, correction;
afc = ((int)((char)(ves1893_readreg (i2c, 0x0a) << 1)))/2;
correction = ((afc * X) / (p->u.qpsk.symbol_rate / Y)) * Z;
p->frequency -= correction;
What are good values for X, Y, Z?
Since X, Y and Z are simple scaling factors for the fraction
afc/symbol_rate you simplify your formula to: