All of lore.kernel.org
 help / color / mirror / Atom feed
* V4L control units
@ 2014-05-07 12:55 Antti Palosaari
  0 siblings, 0 replies; 6+ messages in thread
From: Antti Palosaari @ 2014-05-07 12:55 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab, LMML

Moikka
What is preferred way implement controls that could have some known unit 
or unknown unit? For example for gain controls, I would like to offer 
gain in unit of dB (decibel) and also some unknown driver specific unit. 
Should I two controls, one for each unit?

Like that

V4L2_CID_RF_TUNER_LNA_GAIN_AUTO
V4L2_CID_RF_TUNER_LNA_GAIN
V4L2_CID_RF_TUNER_LNA_GAIN_dB


regards
Antti

-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: V4L control units
  2014-05-09 13:46     ` Sakari Ailus
@ 2014-05-09 13:56       ` Hans Verkuil
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Verkuil @ 2014-05-09 13:56 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: Antti Palosaari, Mauro Carvalho Chehab, LMML

On 05/09/2014 03:46 PM, Sakari Ailus wrote:
> Hi Hans,
> 
> On Fri, May 09, 2014 at 02:57:13PM +0200, Hans Verkuil wrote:
>> On 05/08/2014 11:04 AM, Sakari Ailus wrote:
>>> Heippa!
>>>
>>> On Wed, May 07, 2014 at 03:57:11PM +0300, Antti Palosaari wrote:
>>>> What is preferred way implement controls that could have some known
>>>> unit or unknown unit? For example for gain controls, I would like to
>>>> offer gain in unit of dB (decibel) and also some unknown driver
>>>> specific unit. Should I two controls, one for each unit?
>>>>
>>>> Like that
>>>>
>>>> V4L2_CID_RF_TUNER_LNA_GAIN_AUTO
>>>> V4L2_CID_RF_TUNER_LNA_GAIN
>>>> V4L2_CID_RF_TUNER_LNA_GAIN_dB
>>>
>>> I suppose that on any single device there would be a single unit to control
>>> a given... control. Some existing controls do document the unit as well but
>>> I don't think that's scalable nor preferrable. This way we'd have many
>>> different controls to control the same thing but just using a different
>>> unit. The auto control is naturally different. Hans did have a patch to add
>>> the unit to queryctrl (in the form of QUERY_EXT_CTRL).
>>
>> Well, that's going to be dropped again. There were too many comments about
>> that during the mini-summit and it was not critical for me.
> 
> Ok. Thanks for the information.
> 
>>> <URL:http://www.spinics.net/lists/linux-media/msg73136.html>
>>>
>>> I wish we can get these in relatively soon.
>>
>> Sakari, I think you will have to push this if you want this done.
> 
> Ack. I think I proposed something like this already a few years ago so I'm
> fine picking it up. :-) Now it's a good time to add the required space in
> the struct as we're going to have a new IOCTL anyway.
> 
>> One interesting thing to look at: the AVB IEEE 1722.1 standard has extensive
>> support for all sorts of units. I don't know if you have access to the standard
>> document, but it might be interesting to look at what they do there.
> 
> I have access to it but I don't see this would be that interesting in
> regards to what we're doing. In any case, we should document the units so
> that different drivers end up using exactly the same string to signal a
> particular unit.

Actually, it is interesting. AVB has controls as well, and those map pretty
much exactly to the sort of controls we have, and they support a wide range
of units. Look at section 7.3.3 ("Control Value Units") of IEEE 1722.1.

If nothing else, it gives a good insight into how others handle this.

Regards,

	Hans

> I prefer to have a prefix as well: a lot of hardware devices use binary
> fractions so that even if we provide an integer control to the user the
> actual control value may well be divided by e.g. 256. That is a somewhat
> separate topic still.
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: V4L control units
  2014-05-09 12:57   ` Hans Verkuil
@ 2014-05-09 13:46     ` Sakari Ailus
  2014-05-09 13:56       ` Hans Verkuil
  0 siblings, 1 reply; 6+ messages in thread
From: Sakari Ailus @ 2014-05-09 13:46 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Antti Palosaari, Mauro Carvalho Chehab, LMML

Hi Hans,

On Fri, May 09, 2014 at 02:57:13PM +0200, Hans Verkuil wrote:
> On 05/08/2014 11:04 AM, Sakari Ailus wrote:
> > Heippa!
> > 
> > On Wed, May 07, 2014 at 03:57:11PM +0300, Antti Palosaari wrote:
> >> What is preferred way implement controls that could have some known
> >> unit or unknown unit? For example for gain controls, I would like to
> >> offer gain in unit of dB (decibel) and also some unknown driver
> >> specific unit. Should I two controls, one for each unit?
> >>
> >> Like that
> >>
> >> V4L2_CID_RF_TUNER_LNA_GAIN_AUTO
> >> V4L2_CID_RF_TUNER_LNA_GAIN
> >> V4L2_CID_RF_TUNER_LNA_GAIN_dB
> > 
> > I suppose that on any single device there would be a single unit to control
> > a given... control. Some existing controls do document the unit as well but
> > I don't think that's scalable nor preferrable. This way we'd have many
> > different controls to control the same thing but just using a different
> > unit. The auto control is naturally different. Hans did have a patch to add
> > the unit to queryctrl (in the form of QUERY_EXT_CTRL).
> 
> Well, that's going to be dropped again. There were too many comments about
> that during the mini-summit and it was not critical for me.

Ok. Thanks for the information.

> > <URL:http://www.spinics.net/lists/linux-media/msg73136.html>
> > 
> > I wish we can get these in relatively soon.
> 
> Sakari, I think you will have to push this if you want this done.

Ack. I think I proposed something like this already a few years ago so I'm
fine picking it up. :-) Now it's a good time to add the required space in
the struct as we're going to have a new IOCTL anyway.

> One interesting thing to look at: the AVB IEEE 1722.1 standard has extensive
> support for all sorts of units. I don't know if you have access to the standard
> document, but it might be interesting to look at what they do there.

I have access to it but I don't see this would be that interesting in
regards to what we're doing. In any case, we should document the units so
that different drivers end up using exactly the same string to signal a
particular unit.

I prefer to have a prefix as well: a lot of hardware devices use binary
fractions so that even if we provide an integer control to the user the
actual control value may well be divided by e.g. 256. That is a somewhat
separate topic still.

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: V4L control units
  2014-05-08  9:04 ` Sakari Ailus
