Re: Debugging the PCTV PRO Radio problem

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



I have done the IsSpurInBand() more resonable, although I don't know if
it matches exactly the flowchart (unsure about the Fifbw, which I can't
find in the code, but it might correspond to the spectrum-parameters).

Patch against 0.7.101:

368,369c368,369
<       int n1=1,n2,f;
< 
---
>       int n1=1,nmax=5,n2,f;
> 
385c385
<               if( (f>spectrum_from) && (f<spectrum_to))
---
>               if( (f>spectrum_from) && (f<spectrum_to)) {
387c387,389
<           } while ( (f>(f2-spectrum_to)) || (n2>-5));
---
>                       return 1; // true
>               }
>           } while ( (f>(f2-spectrum_to)) || (n2>-nmax));
389c391
<       } while (n1<5);
---
>       } while (n1<nmax);
391c393
<       return 1;
---
>       return 0; // false



Whole function:

// IsSpurInBand()?
static int mt2032_spurcheck(int f1, int f2, int spectrum_from,int
spectrum_to)
{
        int n1=1,nmax=5,n2,f;
        
        f1=f1/1000; //scale to kHz to avoid 32bit overflows
        f2=f2/1000;
        spectrum_from/=1000;
        spectrum_to/=1000;

        dprintk("spurcheck f1=%d f2=%d  from=%d
to=%d\n",f1,f2,spectrum_from,spectrum_to);

        do {
            n2=-n1;
            f=n1*(f1-f2);
            do {
                n2--;
                f=f-f2;
                dprintk(" spurtest n1=%d n2=%d ftest=%d\n",n1,n2,f);

                if( (f>spectrum_from) && (f<spectrum_to)) {
                        printk("mt2032 spurcheck triggered: %d\n",n1);
                        return 1; // true
                }
            } while ( (f>(f2-spectrum_to)) || (n2>-nmax));
            n1++;
        } while (n1<nmax);

        return 0; // false
}


Is this correct now? I might take a look at the function that calls this
too.


On Tue, Jan 07, 2003 at 12:18:24PM +0100, Marius Kotsbak wrote:
> On Tue, Jan 07, 2003 at 10:01:10AM +0100, Peter Bienstman wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > 
> > Hi Marius,
> > 
> > I have the same card and I too have been looking at that particular piece of 
> > code. I also think that's the problem. I even downloaded that data sheet and 
> > played with the idea of implementing this.
> 
> For radio, it seems like the spurcheck isn't nessecary, but it is
> probably sometimes needed for TV, so this might be the reason why you
> see better picture with pinnacles driver. BTW: I don't think it is so
> much work to implement it, as the algoritm is clearly specified in the
> datasheet.
> 
> > 
> > BTW, I tried radio under XP, and it doesn't work well either.
> 
> It works with my card under w2k. You could try with some 3-party drivers
> / applications.
> 
> > 
> > Incidentally, did you try watching TV under Windows with this card? 
> > Unfortunately, the image quality is a lot better under XP,
> 
> I havent't seen much difference, but that could be caused by different
> frequencies in norwegian channels, and of your channels.
> 
> > even after trying 
> > all sorts of interlacing and filtering options under Linux (mplayer, 
> > timefortv,...). Do you have the same experience? Which drivers settings and 
> > TV software do you use?
> 
> I just user tuner=33, and use zapping most (overlay mode).
> 
> > 
> > Cheers,
> > 
> > Peter
> > 
> > On Tuesday 07 January 2003 01:46, Marius Kotsbak wrote:
> > > I have started reviewing the code in tuner.c to find why the radio on
> > > PCTV PRO with MT2030-tuner isn't working.
> > >
> > > First I need to know if it has worked well before?
> > >
> > > I have found one possible error source, and that is the spurcheck, which
> > > is as I can see missing. The mt2032_spurcheck() just print some
> > > debug-information, but never touch other than local variables, don't
> > > talk to any hardware, and always return 1. Where it is called, it is
> > > commented "should recalcuulate lo1...".
> > >
> > > What I am not sure of is if this is necessary for radio tuning. In the
> > > datasheet it is noted that the spur removal isn't required for north
> > > Ameracan FM, which seems to have the same range as the norwegian (which
> > > doesn't work well).
> > >
> > > Does anyone (particulary the driver authors) know any other part of the
> > > code I can search for errors? The symtoms as I have said is that the
> > > tuning of radio is bad, som I can only hear sound some seconds before it
> > > turns the sound off. Sound might come back later automatically and
> > > last for some seconds.
> > >
> > > Marius K
> > 
> > - -- 
> > - ------------------------------------------------
> > Peter Bienstman
> > Ghent University, Dep. of Information Technology
> > Sint-Pietersnieuwstraat 41, B-9000 Gent, Belgium
> > tel: +32 9 264 34 45, fax: +32 9 264 35 93
> > email: Peter.Bienstman@xxxxxxxxx
> > - ------------------------------------------------
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.2.1 (GNU/Linux)
> > 
> > iD8DBQE+GpdZ4dgPAIjyquoRAqPpAKDevDaEVSeiu0fSp+p27yMiO+zHcACfVBq0
> > yGIl4Vq96CbWTnkFsnNXCEw=
> > =FUQ2
> > -----END PGP SIGNATURE-----
> 
> 
> 
> --
> video4linux-list mailing list
> Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
> https://listman.redhat.com/mailman/listinfo/video4linux-list





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux