All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Zary <linux@rainbow-software.org>
To: linux-media@vger.kernel.org
Subject: Re: [RFC PATCH] saa7134: Add AverMedia Satelllite Hybrid+FM A706 (and FM radio problems)
Date: Mon, 14 Jan 2013 22:29:58 +0100	[thread overview]
Message-ID: <201301142229.58923.linux@rainbow-software.org> (raw)
In-Reply-To: <201301122124.51767.linux@rainbow-software.org>

On Saturday 12 January 2013 21:24:50 Ondrej Zary wrote:
> Partially working: FM radio
> Radio seems to be a long-standing problem with saa7134 cards using silicon
> tuners (according to various mailing lists).
>
> On this card, GPIO11 controls 74HC4052 MUX. It switches two things:
> something at TDA18271 V_IFAGC pin and something that goes to SAA7131E.
> GPIO11 is enabled for radio and disabled for TV in Windows. I did the same
> thing in this patch.
>
> Windows INF file says:
> ; Setting FM radio of the Silicon tuner via SIF (GPIO 21 in use/ 5.5MHz)
> HKR, "Audio", "FM Radio IF", 0x00010001, 0xDEEAAB
>
> But that seems not to be true. GPIO21 does nothing and RegSpy (from
> DScaler, modified to include 0x42c register) says that the register is
> 0x80729555. That matches the value present in saa7134-tvaudio.c (except the
> first 0x80).
>
> With this value, the radio stations are off by about 4.2-4.3 MHz, e.g.:
> station at 97.90 MHz is tuned as 102.20 MHz
> station at 101.80 MHz is tuned as 106.0 MHz
>
> I also tried 0xDEEAAB. With this, the offset is different, about 0.4 MHz:
> station at 101.80 MHz is tuned as 102.2 MHz

The offset seems bogus, maybe affected by my TV antenna (cable).

For debugging, tried another card with similar chips: Pinnacle PCTV 
40i/50i/110i. It has SAA7131E chip too, but different tuner - TDA8275A. And 
the radio problem is the same as found first on the A706 - the tuned station 
sound starts but then turns into noise. So it seems that the problem is not 
in tda18271 but in tda8290 or saa7134.

With tda8290.debug=1, I see this:
tda829x 2-004b: tda8290 not locked, no signal?
tda829x 2-004b: tda8290 not locked, no signal?
tda829x 2-004b: tda8290 not locked, no signal?
tda829x 2-004b: adjust gain, step 1. Agc: 193, ADC stat: 255, lock: 0
tda829x 2-004b: adjust gain, step 2. Agc: 255, lock: 0
tda829x 2-004b: adjust gain, step 3. Agc: 173

During that, the sound is good. Then it turns into noise.
When I increased the number of lock detections in tda8290_set_params() from 3 
to (e.g.) 10, it works longer. And when I'm quick enough to stop the console 
output using scroll lock, the radio remains working.

> And what's worst, connecting analog TV antenna (cable TV) affects the radio
> tuner! E.g. the radio is tuned to 106.0 MHz (real 101.80 MHz) with nice
> clean sound. Connecting TV antenna adds strong noise to the sound, tuning
> does not help. This problem is not present in Windows.

I've found a tiny chip marked S79 near the analog tuner. It's Skyworks 
AS179-92LF antenna switch that switches either the TV or FM antenna to the 
TDA18271 FM_IN pin! That's why TV antenna affected the radio. The switch is 
probably controlled by some other GPIO pin (haven't tested this yet). What's 
the best way to expose this switch to userspace?

-- 
Ondrej Zary

  reply	other threads:[~2013-01-14 21:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-12 20:24 [RFC PATCH] saa7134: Add AverMedia Satelllite Hybrid+FM A706 (and FM radio problems) Ondrej Zary
2013-01-14 21:29 ` Ondrej Zary [this message]
2013-01-15 21:57   ` Ondrej Zary
2013-01-15 22:37     ` Ondrej Zary
2013-01-17 23:16       ` Ondrej Zary

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=201301142229.58923.linux@rainbow-software.org \
    --to=linux@rainbow-software.org \
    --cc=linux-media@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.