@ 2014-05-09 12:57   ` Hans Verkuil
  2014-05-09 13:46     ` Sakari Ailus
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Verkuil @ 2014-05-09 12:57 UTC (permalink / raw)
  To: Sakari Ailus, Antti Palosaari; +Cc: Mauro Carvalho Chehab, LMML

On 05/08/2014 11:04 AM, Sakari Ailus wrote:
> Heippa!
> 
> On Wed, May 07, 2014 at 03:57:11PM +0300, Antti Palosaari wrote:
>> What is preferred way implement controls that could have some known
>> unit or unknown unit? For example for gain controls, I would like to
>> offer gain in unit of dB (decibel) and also some unknown driver
>> specific unit. Should I two controls, one for each unit?
>>
>> Like that
>>
>> V4L2_CID_RF_TUNER_LNA_GAIN_AUTO
>> V4L2_CID_RF_TUNER_LNA_GAIN
>> V4L2_CID_RF_TUNER_LNA_GAIN_dB
> 
> I suppose that on any single device there would be a single unit to control
> a given... control. Some existing controls do document the unit as well but
> I don't think that's scalable nor preferrable. This way we'd have many
> different controls to control the same thing but just using a different
> unit. The auto control is naturally different. Hans did have a patch to add
> the unit to queryctrl (in the form of QUERY_EXT_CTRL).

Well, that's going to be dropped again. There were too many comments about
that during the mini-summit and it was not critical for me.

> 
> <URL:http://www.spinics.net/lists/linux-media/msg73136.html>
> 
> I wish we can get these in relatively soon.

Sakari, I think you will have to push this if you want this done.

One interesting thing to look at: the AVB IEEE 1722.1 standard has extensive
support for all sorts of units. I don't know if you have access to the standard
document, but it might be interesting to look at what they do there.

Regards,

	Hans

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: V4L control units
  2014-05-07 12:57 Antti Palosaari
@ 2014-05-08  9:04 ` Sakari Ailus
  2014-05-09 12:57   ` Hans Verkuil
  0 siblings, 1 reply; 6+ messages in thread
From: Sakari Ailus @ 2014-05-08  9:04 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: Hans Verkuil, Mauro Carvalho Chehab, LMML

Heippa!

On Wed, May 07, 2014 at 03:57:11PM +0300, Antti Palosaari wrote:
> What is preferred way implement controls that could have some known
> unit or unknown unit? For example for gain controls, I would like to
> offer gain in unit of dB (decibel) and also some unknown driver
> specific unit. Should I two controls, one for each unit?
> 
> Like that
> 
> V4L2_CID_RF_TUNER_LNA_GAIN_AUTO
> V4L2_CID_RF_TUNER_LNA_GAIN
> V4L2_CID_RF_TUNER_LNA_GAIN_dB

I suppose that on any single device there would be a single unit to control
a given... control. Some existing controls do document the unit as well but
I don't think that's scalable nor preferrable. This way we'd have many
different controls to control the same thing but just using a different
unit. The auto control is naturally different. Hans did have a patch to add
the unit to queryctrl (in the form of QUERY_EXT_CTRL).

<URL:http://www.spinics.net/lists/linux-media/msg73136.html>

I wish we can get these in relatively soon.

-- 
Terveisin,

Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

^ permalink raw reply	[flat|nested] 6+ messages in thread

* V4L control units
@ 2014-05-07 12:57 Antti Palosaari
  2014-05-08  9:04 ` Sakari Ailus
  0 siblings, 1 reply; 6+ messages in thread
From: Antti Palosaari @ 2014-05-07 12:57 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab, LMML

Moikka
What is preferred way implement controls that could have some known unit 
or unknown unit? For example for gain controls, I would like to offer 
gain in unit of dB (decibel) and also some unknown driver specific unit. 
Should I two controls, one for each unit?

Like that

V4L2_CID_RF_TUNER_LNA_GAIN_AUTO
V4L2_CID_RF_TUNER_LNA_GAIN
V4L2_CID_RF_TUNER_LNA_GAIN_dB


regards
Antti

-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-05-09 13:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-07 12:55 V4L control units Antti Palosaari
2014-05-07 12:57 Antti Palosaari
2014-05-08  9:04 ` Sakari Ailus
2014-05-09 12:57   ` Hans Verkuil
2014-05-09 13:46     ` Sakari Ailus
2014-05-09 13:56       ` Hans Verkuil

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.