diff options
author | Andrew de Quincy <devnull@localhost> | 2004-02-27 12:31:12 +0000 |
---|---|---|
committer | Andrew de Quincy <devnull@localhost> | 2004-02-27 12:31:12 +0000 |
commit | 3e826659c005cc632d7e9e1679215c1c6b3fa6ba (patch) | |
tree | 05f862f34336a160e0455ac92776b60a800bb8f0 /linux/drivers/media/dvb/dvb-core | |
parent | 150ef487aff567acc4ffa69ae9970ee142f9c12a (diff) | |
download | mediapointer-dvb-s2-3e826659c005cc632d7e9e1679215c1c6b3fa6ba.tar.gz mediapointer-dvb-s2-3e826659c005cc632d7e9e1679215c1c6b3fa6ba.tar.bz2 |
More finetuning as a result of experimentation
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_frontend.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c index 39c167812..ba82c56eb 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -368,9 +368,13 @@ static int dvb_frontend_autotune(struct dvb_frontend_data *fe) // choose step size for zigzag scan switch(fe->info->type) { case FE_QPSK: - stepsize = fe->parameters.u.qpsk.symbol_rate / 16000; - maxdrift = fe->parameters.u.qpsk.symbol_rate / 2000; - if (maxdrift < 5000) maxdrift = 5000; + if (fe->parameters.u.qpsk.symbol_rate < 10000000) + stepsize = fe->parameters.u.qpsk.symbol_rate / 32000; + maxdrift = 5000; + else { + stepsize = fe->parameters.u.qpsk.symbol_rate / 16000; + maxdrift = fe->parameters.u.qpsk.symbol_rate / 2000; + } break; case FE_QAM: @@ -706,6 +710,7 @@ static int dvb_frontend_ioctl (struct inode *inode, struct file *file, struct dvb_device *dvbdev = file->private_data; struct dvb_frontend_data *fe = dvbdev->priv; int err = 0; + int delay_ms; dprintk ("%s\n", __FUNCTION__); @@ -731,11 +736,11 @@ static int dvb_frontend_ioctl (struct inode *inode, struct file *file, memcpy (&fe->parameters, parg, sizeof (struct dvb_frontend_parameters)); - fe->min_delay = dvb_frontend_internal_ioctl(&fe->frontend, FE_GETMINDELAY, &fe->parameters); - if (fe->min_delay <= 0) fe->min_delay = HZ/20; // default mindelay of 50ms - + delay_ms = dvb_frontend_internal_ioctl(&fe->frontend, FE_GETMINDELAY, &fe->parameters); + if (delay_ms >= 0) fe->min_delay = (delay_ms * HZ) / 1000; + else fe->min_delay = HZ/20; // default mindelay of 50ms + dvb_frontend_add_event (fe, 0); - wake_up_interruptible(&fe->wait_queue); break; case FE_GET_EVENT: @@ -762,7 +767,13 @@ static int dvb_frontend_ioctl (struct inode *inode, struct file *file, // This ensures the app doesn't start reading data too quickly, perhaps from the // previous lock, which is REALLY CONFUSING TO DEBUG! if ((cmd == FE_SET_FRONTEND) && (err == 0)) { - err = wait_event_interruptible(fe->wait_queue, fe->state == FESTATE_RETUNE); + // note: cannot use wait_event_interruptible_* here as that + // causes the thread not to wake until AFTER the call here returns. This is useless + // because the whole point is to have the thread wake first, and perform at least one tune + wake_up_interruptible(&fe->wait_queue); + while(fe->state & FESTATE_RETUNE) { + dvb_delay(10); + } } return err; |