[wellylug] SAA7134
David Antliff
dave.antliff at paradise.net.nz
Tue May 4 23:27:30 NZST 2004
On Tue, 4 May 2004, Ewen McNeill wrote:
> >This doesn't exist in the 2.6.5 driver as far as I can see:
>
> Ah. You could probably substitute wrapping the code you show in an "if"
> statement that only goes into it if the audio_carrier value is not set.
Yes, I managed to get my own modification to 2.6.5 working, based on
yours. Sometimes I get about half a second of static when changing
channels, but then normal sound returns. After 2.5 years of throwing my
remote control across the room in disgust, my only regret is that I didn't
look into the code earlier! :(
> I have had a reply from the author. He has refused my patch. He would
> prefer to try to make the scan work more reliably. I think it will
> always be vulnerable to random noise, and think the user should have the
> option to force the audio carrier setting. If you find something like
> my patch useful you might like to email him (email address in the source
> file) and suggest adding a patch like mine.
Gerd, I assume. He can be a bit blunt. I've corresponded with him several
times in the past (I did some 'work' for him sorting out the saa7134
remote control last year - harvesting GPIO register values, etc). I will
email him and 'second' your patch (or the concept at the very least) but
don't hold your breath...
As an aside, is anyone using version .11 or .12 of saa7134 from
bytesex.org with 1.0-pre3 mencoder? I've found those two driver versions
(maybe older ones too) cause a kernel oops when a particular IOCTL is
called. I can't recall the details but I might look into that again now
the sound works properly.
Cheers,
David.
For Linux 2.6.5 (linux/drivers/media/video/saa7134/saa7134-tvaudio.c):
--- saa7134-tvaudio.c-bkup-2004-05-04 2004-05-04 18:56:44.216607272 +1200
+++ saa7134-tvaudio.c 2004-05-04 18:56:56.806693288 +1200
@@ -497,6 +497,19 @@
carr_scan = carr_secam;
saa_writeb(SAA7134_MONITOR_SELECT,0x00);
tvaudio_setmode(dev,&tvaudio[0],NULL);
+
+ /* Patched by David Antliff <dave.antliff at paradise.net.nz>, 2004/05/04
+ * Based on changes by Ewen McNeill <ewen at naos.co.nz>, 2004/05/02
+ * to skip audio scan if audio_carrier is passed in
+ * (scanning for audio is unreliable).
+ */
+ carrier = 0;
+ if (0 != audio_carrier) {
+ /* carrier passed in; skip scan */
+ dprintk("%s/audio: skipping audio scan "
+ "(value set at insmod)\n", dev->name);
+ }
+ else {
for (i = 0; i < MAX_SCAN; i++) {
if (!carr_scan[i])
continue;
@@ -515,6 +528,7 @@
max2 = carr_vals[i];
}
}
+ }
if (0 != carrier && max1 > 2000 && max1 > max2*3) {
/* found good carrier */
@@ -525,7 +539,7 @@
} else if (0 != audio_carrier) {
/* no carrier -- try insmod option as fallback */
carrier = audio_carrier;
- printk(KERN_WARNING "%s/audio: audio carrier scan failed, "
+ printk(KERN_WARNING "%s/audio: audio carrier scan skipped, "
"using %d.%03d MHz [insmod option]\n",
dev->name, carrier/1000, carrier%1000);
} else if (0 != dev->last_carrier) {
More information about the wellylug
mailing list