From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Ralph Metzler <rjkm@metzlerbros.de>
Cc: Daniel Scheller <d.scheller.oss@gmail.com>,
linux-media@vger.kernel.org, mchehab@kernel.org, jasmin@anw.at
Subject: Re: [PATCH 4/9] [media] dvb-frontends/stv0910: Fix signal strength reporting
Date: Mon, 26 Jun 2017 07:00:35 -0300 [thread overview]
Message-ID: <20170626070035.17f131e3@vento.lan> (raw)
In-Reply-To: <22864.52230.708596.809030@morden.metzler>
Em Mon, 26 Jun 2017 10:55:34 +0200
Ralph Metzler <rjkm@metzlerbros.de> escreveu:
> Daniel Scheller writes:
> > From: Daniel Scheller <d.scheller@gmx.net>
> >
> > Original code at least has some signed/unsigned issues, resulting in
> > values like 32dBm.
>
> I will look into that.
>
> > Change signal strength readout to work without asking
> > the attached tuner, and use a lookup table instead of log calc. Values
>
> How can you determine the exact strength without knowing what the tuner did?
> At least the stv6111 does its own AGC which has to be added.
I remember I had to solve this issue on some other driver[1][2][3]. What I
did was to get the AGC gain from the tuner using a callback,
then I added it to the main gain.
[1] https://www.spinics.net/lists/linux-media/msg101836.html
[2] https://www.spinics.net/lists/linux-media/msg101838.html
[3] https://www.spinics.net/lists/linux-media/msg101842.html
I don't remember why it was not merged upstream, though. Perhaps because
I was in doubt about reporting it as "rf_attenuation" or as "agc gain".
Anyway, with something like that, any demod could check for such
callback. If defined, add it to its AGC own gain, in order to get
the total AGC gain.
> > +struct SLookup padc_lookup[] = {
> > + { 0, 118000 }, /* PADC=+0dBm */
> > + { -100, 93600 }, /* PADC=-1dBm */
> > + { -200, 74500 }, /* PADC=-2dBm */
> > + { -300, 59100 }, /* PADC=-3dBm */
> > + { -400, 47000 }, /* PADC=-4dBm */
> > + { -500, 37300 }, /* PADC=-5dBm */
> > + { -600, 29650 }, /* PADC=-6dBm */
> > + { -700, 23520 }, /* PADC=-7dBm */
> > + { -900, 14850 }, /* PADC=-9dBm */
> > + { -1100, 9380 }, /* PADC=-11dBm */
> > + { -1300, 5910 }, /* PADC=-13dBm */
> > + { -1500, 3730 }, /* PADC=-15dBm */
> > + { -1700, 2354 }, /* PADC=-17dBm */
> > + { -1900, 1485 }, /* PADC=-19dBm */
> > + { -2000, 1179 }, /* PADC=-20dBm */
> > + { -2100, 1000 }, /* PADC=-21dBm */
> > +};
> ...
> > - if (bbgain < (s32) *strength)
> > - *strength -= bbgain;
> > - else
> > - *strength = 0;
> > + padc = TableLookup(padc_lookup, ARRAY_SIZE(padc_lookup), Power) + 352;
> >
>
>
> Where does the padc_lookup table come from?
> I saw it before in CrazyCat github tree.
> Is he or you the original source/author or somebody else?
>
>
> Regards,
> Ralph
Thanks,
Mauro
next prev parent reply other threads:[~2017-06-26 10:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-24 16:02 [PATCH 0/9] STV0910/STV6111 drivers, ddbridge CineS2 V7 support Daniel Scheller
2017-06-24 16:02 ` [PATCH 1/9] [media] dvb-frontends: add ST STV0910 DVB-S/S2 demodulator frontend driver Daniel Scheller
2017-06-24 16:02 ` [PATCH 2/9] [media] dvb-frontends/stv0910: Fix possible buffer overflow Daniel Scheller
2017-06-24 16:02 ` [PATCH 3/9] [media] dvb-frontends/stv0910: add multistream (ISI) and PLS capabilities Daniel Scheller
2017-06-24 16:02 ` [PATCH 4/9] [media] dvb-frontends/stv0910: Fix signal strength reporting Daniel Scheller
2017-06-26 8:55 ` Ralph Metzler
2017-06-26 10:00 ` Mauro Carvalho Chehab [this message]
2017-06-26 10:14 ` Ralph Metzler
2017-06-26 15:39 ` Daniel Scheller
2017-06-24 16:02 ` [PATCH 5/9] [media] dvb-frontends/stv0910: Add missing set_frontend fe-op Daniel Scheller
2017-06-24 16:02 ` [PATCH 6/9] [media] dvb-frontends: add ST STV6111 DVB-S/S2 tuner frontend driver Daniel Scheller
2017-06-24 16:02 ` [PATCH 7/9] [media] ddbridge: return stv09xx id in port_has_stv0900_aa() Daniel Scheller
2017-06-24 16:03 ` [PATCH 8/9] [media] ddbridge: support for CineS2 V7(A) and DuoFlex S2 V4 hardware Daniel Scheller
2017-06-24 16:03 ` [PATCH 9/9] [media] ddbridge: stv0910 single demod mode module option Daniel Scheller
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=20170626070035.17f131e3@vento.lan \
--to=mchehab@s-opensource.com \
--cc=d.scheller.oss@gmail.com \
--cc=jasmin@anw.at \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rjkm@metzlerbros.de \
/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.