linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Akihiro TSUKADA <tskd08@gmail.com>, linux-media@vger.kernel.org
Subject: Re: [PATCH v2 1/5] dvb-core: add a new tuner ops to dvb_frontend for APIv5
Date: Sat, 06 Sep 2014 06:10:01 +0300	[thread overview]
Message-ID: <540A7B09.2090300@iki.fi> (raw)
In-Reply-To: <20140905235432.5eeab2a3.m.chehab@samsung.com>



On 09/06/2014 05:54 AM, Mauro Carvalho Chehab wrote:
> Em Fri, 5 Sep 2014 23:51:05 -0300
> Mauro Carvalho Chehab <m.chehab@samsung.com> escreveu:
>
>> Em Sat, 06 Sep 2014 05:09:55 +0300
>> Antti Palosaari <crope@iki.fi> escreveu:
>>
>>> Moro!
>>>
>>> On 08/29/2014 01:45 PM, Akihiro TSUKADA wrote:
>>>> moikka,
>>>>
>>>>> Start polling thread, which polls once per 2 sec or so, which reads RSSI
>>>>> and writes value to struct dtv_frontend_properties. That it is, in my
>>>>> understanding. Same for all those DVBv5 stats. Mauro knows better as he
>>>>> designed that functionality.
>>>>
>>>> I understand that RSSI property should be set directly in the tuner driver,
>>>> but I'm afraid that creating a kthread just for updating RSSI would be
>>>> overkill and complicate matters.
>>>>
>>>> Would you give me an advice? >> Mauro
>>>
>>> Now I know that as I implement it. I added kthread and it works
>>> correctly, just I though it is aimed to work. In my case signal strength
>>> is reported by demod, not tuner, because there is some logic in firmware
>>> to calculate it.
>>>
>>> Here is patches you would like to look as a example:
>>>
>>> af9033: implement DVBv5 statistic for signal strength
>>> https://patchwork.linuxtv.org/patch/25748/
>>
>> Actually, you don't need to add a separate kthread to collect the stats.
>> The DVB frontend core already has a thread that calls the frontend status
>> on every 3 seconds (the time can actually be different, depending on
>> the value for fepriv->delay. So, if the device doesn't have any issues
>> on getting stats on this period, it could just hook the DVBv5 stats logic
>> at ops.read_status().
>
> In time: not implementing its own thread has one drawback: the driver needs
> to check if the minimal time needed to get a new stats were already archived.
>
> Please see the mt86a20s driver and check for some examples on how to
> properly do that.
>
> There, we do things like:
>
> static int mb86a20s_read_signal_strength(struct dvb_frontend *fe)
> {
> 	struct mb86a20s_state *state = fe->demodulator_priv;
> 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
> 	int rc;
> 	unsigned rf_max, rf_min, rf;
>
> 	if (state->get_strength_time &&
> 	   (!time_after(jiffies, state->get_strength_time)))
> 		return c->strength.stat[0].uvalue;
>
> To prevent the stats to be called too fast.

... I simply don't understand why you want hook that RF strength call 
via demod? The frontend cache is shared between demod and tuner. We use 
it for tuner driver as well demod driver. Let the tuner driver make RSSI 
calculation independently without any unneeded relation to demod driver.

regards
Antti

-- 
http://palosaari.fi/

  reply	other threads:[~2014-09-06  3:10 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 15:29 [PATCH v2 0/5] dvb: Add support for PT3 ISDB-S/T card tskd08
2014-08-27 15:29 ` [PATCH v2 1/5] dvb-core: add a new tuner ops to dvb_frontend for APIv5 tskd08
2014-08-27 18:09   ` Antti Palosaari
2014-08-28  9:07     ` Akihiro TSUKADA
2014-08-29  1:05       ` Antti Palosaari
2014-08-29 10:45         ` Akihiro TSUKADA
2014-09-06  2:09           ` Antti Palosaari
2014-09-06  2:51             ` Mauro Carvalho Chehab
2014-09-06  2:54               ` Mauro Carvalho Chehab
2014-09-06  3:10                 ` Antti Palosaari [this message]
2014-09-06  3:17                   ` Mauro Carvalho Chehab
2014-09-06  3:34                     ` Antti Palosaari
2014-09-06 12:35                       ` Mauro Carvalho Chehab
2014-09-06  4:08                     ` Akihiro TSUKADA
2014-09-06 10:36                       ` Antti Palosaari
2014-09-06 12:49                         ` Mauro Carvalho Chehab
2014-09-06 16:24               ` Malcolm Priestley
2014-09-06 16:31                 ` Malcolm Priestley
2014-09-06 21:37                 ` Malcolm Priestley
2014-09-06 22:37                   ` Mauro Carvalho Chehab
2014-09-06 23:38                     ` Antti Palosaari
2014-09-07  9:35                       ` Malcolm Priestley
2014-08-27 15:29 ` [PATCH v2 2/5] mxl301rf: add driver for MaxLinear MxL301RF OFDM tuner tskd08
2014-08-27 15:29 ` [PATCH v2 3/5] qm1d1c0042: add driver for Sharp QM1D1C0042 ISDB-S tuner tskd08
2014-08-27 15:29 ` [PATCH v2 4/5] tc90522: add driver for Toshiba TC90522 quad demodulator tskd08
2014-08-31 10:29   ` Matthias Schwarzott
2014-08-31 13:32     ` Akihiro TSUKADA
2014-08-31 19:48       ` Antti Palosaari
2014-09-01  9:54         ` Akihiro TSUKADA
2014-09-06  2:02           ` Antti Palosaari
2014-09-06  2:27             ` Mauro Carvalho Chehab
2014-09-06  3:00               ` DVB clock source (Re: [PATCH v2 4/5] tc90522: add driver for Toshiba TC90522 quad demodulator) Antti Palosaari
2014-09-06  3:11                 ` Mauro Carvalho Chehab
2014-09-06  3:20                   ` Antti Palosaari
2014-09-06  6:09               ` [PATCH v2 4/5] tc90522: add driver for Toshiba TC90522 quad demodulator Akihiro TSUKADA
2014-09-06  6:51                 ` Antti Palosaari
2014-09-06 19:35                   ` Akihiro TSUKADA
2014-09-07  1:05                     ` Antti Palosaari
2014-09-06  7:13                 ` Antti Palosaari
2014-08-27 15:29 ` [PATCH v2 5/5] pt3: add support for Earthsoft PT3 ISDB-S/T receiver card tskd08

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=540A7B09.2090300@iki.fi \
    --to=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=tskd08@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).