Skip to contentSkip to conversation

V4L control units

DISCUSSION Antti Palosaari 3 participants 5 messages May 7, 2014 – May 9, 2014 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

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

Signature · 1 line
http://palosaari.fi/
#1 lore raw

Heippa!

Quoted 10 lines · Antti Palosaari

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.

Signature · 4 lines
Terveisin,

Sakari Ailus
e-mail: [email protected]	XMPP: [email protected]
#2 lore raw
Quoted 14 lines · Sakari Ailus

Heippa!

Quoted 10 lines · Antti Palosaari

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

Quoted 6 lines

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.

Quoted 4 lines

<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

#3 lore raw

Hi Hans,

Quoted 22 lines · Hans Verkuil
Quoted 14 lines · Sakari Ailus

Heippa!

Quoted 10 lines · Antti Palosaari

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

Quoted 6 lines

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).

Quoted 2 lines

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.

Quoted 5 lines
Quoted 3 lines

<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.

Quoted 3 lines

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.

Signature · 4 lines
Kind regards,

Sakari Ailus
e-mail: [email protected]	XMPP: [email protected]
#4 lore raw
Quoted 40 lines · Sakari Ailus

Hi Hans,

Quoted 22 lines · Hans Verkuil
Quoted 14 lines · Sakari Ailus

Heippa!

Quoted 10 lines · Antti Palosaari

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

Quoted 6 lines

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).

Quoted 2 lines

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.

Quoted 5 lines
Quoted 3 lines

<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.

Quoted 8 lines
Quoted 3 lines

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

Quoted 5 lines

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.