Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] Re: Budget DVB-C tuning problems
Am Samstag, 7. Februar 2004 13:26 schrieb Robert Schlabbach:
> From: "Antti Kaihola" <antti.kaihola@linux-aktivaattori.org>
>
> > I'm having tuning problems on my budget DVB-C card.
Me too! Me too! (DVB-C in Berlin, Germany)
> Could you elaborate on the "tuning failures". What are you seeing?
I added some trace dprintks and got this (8x == scissors):
---- 8x -------------------------------------------------------------
kernel: ves1820_ioctl FE_SET_FRONTEND
kernel: tuner_set_tv_freq freq=410000000
vdr[4079]: reading EPG data from /video0/epg.data
vdr[4079]: setting watchdog timer to 60 seconds
kernel: ves1820_setup_reg0 reg0=0x8
kernel: ves1820_ioctl FE_READ_STATUS status=0x7
last message repeated 26 times
kernel: ves1820_ioctl FE_READ_STATUS status=0x7 AFC=19 0Hz
last message repeated 8 times
kernel: ves1820_ioctl FE_READ_STATUS status=0x7 AFC=19 3997400Hz
kernel: ves1820_ioctl FE_READ_STATUS status=0x7 AFC=19 0Hz
last message repeated 9 times
kernel: ves1820_ioctl FE_READ_STATUS status=0x7 AFC=19 3997400Hz
kernel: ves1820_ioctl FE_READ_STATUS status=0x7 AFC=19 0Hz
last message repeated 10 times
kernel: ves1820_ioctl FE_READ_STATUS status=0x7 AFC=19 3997400Hz
---- 8x -------------------------------------------------------------
:?
Then I applied Antti Kaiholas "patch" in dvb_frontend_set_parameters():
---- 8x -------------------------------------------------------------
param->frequency += fe->lnb_drift + fe->bending;
++ dvb_frontend_internal_ioctl (frontend, FE_SET_FRONTEND, param);
++ dvb_delay(100); /* clear your head before action */
err = dvb_frontend_internal_ioctl (frontend, FE_SET_FRONTEND, param);
---- 8x -------------------------------------------------------------
Let's have look in /var/log/messages now:
---- 8x -------------------------------------------------------------
vdr[2535]: switching to channel 29
kernel: dvb_bend_frequency
kernel: dvb_frontend_set_parameters: f == 394000
kernel: ves1820_ioctl FE_SET_FRONTEND
kernel: tuner_set_tv_freq freq=394000000
vdr[2535]: reading EPG data from /video0/epg.dat
vdr[2535]: setting watchdog timer to 60 seconds
kernel: ves1820_setup_reg0 reg0=0x8
kernel: PATCH: delay=50
kernel: ves1820_ioctl FE_SET_FRONTEND
kernel: tuner_set_tv_freq freq=394000000
kernel: ves1820_setup_reg0 reg0=0x8
kernel: ves1820_ioctl FE_READ_STATUS status=0x0
kernel: ves1820_ioctl FE_READ_STATUS status=0x0
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
:
:
vdr[2674]: switching to channel 29
kernel: dvb_bend_frequency
kernel: dvb_frontend_set_parameters: f == 3940000
kernel: ves1820_ioctl FE_SET_FRONTEND
kernel: tuner_set_tv_freq freq=394000000
vdr[2674]: reading EPG data from /video0/epg.data
vdr[2674]: setting watchdog timer to 60 seconds
kernel: ves1820_setup_reg0 reg0=0x8
kernel: PATCH: delay=1
kernel: ves1820_ioctl FE_SET_FRONTEND
kernel: tuner_set_tv_freq freq=394000000
kernel: ves1820_setup_reg0 reg0=0x8
kernel: ves1820_ioctl FE_READ_STATUS status=0x0
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
---- 8x -------------------------------------------------------------
Even with delay decreased down to 1 channel switching seems to work properly.
> I found a way to both optimize the channel changing times and to make
> channel changes reliable at the same time: When only the tuning frequency
> has changed (i.e. the demodulator settings are unchanged), do _NOT_
> immediately reset the demodulator. Instead, wait 10 milliseconds and then
> read the VAFC register. If it is outside the range [-4 ... +4], reset the
> demodulator.
Hm, demodulator settings - this is QAM, isn't it?
I did the following:
In ves1820_setup_reg0 I "outcommented" the first two ves1820_writereg (fe,
0x00,... lines. Now channel switching works and "seems to be fast".
/var/log/messages:
---- 8x -------------------------------------------------------------
vdr[3477]: switching to channel 28
kernel: ves1820_ioctl FE_SET_FRONTEND
kernel: tuner_set_tv_freq freq=410000000
vdr[3477]: reading EPG data from /video0/epg.data
vdr[3477]: setting watchdog timer to 60 seconds
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_GET_FRONTEND reg0=0x68
kernel: sync=0x1F DVB: VES1820(0): AFC (-20) 134766Hz
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
last message repeated 12 times
vdr[3477]: max. latency time 1 seconds
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
last message repeated 3 times
vdr[3477]: switching to channel 29
kernel: ves1820_ioctl FE_SET_FRONTEND
kernel: tuner_set_tv_freq freq=394000000
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_GET_FRONTEND reg0=0x68
kernel: sync=0x3F DVB: VES1820(0): AFC (-19) 128028Hz
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
vdr[3477]: switching to channel 30
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
vdr[3477]: switching to channel 31
kernel: ves1820_ioctl FE_SET_FRONTEND
kernel: tuner_set_tv_freq freq=410000000
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_GET_FRONTEND reg0=0x68
kernel: sync=0x2F DVB: VES1820(0): AFC (-20) 134766Hz
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
vdr[3477]: switching to channel 32
kernel: ves1820_ioctl FE_SET_FRONTEND
kernel: tuner_set_tv_freq freq=394000000
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_GET_FRONTEND reg0=0x68
kernel: sync=0x2F DVB: VES1820(0): AFC (-19) 128028Hz
---- 8x -------------------------------------------------------------
...but a few minutes later again
ves1820_ioctl FE_READ_STATUS status=0x7
:(
Now I removed *both* reset lines in ves1820_setup_reg0()
#if 1
dprintk ("No reset\n");
#else
dprintk ("Reset via reg0\n");
ves1820_writereg (fe, 0x00, reg0 & 0xfe);
ves1820_writereg (fe, 0x00, reg0 | 0x01);
#endif
/**
* check lock and toggle inversion bit if required...
*/
if (INVERSION_AUTO == inversion && !(ves1820_readreg (fe, 0x11) & 0x08)) {
mdelay(50);
if (!(ves1820_readreg (fe, 0x11) & 0x08)) {
#if 1
dprintk ("No 2. reset\n");
#else
dprintk ("Reset again..\n");
reg0 ^= 0x20;
ves1820_writereg (fe, 0x00, reg0 & 0xfe);
ves1820_writereg (fe, 0x00, reg0 | 0x01);
#endif
}
}
and it seems to work - even after power off/on:
---- 8x -------------------------------------------------------------
vdr[1201]: switching to channel 28
kernel: ves1820_ioctl FE_SET_FRONTEND
kernel: tuner_set_tv_freq freq=410000000
vdr[1201]: reading EPG data from /video0/epg.data
vdr[1201]: setting watchdog timer to 60 seconds
kernel: ves1820_setup_reg0 reg0=0x8
kernel: No reset
kernel: No 2. reset
kernel: ves1820_ioctl FE_READ_STATUS status=0x0
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: lirc_serial: auto-detected active low receiver
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_GET_FRONTEND reg0=0x68
kernel: sync=0x1F DVB: VES1820(0): AFC (-21) 141504Hz
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
last message repeated 13 times
vdr[1201]: max. latency time 1 seconds
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
last message repeated 5 times
vdr[1201]: switching to channel 29
kernel: ves1820_ioctl FE_SET_FRONTEND
kernel: tuner_set_tv_freq freq=394000000
kernel: ves1820_setup_reg0 reg0=0x8
kernel: No reset
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_GET_FRONTEND reg0=0x68
kernel: sync=0x3F DVB: VES1820(0): AFC (-21) 141504Hz
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
vdr[1201]: switching to channel 30
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
vdr[1201]: switching to channel 31
kernel: ves1820_ioctl FE_SET_FRONTEND
kernel: tuner_set_tv_freq freq=410000000
kernel: ves1820_setup_reg0 reg0=0x8
kernel: No reset
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_GET_FRONTEND reg0=0x68
kernel: sync=0x2F DVB: VES1820(0): AFC (-21) 141504Hz
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
vdr[1201]: switching to channel 32
kernel: ves1820_ioctl FE_SET_FRONTEND
kernel: tuner_set_tv_freq freq=394000000
kernel: ves1820_setup_reg0 reg0=0x8
kernel: No reset
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_READ_STATUS status=0x1F
kernel: ves1820_ioctl FE_GET_FRONTEND reg0=0x68
kernel: sync=0x2F DVB: VES1820(0): AFC (-21) 141504Hz
---- 8x -------------------------------------------------------------
So is the reset really necessary?
Btw. in function ves1820_ioctl case FE_READ_STATUS is this correct:
if (sync & 2)
*status |= FE_HAS_SIGNAL;
if (sync & 2)
*status |= FE_HAS_CARRIER;
What means bit 1?
Kind regards,
Ingolf Haberer
--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.
Home |
Main Index |
Thread Index