Re: Pinnacle PCTV Sat HDTV Pro USB (PCTV452e) and TT-Connect-S2-3600 final version

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Good news for all stb0899 owners :)

On Saturday 19 April 2008, Dominik Kuhlen wrote:
> Hi,
> 
> Here is my current version after quite a while of testing and tuning:
> I stripped the stb0899 tuning/searching algo to speed up tuning a bit
> now I have very fast and reliable locks (no failures, no errors)
> 
The frequency reported by DVBFE_GET_PARAMS when in DVB-S2 mode is not correct.
The attached patch fixes this:
Now i can request any frequency near the center (even more than 10MHz lower or higher) 
and the reported frequency is within a few kHz of the actual center frequency.


 Dominik

diff -r 42a7b0fff69d linux/drivers/media/dvb/frontends/stb0899_algo.c
--- a/linux/drivers/media/dvb/frontends/stb0899_algo.c	Sat Apr 19 11:27:44 2008 +0200
+++ b/linux/drivers/media/dvb/frontends/stb0899_algo.c	Sat Apr 19 11:30:47 2008 +0200
@@ -1539,14 +1539,16 @@ enum stb0899_status stb0899_dvbs2_algo(s
 
 		/* Store signal parameters	*/
 		offsetfreq = STB0899_READ_S2REG(STB0899_S2DEMOD, CRL_FREQ);
+		if (offsetfreq & 0x20000000) {
+			/* sign extension */
+			offsetfreq |= 0xc0000000;
+		}
+		/* use 64-bit arithmetic to avoid overflow */
+		offsetfreq = (s32)((s64)offsetfreq * 
+		                  ((s64)internal->master_clk / (s64)1000000) / 
+		                  ((s64)((1 << 30) / (s64)1000)));
 
-		offsetfreq = offsetfreq / ((1 << 30) / 1000);
-		offsetfreq *= (internal->master_clk / 1000000);
-		reg = STB0899_READ_S2REG(STB0899_S2DEMOD, DMD_CNTRL2);
-		if (STB0899_GETFIELD(SPECTRUM_INVERT, reg))
-			offsetfreq *= -1;
-
-		internal->freq = internal->freq - offsetfreq;
+		internal->freq = internal->freq + offsetfreq;
 		internal->srate = stb0899_dvbs2_get_srate(state);
 
 		reg = STB0899_READ_S2REG(STB0899_S2DEMOD, UWP_STAT2);

Attachment: signature.asc
Description: This is a digitally signed message part.

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

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux