public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Endriss <o.endriss@gmx.de>
To: linux-dvb@linuxtv.org
Subject: Re: [linux-dvb] TDA10086 fails? DiSEqC bad? TT S-1401 Horizontal transponder fails
Date: Thu, 10 Apr 2008 22:40:13 +0200	[thread overview]
Message-ID: <200804102240.13933@orion.escape-edv.de> (raw)
In-Reply-To: <47E53E1B.5050302@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]

Hi,

Manu Abraham wrote:
> Oliver Endriss wrote:
> ...
> > Ok, some calculations according your formula
> > 
> >>>>> BW = (1 + RO) * SR/2 + 5) * 1.3
> > 
> > 45 MSPS:
> > BW = ((1 + 0.35) * 45/2 + 5) * 1.3 = 46
> > 
> > -> cutoff 36 MHz (maximum value supported)
> > 
> > 27 MSPS:
> > BW = ((1 + 0.35) * 27/2 + 5) * 1.3 = 30,2
> > 
> > -> cutoff 31 MHz
> > 
> > 22 MSPS:
> > BW = ((1 + 0.35) * 22/2 + 5) * 1.3 = 25,8
> > 
> > -> cutoff 26 MHz
> > 
> > Are these calculations correct, or did I miss something here?
> 
> 
> It looks fine, just round it off to the next integer. ie always round it
> up, rather than rounding it down. For the cutoff at 36MHz, it is fine as
> well, since at the last step, you will not need an offset, since it
> would be the last step in the spectrum.
> ...
> > Afaics a simple pre-calculated lookup table with 32 entries should do
> > the job. At least for the cut-off frequency.
> 
> That's possible, since you need only 32 precomputed entries, rather than
> continuous values. That would be much better too, without any runtime
> overheads. Just the table needs to be done nice.

Now I found some time to come back to this issue,

I prepared a small patch to set the cutoff according to Manu's formula.
The calculation is simple enough for integer arithmetic, so it is not
worth to prepare a lookup-table.

@ldvb:
Please test and report whether it works for you.

CU
Oliver

-- 
----------------------------------------------------------------
VDR Remote Plugin 0.4.0: http://www.escape-edv.de/endriss/vdr/
----------------------------------------------------------------

[-- Attachment #2: tda826x_cutoff.diff --]
[-- Type: text/x-diff, Size: 1398 bytes --]

diff -r 8f1c4ba078eb linux/drivers/media/dvb/frontends/tda826x.c
--- a/linux/drivers/media/dvb/frontends/tda826x.c	Wed Mar 26 17:41:21 2008 +0100
+++ b/linux/drivers/media/dvb/frontends/tda826x.c	Thu Apr 10 22:17:48 2008 +0200
@@ -76,12 +76,23 @@ static int tda826x_set_params(struct dvb
 	struct tda826x_priv *priv = fe->tuner_priv;
 	int ret;
 	u32 div;
+	u32 ksyms;
+	u32 bandwidth;
 	u8 buf [11];
 	struct i2c_msg msg = { .addr = priv->i2c_address, .flags = 0, .buf = buf, .len = 11 };
 
 	dprintk("%s:\n", __FUNCTION__);
 
 	div = (params->frequency + (1000-1)) / 1000;
+
+	/* BW = (1 + RO) * SR/2 + 5) * 1.3      [SR in MSPS, BW in MHz] */
+	/* with R0 = 0.35 and some transformations: */
+	ksyms = params->u.qpsk.symbol_rate / 1000;
+	bandwidth = (878 * ksyms + 6500000) / 1000000 + 1;
+	if (bandwidth < 5)
+		bandwidth = 5;
+	else if (bandwidth > 36)
+		bandwidth = 36;
 
 	buf[0] = 0x00; // subaddress
 	buf[1] = 0x09; // powerdown RSSI + the magic value 1
@@ -90,7 +101,7 @@ static int tda826x_set_params(struct dvb
 	buf[2] = (1<<5) | 0x0b; // 1Mhz + 0.45 VCO
 	buf[3] = div >> 7;
 	buf[4] = div << 1;
-	buf[5] = 0x77; // baseband cut-off 19 MHz
+	buf[5] = ((bandwidth - 5) << 3) | 7; /* baseband cut-off */
 	buf[6] = 0xfe; // baseband gain 9 db + no RF attenuation
 	buf[7] = 0x83; // charge pumps at high, tests off
 	buf[8] = 0x80; // recommended value 4 for AMPVCO + disable ports.

[-- Attachment #3: Type: text/plain, Size: 150 bytes --]

_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

  reply	other threads:[~2008-04-10 20:41 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-14 13:29 [linux-dvb] (no subject) ldvb
2008-03-14 13:33 ` Vladimir Prudnikov
2008-03-14 14:39   ` ldvb
2008-03-14 15:17     ` Vladimir Prudnikov
2008-03-14 15:24       ` [linux-dvb] TT budget S-1401 Horizontal transponder fails ldvb
2008-03-17 10:20         ` [linux-dvb] TDA10086 fails? DiSEqC bad? TT " ldvb
2008-03-18 17:38           ` [linux-dvb] TT-budget S-1401 issues. " ldvb
2008-03-20  0:18           ` [linux-dvb] TDA10086 fails? DiSEqC bad? TT S-1401 " Oliver Endriss
2008-03-20 16:33             ` ldvb
2008-03-20 20:55               ` Hartmut Hackmann
2008-03-20 21:14                 ` Manu Abraham
2008-03-20 21:57                   ` Hartmut Hackmann
2008-03-21  9:15                   ` Oliver Endriss
2008-03-21 15:43                     ` Manu Abraham
2008-03-21 16:55                       ` Manu Abraham
2008-03-22  6:11                         ` Oliver Endriss
2008-03-22 17:12                           ` Manu Abraham
2008-04-10 20:40                             ` Oliver Endriss [this message]
2008-04-10 23:33                               ` hermann pitton
2008-04-11 21:29                                 ` Oliver Endriss
2008-04-11 23:35                                   ` hermann pitton
2008-04-11 21:12                               ` Hartmut Hackmann
2008-04-11 21:36                                 ` Oliver Endriss
2008-03-21 18:36                     ` Matthias Schwarzott
2008-03-21 20:00                       ` Manu Abraham
2008-03-21 20:15                         ` Matthias Schwarzott
2008-03-21 20:47                           ` Manu Abraham
2008-03-21 23:25                             ` Matthias Schwarzott
2008-03-22  1:27                               ` Manu Abraham
2008-03-21 10:44                 ` ldvb
2008-03-21  8:56               ` Oliver Endriss
2008-03-21 10:56                 ` ldvb
2008-03-21 14:25                 ` ldvb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200804102240.13933@orion.escape-edv.de \
    --to=o.endriss@gmx.de \
    --cc=linux-dvb@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox