All of lore.kernel.org
 help / color / mirror / Atom feed
* [REVIEW PATCH 00/13] SDR API - V4L API stuff itself
@ 2014-02-27  0:21 Antti Palosaari
  2014-02-27  0:21 ` [REVIEW PATCH 01/13] v4l: add RF tuner gain controls Antti Palosaari
                   ` (12 more replies)
  0 siblings, 13 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-02-27  0:21 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Antti Palosaari

Controls, stream formats and documentation for those.
That is all API stuff.

Antti

Antti Palosaari (13):
  v4l: add RF tuner gain controls
  v4l: add RF tuner channel bandwidth control
  v4l: reorganize RF tuner control ID numbers
  v4l: uapi: add SDR formats CU8 and CU16LE
  v4l: add enum_freq_bands support to tuner sub-device
  v4l: add control for RF tuner PLL lock flag
  DocBook: V4L: add V4L2_SDR_FMT_CU8 - 'CU08'
  DocBook: V4L: add V4L2_SDR_FMT_CU16LE - 'CU16'
  DocBook: document RF tuner gain controls
  DocBook: media: document V4L2_CTRL_CLASS_RF_TUNER
  DocBook: document RF tuner bandwidth controls
  DocBook: media: document PLL lock control
  DocBook: media: add some general info about RF tuners

 Documentation/DocBook/media/v4l/controls.xml       | 138 +++++++++++++++++++++
 .../DocBook/media/v4l/pixfmt-sdr-cu08.xml          |  44 +++++++
 .../DocBook/media/v4l/pixfmt-sdr-cu16le.xml        |  46 +++++++
 Documentation/DocBook/media/v4l/pixfmt.xml         |   3 +
 .../DocBook/media/v4l/vidioc-g-ext-ctrls.xml       |   7 +-
 drivers/media/v4l2-core/v4l2-ctrls.c               |  24 ++++
 include/media/v4l2-subdev.h                        |   1 +
 include/uapi/linux/v4l2-controls.h                 |  14 +++
 include/uapi/linux/videodev2.h                     |   4 +
 9 files changed, 280 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-sdr-cu08.xml
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-sdr-cu16le.xml

-- 
1.8.5.3


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

* [REVIEW PATCH 01/13] v4l: add RF tuner gain controls
  2014-02-27  0:21 [REVIEW PATCH 00/13] SDR API - V4L API stuff itself Antti Palosaari
@ 2014-02-27  0:21 ` Antti Palosaari
  2014-02-27  0:21 ` [REVIEW PATCH 02/13] v4l: add RF tuner channel bandwidth control Antti Palosaari
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-02-27  0:21 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Antti Palosaari

Modern silicon RF tuners used nowadays has many controllable gain
stages on signal path. Usually, but not always, there is at least
3 gain stages. Also on some cases there could be multiple gain
stages within the ones specified here. However, I think that having
these three controllable gain stages offers enough fine-tuning for
real use cases.

1) LNA gain. That is first gain just after antenna input.
2) Mixer gain. It is located quite middle of the signal path, where
RF signal is down-converted to IF/BB.
3) IF gain. That is last gain in order to adjust output signal level
to optimal level for receiving party (usually demodulator ADC).

Each gain stage could be set rather often both manual or automatic
(AGC) mode. Due to that add separate controls for controlling
operation mode.

Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 15 +++++++++++++++
 include/uapi/linux/v4l2-controls.h   | 11 +++++++++++
 2 files changed, 26 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index 6ff002b..7c6305c 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -857,6 +857,14 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_FM_RX_CLASS:		return "FM Radio Receiver Controls";
 	case V4L2_CID_TUNE_DEEMPHASIS:		return "De-Emphasis";
 	case V4L2_CID_RDS_RECEPTION:		return "RDS Reception";
+
+	case V4L2_CID_RF_TUNER_CLASS:		return "RF Tuner Controls";
+	case V4L2_CID_RF_TUNER_LNA_GAIN_AUTO:	return "LNA Gain, Auto";
+	case V4L2_CID_RF_TUNER_LNA_GAIN:	return "LNA Gain";
+	case V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO:	return "Mixer Gain, Auto";
+	case V4L2_CID_RF_TUNER_MIXER_GAIN:	return "Mixer Gain";
+	case V4L2_CID_RF_TUNER_IF_GAIN_AUTO:	return "IF Gain, Auto";
+	case V4L2_CID_RF_TUNER_IF_GAIN:		return "IF Gain";
 	default:
 		return NULL;
 	}
@@ -906,6 +914,9 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 	case V4L2_CID_WIDE_DYNAMIC_RANGE:
 	case V4L2_CID_IMAGE_STABILIZATION:
 	case V4L2_CID_RDS_RECEPTION:
+	case V4L2_CID_RF_TUNER_LNA_GAIN_AUTO:
+	case V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO:
+	case V4L2_CID_RF_TUNER_IF_GAIN_AUTO:
 		*type = V4L2_CTRL_TYPE_BOOLEAN;
 		*min = 0;
 		*max = *step = 1;
@@ -991,6 +1002,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 	case V4L2_CID_IMAGE_PROC_CLASS:
 	case V4L2_CID_DV_CLASS:
 	case V4L2_CID_FM_RX_CLASS:
+	case V4L2_CID_RF_TUNER_CLASS:
 		*type = V4L2_CTRL_TYPE_CTRL_CLASS;
 		/* You can neither read not write these */
 		*flags |= V4L2_CTRL_FLAG_READ_ONLY | V4L2_CTRL_FLAG_WRITE_ONLY;
@@ -1063,6 +1075,9 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 	case V4L2_CID_PILOT_TONE_FREQUENCY:
 	case V4L2_CID_TUNE_POWER_LEVEL:
 	case V4L2_CID_TUNE_ANTENNA_CAPACITOR:
+	case V4L2_CID_RF_TUNER_LNA_GAIN:
+	case V4L2_CID_RF_TUNER_MIXER_GAIN:
+	case V4L2_CID_RF_TUNER_IF_GAIN:
 		*flags |= V4L2_CTRL_FLAG_SLIDER;
 		break;
 	case V4L2_CID_PAN_RELATIVE:
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index 2cbe605..817e2df 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -60,6 +60,7 @@
 #define V4L2_CTRL_CLASS_IMAGE_PROC	0x009f0000	/* Image processing controls */
 #define V4L2_CTRL_CLASS_DV		0x00a00000	/* Digital Video controls */
 #define V4L2_CTRL_CLASS_FM_RX		0x00a10000	/* FM Receiver controls */
+#define V4L2_CTRL_CLASS_RF_TUNER	0x00a20000	/* RF tuner controls */
 
 /* User-class control IDs */
 
@@ -895,4 +896,14 @@ enum v4l2_deemphasis {
 
 #define V4L2_CID_RDS_RECEPTION			(V4L2_CID_FM_RX_CLASS_BASE + 2)
 
+#define V4L2_CID_RF_TUNER_CLASS_BASE		(V4L2_CTRL_CLASS_RF_TUNER | 0x900)
+#define V4L2_CID_RF_TUNER_CLASS			(V4L2_CTRL_CLASS_RF_TUNER | 1)
+
+#define V4L2_CID_RF_TUNER_LNA_GAIN_AUTO		(V4L2_CID_RF_TUNER_CLASS_BASE + 1)
+#define V4L2_CID_RF_TUNER_LNA_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 2)
+#define V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO	(V4L2_CID_RF_TUNER_CLASS_BASE + 3)
+#define V4L2_CID_RF_TUNER_MIXER_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 4)
+#define V4L2_CID_RF_TUNER_IF_GAIN_AUTO		(V4L2_CID_RF_TUNER_CLASS_BASE + 5)
+#define V4L2_CID_RF_TUNER_IF_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 6)
+
 #endif
-- 
1.8.5.3


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

* [REVIEW PATCH 02/13] v4l: add RF tuner channel bandwidth control
  2014-02-27  0:21 [REVIEW PATCH 00/13] SDR API - V4L API stuff itself Antti Palosaari
  2014-02-27  0:21 ` [REVIEW PATCH 01/13] v4l: add RF tuner gain controls Antti Palosaari
@ 2014-02-27  0:21 ` Antti Palosaari
  2014-02-27  0:21 ` [REVIEW PATCH 03/13] v4l: reorganize RF tuner control ID numbers Antti Palosaari
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-02-27  0:21 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Antti Palosaari

Modern silicon RF tuners has one or more adjustable filters on
signal path, in order to filter noise from desired radio channel.

Add channel bandwidth control to tell the driver which is radio
channel width we want receive. Filters could be then adjusted by
the driver or hardware, using RF frequency and channel bandwidth
as a base of filter calculations.

On automatic mode (normal mode), bandwidth is calculated from sampling
rate or tuning info got from userspace. That new control gives
possibility to set manual mode and let user have more control for
filters.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 4 ++++
 include/uapi/linux/v4l2-controls.h   | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index 7c6305c..07400dc 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -865,6 +865,8 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_RF_TUNER_MIXER_GAIN:	return "Mixer Gain";
 	case V4L2_CID_RF_TUNER_IF_GAIN_AUTO:	return "IF Gain, Auto";
 	case V4L2_CID_RF_TUNER_IF_GAIN:		return "IF Gain";
+	case V4L2_CID_RF_TUNER_BANDWIDTH_AUTO:	return "Bandwidth, Auto";
+	case V4L2_CID_RF_TUNER_BANDWIDTH:	return "Bandwidth";
 	default:
 		return NULL;
 	}
@@ -917,6 +919,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 	case V4L2_CID_RF_TUNER_LNA_GAIN_AUTO:
 	case V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO:
 	case V4L2_CID_RF_TUNER_IF_GAIN_AUTO:
+	case V4L2_CID_RF_TUNER_BANDWIDTH_AUTO:
 		*type = V4L2_CTRL_TYPE_BOOLEAN;
 		*min = 0;
 		*max = *step = 1;
@@ -1078,6 +1081,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 	case V4L2_CID_RF_TUNER_LNA_GAIN:
 	case V4L2_CID_RF_TUNER_MIXER_GAIN:
 	case V4L2_CID_RF_TUNER_IF_GAIN:
+	case V4L2_CID_RF_TUNER_BANDWIDTH:
 		*flags |= V4L2_CTRL_FLAG_SLIDER;
 		break;
 	case V4L2_CID_PAN_RELATIVE:
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index 817e2df..2f6b5fb 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -905,5 +905,7 @@ enum v4l2_deemphasis {
 #define V4L2_CID_RF_TUNER_MIXER_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 4)
 #define V4L2_CID_RF_TUNER_IF_GAIN_AUTO		(V4L2_CID_RF_TUNER_CLASS_BASE + 5)
 #define V4L2_CID_RF_TUNER_IF_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 6)
+#define V4L2_CID_RF_TUNER_BANDWIDTH_AUTO	(V4L2_CID_RF_TUNER_CLASS_BASE + 7)
+#define V4L2_CID_RF_TUNER_BANDWIDTH		(V4L2_CID_RF_TUNER_CLASS_BASE + 8)
 
 #endif
-- 
1.8.5.3


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

* [REVIEW PATCH 03/13] v4l: reorganize RF tuner control ID numbers
  2014-02-27  0:21 [REVIEW PATCH 00/13] SDR API - V4L API stuff itself Antti Palosaari
  2014-02-27  0:21 ` [REVIEW PATCH 01/13] v4l: add RF tuner gain controls Antti Palosaari
  2014-02-27  0:21 ` [REVIEW PATCH 02/13] v4l: add RF tuner channel bandwidth control Antti Palosaari
@ 2014-02-27  0:21 ` Antti Palosaari
  2014-02-27  0:21 ` [REVIEW PATCH 04/13] v4l: uapi: add SDR formats CU8 and CU16LE Antti Palosaari
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-02-27  0:21 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Antti Palosaari

It appears that controls are ordered by ID number when enumerating.
That could lead illogical UI as controls are usually enumerated and
drawn by the application at runtime.

Change order of controls by reorganizing assigned IDs now as we can.
It is not reasonable possible after the API is released. Also, leave
some spare space between IDs too for possible future extensions.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 include/uapi/linux/v4l2-controls.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index 2f6b5fb..b7d4bb8 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -899,13 +899,13 @@ enum v4l2_deemphasis {
 #define V4L2_CID_RF_TUNER_CLASS_BASE		(V4L2_CTRL_CLASS_RF_TUNER | 0x900)
 #define V4L2_CID_RF_TUNER_CLASS			(V4L2_CTRL_CLASS_RF_TUNER | 1)
 
-#define V4L2_CID_RF_TUNER_LNA_GAIN_AUTO		(V4L2_CID_RF_TUNER_CLASS_BASE + 1)
-#define V4L2_CID_RF_TUNER_LNA_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 2)
-#define V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO	(V4L2_CID_RF_TUNER_CLASS_BASE + 3)
-#define V4L2_CID_RF_TUNER_MIXER_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 4)
-#define V4L2_CID_RF_TUNER_IF_GAIN_AUTO		(V4L2_CID_RF_TUNER_CLASS_BASE + 5)
-#define V4L2_CID_RF_TUNER_IF_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 6)
-#define V4L2_CID_RF_TUNER_BANDWIDTH_AUTO	(V4L2_CID_RF_TUNER_CLASS_BASE + 7)
-#define V4L2_CID_RF_TUNER_BANDWIDTH		(V4L2_CID_RF_TUNER_CLASS_BASE + 8)
+#define V4L2_CID_RF_TUNER_BANDWIDTH_AUTO	(V4L2_CID_RF_TUNER_CLASS_BASE + 11)
+#define V4L2_CID_RF_TUNER_BANDWIDTH		(V4L2_CID_RF_TUNER_CLASS_BASE + 12)
+#define V4L2_CID_RF_TUNER_LNA_GAIN_AUTO		(V4L2_CID_RF_TUNER_CLASS_BASE + 41)
+#define V4L2_CID_RF_TUNER_LNA_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 42)
+#define V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO	(V4L2_CID_RF_TUNER_CLASS_BASE + 51)
+#define V4L2_CID_RF_TUNER_MIXER_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 52)
+#define V4L2_CID_RF_TUNER_IF_GAIN_AUTO		(V4L2_CID_RF_TUNER_CLASS_BASE + 61)
+#define V4L2_CID_RF_TUNER_IF_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 62)
 
 #endif
-- 
1.8.5.3


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

* [REVIEW PATCH 04/13] v4l: uapi: add SDR formats CU8 and CU16LE
  2014-02-27  0:21 [REVIEW PATCH 00/13] SDR API - V4L API stuff itself Antti Palosaari
                   ` (2 preceding siblings ...)
  2014-02-27  0:21 ` [REVIEW PATCH 03/13] v4l: reorganize RF tuner control ID numbers Antti Palosaari
@ 2014-02-27  0:21 ` Antti Palosaari
  2014-02-27  0:22 ` [REVIEW PATCH 05/13] v4l: add enum_freq_bands support to tuner sub-device Antti Palosaari
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-02-27  0:21 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Antti Palosaari

V4L2_SDR_FMT_CU8 — Complex unsigned 8-bit IQ sample
V4L2_SDR_FMT_CU16LE — Complex unsigned 16-bit little endian IQ sample

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 include/uapi/linux/videodev2.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 27fedfe..3411215 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -436,6 +436,10 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SE401      v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
 #define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */
 
+/* SDR formats - used only for Software Defined Radio devices */
+#define V4L2_SDR_FMT_CU8          v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
+#define V4L2_SDR_FMT_CU16LE       v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */
+
 /*
  *	F O R M A T   E N U M E R A T I O N
  */
-- 
1.8.5.3


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

* [REVIEW PATCH 05/13] v4l: add enum_freq_bands support to tuner sub-device
  2014-02-27  0:21 [REVIEW PATCH 00/13] SDR API - V4L API stuff itself Antti Palosaari
                   ` (3 preceding siblings ...)
  2014-02-27  0:21 ` [REVIEW PATCH 04/13] v4l: uapi: add SDR formats CU8 and CU16LE Antti Palosaari
@ 2014-02-27  0:22 ` Antti Palosaari
  2014-02-27  0:22 ` [REVIEW PATCH 06/13] v4l: add control for RF tuner PLL lock flag Antti Palosaari
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-02-27  0:22 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Antti Palosaari

Add VIDIOC_ENUM_FREQ_BANDS, enumerate supported frequency bands,
IOCTL support for sub-device tuners too.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 include/media/v4l2-subdev.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index d67210a..4682aad 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -192,6 +192,7 @@ struct v4l2_subdev_tuner_ops {
 	int (*s_radio)(struct v4l2_subdev *sd);
 	int (*s_frequency)(struct v4l2_subdev *sd, const struct v4l2_frequency *freq);
 	int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
+	int (*enum_freq_bands)(struct v4l2_subdev *sd, struct v4l2_frequency_band *band);
 	int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
 	int (*s_tuner)(struct v4l2_subdev *sd, const struct v4l2_tuner *vt);
 	int (*g_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
-- 
1.8.5.3


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

* [REVIEW PATCH 06/13] v4l: add control for RF tuner PLL lock flag
  2014-02-27  0:21 [REVIEW PATCH 00/13] SDR API - V4L API stuff itself Antti Palosaari
                   ` (4 preceding siblings ...)
  2014-02-27  0:22 ` [REVIEW PATCH 05/13] v4l: add enum_freq_bands support to tuner sub-device Antti Palosaari
@ 2014-02-27  0:22 ` Antti Palosaari
  2014-02-27  0:22 ` [REVIEW PATCH 07/13] DocBook: V4L: add V4L2_SDR_FMT_CU8 - 'CU08' Antti Palosaari
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-02-27  0:22 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Antti Palosaari, Mauro Carvalho Chehab

Add volatile boolean control to indicate if tuner frequency synthesizer
is locked to requested frequency. That means tuner is able to receive
given frequency. Control is named as "PLL lock", since frequency
synthesizers are based of phase-locked-loop. Maybe more general name
could be wise still?

Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 5 +++++
 include/uapi/linux/v4l2-controls.h   | 1 +
 2 files changed, 6 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index 07400dc..7f1bcab 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -867,6 +867,7 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_RF_TUNER_IF_GAIN:		return "IF Gain";
 	case V4L2_CID_RF_TUNER_BANDWIDTH_AUTO:	return "Bandwidth, Auto";
 	case V4L2_CID_RF_TUNER_BANDWIDTH:	return "Bandwidth";
+	case V4L2_CID_RF_TUNER_PLL_LOCK:	return "PLL Lock";
 	default:
 		return NULL;
 	}
@@ -920,6 +921,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 	case V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO:
 	case V4L2_CID_RF_TUNER_IF_GAIN_AUTO:
 	case V4L2_CID_RF_TUNER_BANDWIDTH_AUTO:
+	case V4L2_CID_RF_TUNER_PLL_LOCK:
 		*type = V4L2_CTRL_TYPE_BOOLEAN;
 		*min = 0;
 		*max = *step = 1;
@@ -1100,6 +1102,9 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 	case V4L2_CID_DV_RX_POWER_PRESENT:
 		*flags |= V4L2_CTRL_FLAG_READ_ONLY;
 		break;
+	case V4L2_CID_RF_TUNER_PLL_LOCK:
+		*flags |= V4L2_CTRL_FLAG_VOLATILE;
+		break;
 	}
 }
 EXPORT_SYMBOL(v4l2_ctrl_fill);
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index b7d4bb8..363a092 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -907,5 +907,6 @@ enum v4l2_deemphasis {
 #define V4L2_CID_RF_TUNER_MIXER_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 52)
 #define V4L2_CID_RF_TUNER_IF_GAIN_AUTO		(V4L2_CID_RF_TUNER_CLASS_BASE + 61)
 #define V4L2_CID_RF_TUNER_IF_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 62)
+#define V4L2_CID_RF_TUNER_PLL_LOCK			(V4L2_CID_RF_TUNER_CLASS_BASE + 91)
 
 #endif
-- 
1.8.5.3


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

* [REVIEW PATCH 07/13] DocBook: V4L: add V4L2_SDR_FMT_CU8 - 'CU08'
  2014-02-27  0:21 [REVIEW PATCH 00/13] SDR API - V4L API stuff itself Antti Palosaari
                   ` (5 preceding siblings ...)
  2014-02-27  0:22 ` [REVIEW PATCH 06/13] v4l: add control for RF tuner PLL lock flag Antti Palosaari
@ 2014-02-27  0:22 ` Antti Palosaari
  2014-02-27  0:22 ` [REVIEW PATCH 08/13] DocBook: V4L: add V4L2_SDR_FMT_CU16LE - 'CU16' Antti Palosaari
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-02-27  0:22 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Antti Palosaari

Document V4L2_SDR_FMT_CU8 SDR format.
It is complex unsigned 8-bit IQ sample. Used by software defined
radio devices.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 .../DocBook/media/v4l/pixfmt-sdr-cu08.xml          | 44 ++++++++++++++++++++++
 Documentation/DocBook/media/v4l/pixfmt.xml         |  2 +
 2 files changed, 46 insertions(+)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-sdr-cu08.xml

diff --git a/Documentation/DocBook/media/v4l/pixfmt-sdr-cu08.xml b/Documentation/DocBook/media/v4l/pixfmt-sdr-cu08.xml
new file mode 100644
index 0000000..2d80104
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-sdr-cu08.xml
@@ -0,0 +1,44 @@
+<refentry id="V4L2-SDR-FMT-CU08">
+  <refmeta>
+    <refentrytitle>V4L2_SDR_FMT_CU8 ('CU08')</refentrytitle>
+    &manvol;
+  </refmeta>
+    <refnamediv>
+      <refname>
+        <constant>V4L2_SDR_FMT_CU8</constant>
+      </refname>
+      <refpurpose>Complex unsigned 8-bit IQ sample</refpurpose>
+    </refnamediv>
+    <refsect1>
+      <title>Description</title>
+      <para>
+This format contains sequence of complex number samples. Each complex number
+consist two parts, called In-phase and Quadrature (IQ). Both I and Q are
+represented as a 8 bit unsigned number. I value comes first and Q value after
+that.
+      </para>
+    <example>
+      <title><constant>V4L2_SDR_FMT_CU8</constant> 1 sample</title>
+      <formalpara>
+        <title>Byte Order.</title>
+        <para>Each cell is one byte.
+          <informaltable frame="none">
+            <tgroup cols="2" align="center">
+              <colspec align="left" colwidth="2*" />
+              <tbody valign="top">
+                <row>
+                  <entry>start&nbsp;+&nbsp;0:</entry>
+                  <entry>I'<subscript>0</subscript></entry>
+                </row>
+                <row>
+                  <entry>start&nbsp;+&nbsp;1:</entry>
+                  <entry>Q'<subscript>0</subscript></entry>
+                </row>
+              </tbody>
+            </tgroup>
+          </informaltable>
+        </para>
+      </formalpara>
+    </example>
+  </refsect1>
+</refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
index f586d34..40adcb8 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -817,6 +817,8 @@ extended control <constant>V4L2_CID_MPEG_STREAM_TYPE</constant>, see
     <para>These formats are used for <link linkend="sdr">SDR Capture</link>
 interface only.</para>
 
+    &sub-sdr-cu08;
+
   </section>
 
   <section id="pixfmt-reserved">
-- 
1.8.5.3


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

* [REVIEW PATCH 08/13] DocBook: V4L: add V4L2_SDR_FMT_CU16LE - 'CU16'
  2014-02-27  0:21 [REVIEW PATCH 00/13] SDR API - V4L API stuff itself Antti Palosaari
                   ` (6 preceding siblings ...)
  2014-02-27  0:22 ` [REVIEW PATCH 07/13] DocBook: V4L: add V4L2_SDR_FMT_CU8 - 'CU08' Antti Palosaari
@ 2014-02-27  0:22 ` Antti Palosaari
  2014-02-27  0:22 ` [REVIEW PATCH 09/13] DocBook: document RF tuner gain controls Antti Palosaari
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-02-27  0:22 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Antti Palosaari

Document V4L2_SDR_FMT_CU16LE format.
It is complex unsigned 16-bit little endian IQ sample. Used by
software defined radio devices.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 .../DocBook/media/v4l/pixfmt-sdr-cu16le.xml        | 46 ++++++++++++++++++++++
 Documentation/DocBook/media/v4l/pixfmt.xml         |  1 +
 2 files changed, 47 insertions(+)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-sdr-cu16le.xml

diff --git a/Documentation/DocBook/media/v4l/pixfmt-sdr-cu16le.xml b/Documentation/DocBook/media/v4l/pixfmt-sdr-cu16le.xml
new file mode 100644
index 0000000..26288ff
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-sdr-cu16le.xml
@@ -0,0 +1,46 @@
+<refentry id="V4L2-SDR-FMT-CU16LE">
+  <refmeta>
+    <refentrytitle>V4L2_SDR_FMT_CU16LE ('CU16')</refentrytitle>
+    &manvol;
+  </refmeta>
+    <refnamediv>
+      <refname>
+        <constant>V4L2_SDR_FMT_CU16LE</constant>
+      </refname>
+      <refpurpose>Complex unsigned 16-bit little endian IQ sample</refpurpose>
+    </refnamediv>
+    <refsect1>
+      <title>Description</title>
+      <para>
+This format contains sequence of complex number samples. Each complex number
+consist two parts, called In-phase and Quadrature (IQ). Both I and Q are
+represented as a 16 bit unsigned little endian number. I value comes first
+and Q value after that.
+      </para>
+    <example>
+      <title><constant>V4L2_SDR_FMT_CU16LE</constant> 1 sample</title>
+      <formalpara>
+        <title>Byte Order.</title>
+        <para>Each cell is one byte.
+          <informaltable frame="none">
+            <tgroup cols="3" align="center">
+              <colspec align="left" colwidth="2*" />
+              <tbody valign="top">
+                <row>
+                  <entry>start&nbsp;+&nbsp;0:</entry>
+                  <entry>I'<subscript>0[7:0]</subscript></entry>
+                  <entry>I'<subscript>0[15:8]</subscript></entry>
+                </row>
+                <row>
+                  <entry>start&nbsp;+&nbsp;2:</entry>
+                  <entry>Q'<subscript>0[7:0]</subscript></entry>
+                  <entry>Q'<subscript>0[15:8]</subscript></entry>
+                </row>
+              </tbody>
+            </tgroup>
+          </informaltable>
+        </para>
+      </formalpara>
+    </example>
+  </refsect1>
+</refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
index 40adcb8..f535d9b 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -818,6 +818,7 @@ extended control <constant>V4L2_CID_MPEG_STREAM_TYPE</constant>, see
 interface only.</para>
 
     &sub-sdr-cu08;
+    &sub-sdr-cu16le;
 
   </section>
 
-- 
1.8.5.3


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

* [REVIEW PATCH 09/13] DocBook: document RF tuner gain controls
  2014-02-27  0:21 [REVIEW PATCH 00/13] SDR API - V4L API stuff itself Antti Palosaari
                   ` (7 preceding siblings ...)
  2014-02-27  0:22 ` [REVIEW PATCH 08/13] DocBook: V4L: add V4L2_SDR_FMT_CU16LE - 'CU16' Antti Palosaari
@ 2014-02-27  0:22 ` Antti Palosaari
  2014-02-27  0:22 ` [REVIEW PATCH 10/13] DocBook: media: document V4L2_CTRL_CLASS_RF_TUNER Antti Palosaari
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-02-27  0:22 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Antti Palosaari

Add documentation for LNA, mixer and IF gain controls. These
controls are RF tuner specific.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 Documentation/DocBook/media/v4l/controls.xml | 91 ++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
index a5a3188..6c9dbf6 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -4971,4 +4971,95 @@ defines possible values for de-emphasis. Here they are:</entry>
       </table>
 
       </section>
+
+    <section id="rf-tuner-controls">
+      <title>RF Tuner Control Reference</title>
+
+      <para>The RF Tuner (RF_TUNER) class includes controls for common features
+of devices having RF tuner.</para>
+
+      <table pgwide="1" frame="none" id="rf-tuner-control-id">
+        <title>RF_TUNER Control IDs</title>
+
+        <tgroup cols="4">
+          <colspec colname="c1" colwidth="1*" />
+          <colspec colname="c2" colwidth="6*" />
+          <colspec colname="c3" colwidth="2*" />
+          <colspec colname="c4" colwidth="6*" />
+          <spanspec namest="c1" nameend="c2" spanname="id" />
+          <spanspec namest="c2" nameend="c4" spanname="descr" />
+          <thead>
+            <row>
+              <entry spanname="id" align="left">ID</entry>
+              <entry align="left">Type</entry>
+            </row>
+            <row rowsep="1">
+              <entry spanname="descr" align="left">Description</entry>
+            </row>
+          </thead>
+          <tbody valign="top">
+            <row><entry></entry></row>
+            <row>
+              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_CLASS</constant>&nbsp;</entry>
+              <entry>class</entry>
+            </row><row><entry spanname="descr">The RF_TUNER class
+descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
+description of this control class.</entry>
+            </row>
+            <row>
+              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_LNA_GAIN_AUTO</constant>&nbsp;</entry>
+              <entry>boolean</entry>
+            </row>
+            <row>
+              <entry spanname="descr">Enables/disables LNA automatic gain control (AGC)</entry>
+            </row>
+            <row>
+              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO</constant>&nbsp;</entry>
+              <entry>boolean</entry>
+            </row>
+            <row>
+              <entry spanname="descr">Enables/disables mixer automatic gain control (AGC)</entry>
+            </row>
+            <row>
+              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_IF_GAIN_AUTO</constant>&nbsp;</entry>
+              <entry>boolean</entry>
+            </row>
+            <row>
+              <entry spanname="descr">Enables/disables IF automatic gain control (AGC)</entry>
+            </row>
+            <row>
+              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_LNA_GAIN</constant>&nbsp;</entry>
+              <entry>integer</entry>
+            </row>
+            <row>
+              <entry spanname="descr">LNA (low noise amplifier) gain is first
+gain stage on the RF tuner signal path. It is located very close to tuner
+antenna input. Used when <constant>V4L2_CID_RF_TUNER_LNA_GAIN_AUTO</constant> is not set.
+The range and step are driver-specific.</entry>
+            </row>
+            <row>
+              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_MIXER_GAIN</constant>&nbsp;</entry>
+              <entry>integer</entry>
+            </row>
+            <row>
+              <entry spanname="descr">Mixer gain is second gain stage on the RF
+tuner signal path. It is located inside mixer block, where RF signal is
+down-converted by the mixer. Used when <constant>V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO</constant>
+is not set. The range and step are driver-specific.</entry>
+            </row>
+            <row>
+              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_IF_GAIN</constant>&nbsp;</entry>
+              <entry>integer</entry>
+            </row>
+            <row>
+              <entry spanname="descr">IF gain is last gain stage on the RF tuner
+signal path. It is located on output of RF tuner. It controls signal level of
+intermediate frequency output or baseband output. Used when
+<constant>V4L2_CID_RF_TUNER_IF_GAIN_AUTO</constant> is not set. The range and step are
+driver-specific.</entry>
+            </row>
+          </tbody>
+        </tgroup>
+      </table>
+    </section>
 </section>
-- 
1.8.5.3


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

* [REVIEW PATCH 10/13] DocBook: media: document V4L2_CTRL_CLASS_RF_TUNER
  2014-02-27  0:21 [REVIEW PATCH 00/13] SDR API - V4L API stuff itself Antti Palosaari
                   ` (8 preceding siblings ...)
  2014-02-27  0:22 ` [REVIEW PATCH 09/13] DocBook: document RF tuner gain controls Antti Palosaari
@ 2014-02-27  0:22 ` Antti Palosaari
  2014-02-27  0:22 ` [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls Antti Palosaari
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-02-27  0:22 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Antti Palosaari

It is class for RF tuner specific controls, like gain controls,
filters, signal strength.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml
index b3bb957..e9f6735 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml
@@ -327,7 +327,12 @@ These controls are described in <xref
 These controls are described in <xref
 		linkend="fm-rx-controls" />.</entry>
 	  </row>
-
+	  <row>
+	    <entry><constant>V4L2_CTRL_CLASS_RF_TUNER</constant></entry>
+	    <entry>0xa20000</entry>
+	    <entry>The class containing RF tuner controls.
+These controls are described in <xref linkend="rf-tuner-controls" />.</entry>
+	  </row>
 	</tbody>
       </tgroup>
     </table>
-- 
1.8.5.3


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

* [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls
  2014-02-27  0:21 [REVIEW PATCH 00/13] SDR API - V4L API stuff itself Antti Palosaari
                   ` (9 preceding siblings ...)
  2014-02-27  0:22 ` [REVIEW PATCH 10/13] DocBook: media: document V4L2_CTRL_CLASS_RF_TUNER Antti Palosaari
@ 2014-02-27  0:22 ` Antti Palosaari
       [not found]   ` <20140305154922.508c48d7@samsung.com>
  2014-02-27  0:22 ` [REVIEW PATCH 12/13] DocBook: media: document PLL lock control Antti Palosaari
  2014-02-27  0:22 ` [REVIEW PATCH 13/13] DocBook: media: add some general info about RF tuners Antti Palosaari
  12 siblings, 1 reply; 24+ messages in thread
From: Antti Palosaari @ 2014-02-27  0:22 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Antti Palosaari

Add documentation for RF tuner bandwidth controls. These controls are
used to set filters on tuner signal path.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 Documentation/DocBook/media/v4l/controls.xml | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
index 6c9dbf6..5550fea 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -5007,6 +5007,25 @@ descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
 description of this control class.</entry>
             </row>
             <row>
+              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH_AUTO</constant>&nbsp;</entry>
+              <entry>boolean</entry>
+            </row>
+            <row>
+              <entry spanname="descr">Enables/disables tuner radio channel
+bandwidth configuration. In automatic mode bandwidth configuration is performed
+by the driver.</entry>
+            </row>
+            <row>
+              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>
+              <entry>integer</entry>
+            </row>
+            <row>
+              <entry spanname="descr">Filter(s) on tuner signal path are used to
+filter signal according to receiving party needs. Driver configures filters to
+fulfill desired bandwidth requirement. Used when V4L2_CID_RF_TUNER_BANDWIDTH_AUTO is not
+set. The range and step are driver-specific.</entry>
+            </row>
+            <row>
               <entry spanname="id"><constant>V4L2_CID_RF_TUNER_LNA_GAIN_AUTO</constant>&nbsp;</entry>
               <entry>boolean</entry>
             </row>
-- 
1.8.5.3


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

* [REVIEW PATCH 12/13] DocBook: media: document PLL lock control
  2014-02-27  0:21 [REVIEW PATCH 00/13] SDR API - V4L API stuff itself Antti Palosaari
                   ` (10 preceding siblings ...)
  2014-02-27  0:22 ` [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls Antti Palosaari
@ 2014-02-27  0:22 ` Antti Palosaari
  2014-02-27  0:22 ` [REVIEW PATCH 13/13] DocBook: media: add some general info about RF tuners Antti Palosaari
  12 siblings, 0 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-02-27  0:22 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Antti Palosaari, Mauro Carvalho Chehab

Document PLL lock V4L2 control. It is read only RF tuner control
which is used to inform if tuner is receiving frequency or not.

Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 Documentation/DocBook/media/v4l/controls.xml | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
index 5550fea..92e3335 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -5077,6 +5077,15 @@ intermediate frequency output or baseband output. Used when
 <constant>V4L2_CID_RF_TUNER_IF_GAIN_AUTO</constant> is not set. The range and step are
 driver-specific.</entry>
             </row>
+            <row>
+              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_PLL_LOCK</constant>&nbsp;</entry>
+              <entry>boolean</entry>
+            </row>
+            <row>
+              <entry spanname="descr">Is synthesizer PLL locked? RF tuner is
+receiving given frequency when that control is set. This is a read-only control.
+</entry>
+            </row>
           </tbody>
         </tgroup>
       </table>
-- 
1.8.5.3


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

* [REVIEW PATCH 13/13] DocBook: media: add some general info about RF tuners
  2014-02-27  0:21 [REVIEW PATCH 00/13] SDR API - V4L API stuff itself Antti Palosaari
                   ` (11 preceding siblings ...)
  2014-02-27  0:22 ` [REVIEW PATCH 12/13] DocBook: media: document PLL lock control Antti Palosaari
@ 2014-02-27  0:22 ` Antti Palosaari
  12 siblings, 0 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-02-27  0:22 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Antti Palosaari

Add some info what is RF tuner in context of V4L RF tuner class.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 Documentation/DocBook/media/v4l/controls.xml | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
index 92e3335..9adf630 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -4975,8 +4975,27 @@ defines possible values for de-emphasis. Here they are:</entry>
     <section id="rf-tuner-controls">
       <title>RF Tuner Control Reference</title>
 
-      <para>The RF Tuner (RF_TUNER) class includes controls for common features
-of devices having RF tuner.</para>
+      <para>
+The RF Tuner (RF_TUNER) class includes controls for common features of devices
+having RF tuner.
+      </para>
+      <para>
+In this context, RF tuner is radio receiver circuit between antenna and
+demodulator. It receives radio frequency (RF) from the antenna and converts that
+received signal to lower intermediate frequency (IF) or baseband frequency (BB).
+Tuners that could do baseband output are often called Zero-IF tuners. Older
+tuners were typically simple PLL tuners inside a metal box, whilst newer ones
+are highly integrated chips without a metal box "silicon tuners". These controls
+are mostly applicable for new feature rich silicon tuners, just because older
+tuners does not have much adjustable features.
+      </para>
+      <para>
+For more information about RF tuners see
+<ulink url="http://en.wikipedia.org/wiki/Tuner_%28radio%29">Tuner (radio)</ulink>
+and
+<ulink url="http://en.wikipedia.org/wiki/RF_front_end">RF front end</ulink>
+from Wikipedia.
+      </para>
 
       <table pgwide="1" frame="none" id="rf-tuner-control-id">
         <title>RF_TUNER Control IDs</title>
-- 
1.8.5.3


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

* Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls
       [not found]   ` <20140305154922.508c48d7@samsung.com>
@ 2014-03-10 10:01     ` Antti Palosaari
  2014-03-12 11:02       ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 24+ messages in thread
From: Antti Palosaari @ 2014-03-10 10:01 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: LMML

On 05.03.2014 20:49, Mauro Carvalho Chehab wrote:
> Em Thu, 27 Feb 2014 02:22:06 +0200
> Antti Palosaari <crope@iki.fi> escreveu:
>
>> Add documentation for RF tuner bandwidth controls. These controls are
>> used to set filters on tuner signal path.
>>
>> Cc: Hans Verkuil <hverkuil@xs4all.nl>
>> Signed-off-by: Antti Palosaari <crope@iki.fi>
>> ---
>>   Documentation/DocBook/media/v4l/controls.xml | 19 +++++++++++++++++++
>>   1 file changed, 19 insertions(+)
>>
>> diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
>> index 6c9dbf6..5550fea 100644
>> --- a/Documentation/DocBook/media/v4l/controls.xml
>> +++ b/Documentation/DocBook/media/v4l/controls.xml
>> @@ -5007,6 +5007,25 @@ descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
>>   description of this control class.</entry>
>>               </row>
>>               <row>
>> +              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH_AUTO</constant>&nbsp;</entry>
>> +              <entry>boolean</entry>
>> +            </row>
>> +            <row>
>> +              <entry spanname="descr">Enables/disables tuner radio channel
>> +bandwidth configuration. In automatic mode bandwidth configuration is performed
>> +by the driver.</entry>
>> +            </row>
>> +            <row>
>> +              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>
>> +              <entry>integer</entry>
>> +            </row>
>> +            <row>
>> +              <entry spanname="descr">Filter(s) on tuner signal path are used to
>> +filter signal according to receiving party needs. Driver configures filters to
>> +fulfill desired bandwidth requirement. Used when V4L2_CID_RF_TUNER_BANDWIDTH_AUTO is not
>> +set. The range and step are driver-specific.</entry>
>
> Huh? If this is enable/disable, why "the range and step are driver-specific"?

Because there is two controls grouped. That is situation of having 
AUTO/MANUAL.
V4L2_CID_RF_TUNER_BANDWIDTH_AUTO
V4L2_CID_RF_TUNER_BANDWIDTH

V4L2_CID_RF_TUNER_BANDWIDTH is valid only when 
V4L2_CID_RF_TUNER_BANDWIDTH_AUTO == false.

regards
Antti



>
>> +            </row>
>> +            <row>
>>                 <entry spanname="id"><constant>V4L2_CID_RF_TUNER_LNA_GAIN_AUTO</constant>&nbsp;</entry>
>>                 <entry>boolean</entry>
>>               </row>
>
>


-- 
http://palosaari.fi/

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

* Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls
  2014-03-10 10:01     ` Antti Palosaari
@ 2014-03-12 11:02       ` Mauro Carvalho Chehab
  2014-03-12 12:26         ` Antti Palosaari
  0 siblings, 1 reply; 24+ messages in thread
From: Mauro Carvalho Chehab @ 2014-03-12 11:02 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: LMML

Em Mon, 10 Mar 2014 12:01:28 +0200
Antti Palosaari <crope@iki.fi> escreveu:

> On 05.03.2014 20:49, Mauro Carvalho Chehab wrote:
> > Em Thu, 27 Feb 2014 02:22:06 +0200
> > Antti Palosaari <crope@iki.fi> escreveu:
> >
> >> Add documentation for RF tuner bandwidth controls. These controls are
> >> used to set filters on tuner signal path.
> >>
> >> Cc: Hans Verkuil <hverkuil@xs4all.nl>
> >> Signed-off-by: Antti Palosaari <crope@iki.fi>
> >> ---
> >>   Documentation/DocBook/media/v4l/controls.xml | 19 +++++++++++++++++++
> >>   1 file changed, 19 insertions(+)
> >>
> >> diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
> >> index 6c9dbf6..5550fea 100644
> >> --- a/Documentation/DocBook/media/v4l/controls.xml
> >> +++ b/Documentation/DocBook/media/v4l/controls.xml
> >> @@ -5007,6 +5007,25 @@ descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
> >>   description of this control class.</entry>
> >>               </row>
> >>               <row>
> >> +              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH_AUTO</constant>&nbsp;</entry>
> >> +              <entry>boolean</entry>
> >> +            </row>
> >> +            <row>
> >> +              <entry spanname="descr">Enables/disables tuner radio channel
> >> +bandwidth configuration. In automatic mode bandwidth configuration is performed
> >> +by the driver.</entry>
> >> +            </row>
> >> +            <row>
> >> +              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>
> >> +              <entry>integer</entry>
> >> +            </row>
> >> +            <row>
> >> +              <entry spanname="descr">Filter(s) on tuner signal path are used to
> >> +filter signal according to receiving party needs. Driver configures filters to
> >> +fulfill desired bandwidth requirement. Used when V4L2_CID_RF_TUNER_BANDWIDTH_AUTO is not
> >> +set. The range and step are driver-specific.</entry>
> >
> > Huh? If this is enable/disable, why "the range and step are driver-specific"?
> 
> Because there is two controls grouped. That is situation of having 
> AUTO/MANUAL.
> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO
> V4L2_CID_RF_TUNER_BANDWIDTH
> 
> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when 
> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO == false.
>

Sorry, but I'm not understanding what you're arguing.

Yeah, it is clear at the patch that there are two controls, and that
V4L2_CID_RF_TUNER_BANDWIDTH is valid only when AUTO is disabled, but
this doesn't answer my question:

Why V4L2_CID_RF_TUNER_BANDWIDTH's range and step are driver-specific?

-- 

Regards,
Mauro

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

* Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls
  2014-03-12 11:02       ` Mauro Carvalho Chehab
@ 2014-03-12 12:26         ` Antti Palosaari
  2014-03-12 12:37           ` Antti Palosaari
  2014-03-12 12:47           ` Mauro Carvalho Chehab
  0 siblings, 2 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-03-12 12:26 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: LMML

On 12.03.2014 13:02, Mauro Carvalho Chehab wrote:
> Em Mon, 10 Mar 2014 12:01:28 +0200
> Antti Palosaari <crope@iki.fi> escreveu:
>
>> On 05.03.2014 20:49, Mauro Carvalho Chehab wrote:
>>> Em Thu, 27 Feb 2014 02:22:06 +0200
>>> Antti Palosaari <crope@iki.fi> escreveu:
>>>
>>>> Add documentation for RF tuner bandwidth controls. These controls are
>>>> used to set filters on tuner signal path.
>>>>
>>>> Cc: Hans Verkuil <hverkuil@xs4all.nl>
>>>> Signed-off-by: Antti Palosaari <crope@iki.fi>
>>>> ---
>>>>    Documentation/DocBook/media/v4l/controls.xml | 19 +++++++++++++++++++
>>>>    1 file changed, 19 insertions(+)
>>>>
>>>> diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
>>>> index 6c9dbf6..5550fea 100644
>>>> --- a/Documentation/DocBook/media/v4l/controls.xml
>>>> +++ b/Documentation/DocBook/media/v4l/controls.xml
>>>> @@ -5007,6 +5007,25 @@ descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
>>>>    description of this control class.</entry>
>>>>                </row>
>>>>                <row>
>>>> +              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH_AUTO</constant>&nbsp;</entry>
>>>> +              <entry>boolean</entry>
>>>> +            </row>
>>>> +            <row>
>>>> +              <entry spanname="descr">Enables/disables tuner radio channel
>>>> +bandwidth configuration. In automatic mode bandwidth configuration is performed
>>>> +by the driver.</entry>
>>>> +            </row>
>>>> +            <row>
>>>> +              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>
>>>> +              <entry>integer</entry>
>>>> +            </row>
>>>> +            <row>
>>>> +              <entry spanname="descr">Filter(s) on tuner signal path are used to
>>>> +filter signal according to receiving party needs. Driver configures filters to
>>>> +fulfill desired bandwidth requirement. Used when V4L2_CID_RF_TUNER_BANDWIDTH_AUTO is not
>>>> +set. The range and step are driver-specific.</entry>
>>>
>>> Huh? If this is enable/disable, why "the range and step are driver-specific"?
>>
>> Because there is two controls grouped. That is situation of having
>> AUTO/MANUAL.
>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO
>> V4L2_CID_RF_TUNER_BANDWIDTH
>>
>> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when
>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO == false.
>>
>
> Sorry, but I'm not understanding what you're arguing.
>
> Yeah, it is clear at the patch that there are two controls, and that
> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when AUTO is disabled, but
> this doesn't answer my question:
>
> Why V4L2_CID_RF_TUNER_BANDWIDTH's range and step are driver-specific?
>

Hmmm. That control is used to configure RF filters. Filters set 
bandwidth of radio channel. There is usually quite limited set of 
available analog filters inside RF tuner. If you look for example 
FC0012/FC0013 possible filters are 6/7/8 MHz. E4000 has something 4-11 
MHz. If you look those very old 1st gen silicon tuners like QT1010 / 
MT2060, there is no integrated filters at all - but there is external 
saw filter which is usually 8MHz at 36.125 MHz IF.

Did you remember there is same parameter already in DVB API (struct 
dtv_frontend_properties bandwidth_hz)? That is control is currently used 
to set r820t, fc0012, fc10013 .bandwidth_hz value, e4000 implements it 
correctly as own control.

I am quite astonished we have that big gap with our views.

regards
Antti
-- 
http://palosaari.fi/

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

* Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls
  2014-03-12 12:26         ` Antti Palosaari
@ 2014-03-12 12:37           ` Antti Palosaari
  2014-03-12 12:47           ` Mauro Carvalho Chehab
  1 sibling, 0 replies; 24+ messages in thread
From: Antti Palosaari @ 2014-03-12 12:37 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: LMML

On 12.03.2014 14:26, Antti Palosaari wrote:
> On 12.03.2014 13:02, Mauro Carvalho Chehab wrote:
>> Em Mon, 10 Mar 2014 12:01:28 +0200
>> Antti Palosaari <crope@iki.fi> escreveu:
>>
>>> On 05.03.2014 20:49, Mauro Carvalho Chehab wrote:
>>>> Em Thu, 27 Feb 2014 02:22:06 +0200
>>>> Antti Palosaari <crope@iki.fi> escreveu:
>>>>
>>>>> Add documentation for RF tuner bandwidth controls. These controls are
>>>>> used to set filters on tuner signal path.
>>>>>
>>>>> Cc: Hans Verkuil <hverkuil@xs4all.nl>
>>>>> Signed-off-by: Antti Palosaari <crope@iki.fi>
>>>>> ---
>>>>>    Documentation/DocBook/media/v4l/controls.xml | 19
>>>>> +++++++++++++++++++
>>>>>    1 file changed, 19 insertions(+)
>>>>>
>>>>> diff --git a/Documentation/DocBook/media/v4l/controls.xml
>>>>> b/Documentation/DocBook/media/v4l/controls.xml
>>>>> index 6c9dbf6..5550fea 100644
>>>>> --- a/Documentation/DocBook/media/v4l/controls.xml
>>>>> +++ b/Documentation/DocBook/media/v4l/controls.xml
>>>>> @@ -5007,6 +5007,25 @@ descriptor. Calling &VIDIOC-QUERYCTRL; for
>>>>> this control will return a
>>>>>    description of this control class.</entry>
>>>>>                </row>
>>>>>                <row>
>>>>> +              <entry
>>>>> spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH_AUTO</constant>&nbsp;</entry>
>>>>>
>>>>> +              <entry>boolean</entry>
>>>>> +            </row>
>>>>> +            <row>
>>>>> +              <entry spanname="descr">Enables/disables tuner radio
>>>>> channel
>>>>> +bandwidth configuration. In automatic mode bandwidth configuration
>>>>> is performed
>>>>> +by the driver.</entry>
>>>>> +            </row>
>>>>> +            <row>
>>>>> +              <entry
>>>>> spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>
>>>>>
>>>>> +              <entry>integer</entry>
>>>>> +            </row>
>>>>> +            <row>
>>>>> +              <entry spanname="descr">Filter(s) on tuner signal
>>>>> path are used to
>>>>> +filter signal according to receiving party needs. Driver
>>>>> configures filters to
>>>>> +fulfill desired bandwidth requirement. Used when
>>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO is not
>>>>> +set. The range and step are driver-specific.</entry>
>>>>
>>>> Huh? If this is enable/disable, why "the range and step are
>>>> driver-specific"?
>>>
>>> Because there is two controls grouped. That is situation of having
>>> AUTO/MANUAL.
>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO
>>> V4L2_CID_RF_TUNER_BANDWIDTH
>>>
>>> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when
>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO == false.
>>>
>>
>> Sorry, but I'm not understanding what you're arguing.
>>
>> Yeah, it is clear at the patch that there are two controls, and that
>> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when AUTO is disabled, but
>> this doesn't answer my question:
>>
>> Why V4L2_CID_RF_TUNER_BANDWIDTH's range and step are driver-specific?
>>
>
> Hmmm. That control is used to configure RF filters. Filters set
> bandwidth of radio channel. There is usually quite limited set of
> available analog filters inside RF tuner. If you look for example
> FC0012/FC0013 possible filters are 6/7/8 MHz. E4000 has something 4-11
> MHz. If you look those very old 1st gen silicon tuners like QT1010 /
> MT2060, there is no integrated filters at all - but there is external
> saw filter which is usually 8MHz at 36.125 MHz IF.
>
> Did you remember there is same parameter already in DVB API (struct
> dtv_frontend_properties bandwidth_hz)? That is control is currently used
> to set r820t, fc0012, fc10013 .bandwidth_hz value, e4000 implements it
> correctly as own control.
>
> I am quite astonished we have that big gap with our views.

Here is picture from GNU Radio UHD source (it is the original Ettus HW 
GNU Radio was done AFAIK). Bandwidth is last control.

http://lists.gnu.org/archive/html/discuss-gnuradio/2010-12/pngqfPrwUmgsB.png

regards
Antti

-- 
http://palosaari.fi/

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

* Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls
  2014-03-12 12:26         ` Antti Palosaari
  2014-03-12 12:37           ` Antti Palosaari
@ 2014-03-12 12:47           ` Mauro Carvalho Chehab
  2014-03-12 12:57             ` Antti Palosaari
  1 sibling, 1 reply; 24+ messages in thread
From: Mauro Carvalho Chehab @ 2014-03-12 12:47 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: LMML

Em Wed, 12 Mar 2014 14:26:35 +0200
Antti Palosaari <crope@iki.fi> escreveu:

> On 12.03.2014 13:02, Mauro Carvalho Chehab wrote:
> > Em Mon, 10 Mar 2014 12:01:28 +0200
> > Antti Palosaari <crope@iki.fi> escreveu:
> >
> >> On 05.03.2014 20:49, Mauro Carvalho Chehab wrote:
> >>> Em Thu, 27 Feb 2014 02:22:06 +0200
> >>> Antti Palosaari <crope@iki.fi> escreveu:
> >>>
> >>>> Add documentation for RF tuner bandwidth controls. These controls are
> >>>> used to set filters on tuner signal path.
> >>>>
> >>>> Cc: Hans Verkuil <hverkuil@xs4all.nl>
> >>>> Signed-off-by: Antti Palosaari <crope@iki.fi>
> >>>> ---
> >>>>    Documentation/DocBook/media/v4l/controls.xml | 19 +++++++++++++++++++
> >>>>    1 file changed, 19 insertions(+)
> >>>>
> >>>> diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
> >>>> index 6c9dbf6..5550fea 100644
> >>>> --- a/Documentation/DocBook/media/v4l/controls.xml
> >>>> +++ b/Documentation/DocBook/media/v4l/controls.xml
> >>>> @@ -5007,6 +5007,25 @@ descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
> >>>>    description of this control class.</entry>
> >>>>                </row>
> >>>>                <row>
> >>>> +              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH_AUTO</constant>&nbsp;</entry>
> >>>> +              <entry>boolean</entry>
> >>>> +            </row>
> >>>> +            <row>
> >>>> +              <entry spanname="descr">Enables/disables tuner radio channel
> >>>> +bandwidth configuration. In automatic mode bandwidth configuration is performed
> >>>> +by the driver.</entry>
> >>>> +            </row>
> >>>> +            <row>
> >>>> +              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>
> >>>> +              <entry>integer</entry>
> >>>> +            </row>
> >>>> +            <row>
> >>>> +              <entry spanname="descr">Filter(s) on tuner signal path are used to
> >>>> +filter signal according to receiving party needs. Driver configures filters to
> >>>> +fulfill desired bandwidth requirement. Used when V4L2_CID_RF_TUNER_BANDWIDTH_AUTO is not
> >>>> +set. The range and step are driver-specific.</entry>
> >>>
> >>> Huh? If this is enable/disable, why "the range and step are driver-specific"?
> >>
> >> Because there is two controls grouped. That is situation of having
> >> AUTO/MANUAL.
> >> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO
> >> V4L2_CID_RF_TUNER_BANDWIDTH
> >>
> >> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when
> >> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO == false.
> >>
> >
> > Sorry, but I'm not understanding what you're arguing.
> >
> > Yeah, it is clear at the patch that there are two controls, and that
> > V4L2_CID_RF_TUNER_BANDWIDTH is valid only when AUTO is disabled, but
> > this doesn't answer my question:
> >
> > Why V4L2_CID_RF_TUNER_BANDWIDTH's range and step are driver-specific?
> >
> 
> Hmmm. That control is used to configure RF filters. Filters set 
> bandwidth of radio channel. There is usually quite limited set of 
> available analog filters inside RF tuner. If you look for example 
> FC0012/FC0013 possible filters are 6/7/8 MHz. E4000 has something 4-11 
> MHz. If you look those very old 1st gen silicon tuners like QT1010 / 
> MT2060, there is no integrated filters at all - but there is external 
> saw filter which is usually 8MHz at 36.125 MHz IF.
> 
> Did you remember there is same parameter already in DVB API (struct 
> dtv_frontend_properties bandwidth_hz)? That is control is currently used 
> to set r820t, fc0012, fc10013 .bandwidth_hz value, e4000 implements it 
> correctly as own control.
> 
> I am quite astonished we have that big gap with our views.

Well, on DVB, the bandwidth is specified in Hz, at DVBv5 (or via
an enum on DVBv3).

Here, there's no description about the unit to be used (Hz? kHz?).
It just says that this is an integer, with a driver-specific
range and step.

So, one driver might choose to use Hz, other kHz, and other to
expose some internal counter. That's bad.

We should either use a V4L2_CTRL_TYPE_MENU type of control, where it
would be possible to do something similar to DVBv3 way to specify
the bandwidth filter, or to define that the bandwidth will be
in Hz, kHz or MHz.

Probably, a menu type is better, as it allows userspace to get
all supported bandwidths.

Regards,
Mauro

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

* Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls
  2014-03-12 12:47           ` Mauro Carvalho Chehab
@ 2014-03-12 12:57             ` Antti Palosaari
  2014-03-12 13:07               ` Antti Palosaari
  0 siblings, 1 reply; 24+ messages in thread
From: Antti Palosaari @ 2014-03-12 12:57 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: LMML

On 12.03.2014 14:47, Mauro Carvalho Chehab wrote:
> Em Wed, 12 Mar 2014 14:26:35 +0200
> Antti Palosaari <crope@iki.fi> escreveu:
>
>> On 12.03.2014 13:02, Mauro Carvalho Chehab wrote:
>>> Em Mon, 10 Mar 2014 12:01:28 +0200
>>> Antti Palosaari <crope@iki.fi> escreveu:
>>>
>>>> On 05.03.2014 20:49, Mauro Carvalho Chehab wrote:
>>>>> Em Thu, 27 Feb 2014 02:22:06 +0200
>>>>> Antti Palosaari <crope@iki.fi> escreveu:
>>>>>
>>>>>> Add documentation for RF tuner bandwidth controls. These controls are
>>>>>> used to set filters on tuner signal path.
>>>>>>
>>>>>> Cc: Hans Verkuil <hverkuil@xs4all.nl>
>>>>>> Signed-off-by: Antti Palosaari <crope@iki.fi>
>>>>>> ---
>>>>>>     Documentation/DocBook/media/v4l/controls.xml | 19 +++++++++++++++++++
>>>>>>     1 file changed, 19 insertions(+)
>>>>>>
>>>>>> diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
>>>>>> index 6c9dbf6..5550fea 100644
>>>>>> --- a/Documentation/DocBook/media/v4l/controls.xml
>>>>>> +++ b/Documentation/DocBook/media/v4l/controls.xml
>>>>>> @@ -5007,6 +5007,25 @@ descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
>>>>>>     description of this control class.</entry>
>>>>>>                 </row>
>>>>>>                 <row>
>>>>>> +              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH_AUTO</constant>&nbsp;</entry>
>>>>>> +              <entry>boolean</entry>
>>>>>> +            </row>
>>>>>> +            <row>
>>>>>> +              <entry spanname="descr">Enables/disables tuner radio channel
>>>>>> +bandwidth configuration. In automatic mode bandwidth configuration is performed
>>>>>> +by the driver.</entry>
>>>>>> +            </row>
>>>>>> +            <row>
>>>>>> +              <entry spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>
>>>>>> +              <entry>integer</entry>
>>>>>> +            </row>
>>>>>> +            <row>
>>>>>> +              <entry spanname="descr">Filter(s) on tuner signal path are used to
>>>>>> +filter signal according to receiving party needs. Driver configures filters to
>>>>>> +fulfill desired bandwidth requirement. Used when V4L2_CID_RF_TUNER_BANDWIDTH_AUTO is not
>>>>>> +set. The range and step are driver-specific.</entry>
>>>>>
>>>>> Huh? If this is enable/disable, why "the range and step are driver-specific"?
>>>>
>>>> Because there is two controls grouped. That is situation of having
>>>> AUTO/MANUAL.
>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO
>>>> V4L2_CID_RF_TUNER_BANDWIDTH
>>>>
>>>> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when
>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO == false.
>>>>
>>>
>>> Sorry, but I'm not understanding what you're arguing.
>>>
>>> Yeah, it is clear at the patch that there are two controls, and that
>>> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when AUTO is disabled, but
>>> this doesn't answer my question:
>>>
>>> Why V4L2_CID_RF_TUNER_BANDWIDTH's range and step are driver-specific?
>>>
>>
>> Hmmm. That control is used to configure RF filters. Filters set
>> bandwidth of radio channel. There is usually quite limited set of
>> available analog filters inside RF tuner. If you look for example
>> FC0012/FC0013 possible filters are 6/7/8 MHz. E4000 has something 4-11
>> MHz. If you look those very old 1st gen silicon tuners like QT1010 /
>> MT2060, there is no integrated filters at all - but there is external
>> saw filter which is usually 8MHz at 36.125 MHz IF.
>>
>> Did you remember there is same parameter already in DVB API (struct
>> dtv_frontend_properties bandwidth_hz)? That is control is currently used
>> to set r820t, fc0012, fc10013 .bandwidth_hz value, e4000 implements it
>> correctly as own control.
>>
>> I am quite astonished we have that big gap with our views.
>
> Well, on DVB, the bandwidth is specified in Hz, at DVBv5 (or via
> an enum on DVBv3).
>
> Here, there's no description about the unit to be used (Hz? kHz?).
> It just says that this is an integer, with a driver-specific
> range and step.
>
> So, one driver might choose to use Hz, other kHz, and other to
> expose some internal counter. That's bad.
>
> We should either use a V4L2_CTRL_TYPE_MENU type of control, where it
> would be possible to do something similar to DVBv3 way to specify
> the bandwidth filter, or to define that the bandwidth will be
> in Hz, kHz or MHz.

Yeah, indeed. That was my mistake. The aim was Hz yes.

>
> Probably, a menu type is better, as it allows userspace to get
> all supported bandwidths.

I though it too, but there is already a lot choices for some tuners, 
E4000 has over 30. What is maximum reasonable filter count for 
V4L2_CTRL_TYPE_MENU?

regards
Antti

-- 
http://palosaari.fi/

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

* Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls
  2014-03-12 12:57             ` Antti Palosaari
@ 2014-03-12 13:07               ` Antti Palosaari
  2014-03-12 13:21                 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 24+ messages in thread
From: Antti Palosaari @ 2014-03-12 13:07 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: LMML

On 12.03.2014 14:57, Antti Palosaari wrote:
> On 12.03.2014 14:47, Mauro Carvalho Chehab wrote:
>> Em Wed, 12 Mar 2014 14:26:35 +0200
>> Antti Palosaari <crope@iki.fi> escreveu:
>>
>>> On 12.03.2014 13:02, Mauro Carvalho Chehab wrote:
>>>> Em Mon, 10 Mar 2014 12:01:28 +0200
>>>> Antti Palosaari <crope@iki.fi> escreveu:
>>>>
>>>>> On 05.03.2014 20:49, Mauro Carvalho Chehab wrote:
>>>>>> Em Thu, 27 Feb 2014 02:22:06 +0200
>>>>>> Antti Palosaari <crope@iki.fi> escreveu:
>>>>>>
>>>>>>> Add documentation for RF tuner bandwidth controls. These controls
>>>>>>> are
>>>>>>> used to set filters on tuner signal path.
>>>>>>>
>>>>>>> Cc: Hans Verkuil <hverkuil@xs4all.nl>
>>>>>>> Signed-off-by: Antti Palosaari <crope@iki.fi>
>>>>>>> ---
>>>>>>>     Documentation/DocBook/media/v4l/controls.xml | 19
>>>>>>> +++++++++++++++++++
>>>>>>>     1 file changed, 19 insertions(+)
>>>>>>>
>>>>>>> diff --git a/Documentation/DocBook/media/v4l/controls.xml
>>>>>>> b/Documentation/DocBook/media/v4l/controls.xml
>>>>>>> index 6c9dbf6..5550fea 100644
>>>>>>> --- a/Documentation/DocBook/media/v4l/controls.xml
>>>>>>> +++ b/Documentation/DocBook/media/v4l/controls.xml
>>>>>>> @@ -5007,6 +5007,25 @@ descriptor. Calling &VIDIOC-QUERYCTRL; for
>>>>>>> this control will return a
>>>>>>>     description of this control class.</entry>
>>>>>>>                 </row>
>>>>>>>                 <row>
>>>>>>> +              <entry
>>>>>>> spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH_AUTO</constant>&nbsp;</entry>
>>>>>>>
>>>>>>> +              <entry>boolean</entry>
>>>>>>> +            </row>
>>>>>>> +            <row>
>>>>>>> +              <entry spanname="descr">Enables/disables tuner
>>>>>>> radio channel
>>>>>>> +bandwidth configuration. In automatic mode bandwidth
>>>>>>> configuration is performed
>>>>>>> +by the driver.</entry>
>>>>>>> +            </row>
>>>>>>> +            <row>
>>>>>>> +              <entry
>>>>>>> spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>
>>>>>>>
>>>>>>> +              <entry>integer</entry>
>>>>>>> +            </row>
>>>>>>> +            <row>
>>>>>>> +              <entry spanname="descr">Filter(s) on tuner signal
>>>>>>> path are used to
>>>>>>> +filter signal according to receiving party needs. Driver
>>>>>>> configures filters to
>>>>>>> +fulfill desired bandwidth requirement. Used when
>>>>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO is not
>>>>>>> +set. The range and step are driver-specific.</entry>
>>>>>>
>>>>>> Huh? If this is enable/disable, why "the range and step are
>>>>>> driver-specific"?
>>>>>
>>>>> Because there is two controls grouped. That is situation of having
>>>>> AUTO/MANUAL.
>>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO
>>>>> V4L2_CID_RF_TUNER_BANDWIDTH
>>>>>
>>>>> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when
>>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO == false.
>>>>>
>>>>
>>>> Sorry, but I'm not understanding what you're arguing.
>>>>
>>>> Yeah, it is clear at the patch that there are two controls, and that
>>>> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when AUTO is disabled, but
>>>> this doesn't answer my question:
>>>>
>>>> Why V4L2_CID_RF_TUNER_BANDWIDTH's range and step are driver-specific?
>>>>
>>>
>>> Hmmm. That control is used to configure RF filters. Filters set
>>> bandwidth of radio channel. There is usually quite limited set of
>>> available analog filters inside RF tuner. If you look for example
>>> FC0012/FC0013 possible filters are 6/7/8 MHz. E4000 has something 4-11
>>> MHz. If you look those very old 1st gen silicon tuners like QT1010 /
>>> MT2060, there is no integrated filters at all - but there is external
>>> saw filter which is usually 8MHz at 36.125 MHz IF.
>>>
>>> Did you remember there is same parameter already in DVB API (struct
>>> dtv_frontend_properties bandwidth_hz)? That is control is currently used
>>> to set r820t, fc0012, fc10013 .bandwidth_hz value, e4000 implements it
>>> correctly as own control.
>>>
>>> I am quite astonished we have that big gap with our views.
>>
>> Well, on DVB, the bandwidth is specified in Hz, at DVBv5 (or via
>> an enum on DVBv3).
>>
>> Here, there's no description about the unit to be used (Hz? kHz?).
>> It just says that this is an integer, with a driver-specific
>> range and step.
>>
>> So, one driver might choose to use Hz, other kHz, and other to
>> expose some internal counter. That's bad.
>>
>> We should either use a V4L2_CTRL_TYPE_MENU type of control, where it
>> would be possible to do something similar to DVBv3 way to specify
>> the bandwidth filter, or to define that the bandwidth will be
>> in Hz, kHz or MHz.
>
> Yeah, indeed. That was my mistake. The aim was Hz yes.
>
>>
>> Probably, a menu type is better, as it allows userspace to get
>> all supported bandwidths.
>
> I though it too, but there is already a lot choices for some tuners,
> E4000 has over 30. What is maximum reasonable filter count for
> V4L2_CTRL_TYPE_MENU?


One fear there is also what happens when there will be some day new RF 
tuner having DSP which does digital filtering ~1 Hz step?

Mabbe the current control is enough, but probably it is place to add 
comment unit is Hz (even I think people should expect it is Hz when RF 
frequencies are spoken).


regards
Antti


-- 
http://palosaari.fi/

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

* Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls
  2014-03-12 13:07               ` Antti Palosaari
@ 2014-03-12 13:21                 ` Mauro Carvalho Chehab
  2014-03-12 14:23                   ` Antti Palosaari
  0 siblings, 1 reply; 24+ messages in thread
From: Mauro Carvalho Chehab @ 2014-03-12 13:21 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: LMML, Hans Verkuil

Em Wed, 12 Mar 2014 15:07:02 +0200
Antti Palosaari <crope@iki.fi> escreveu:

> On 12.03.2014 14:57, Antti Palosaari wrote:
> > On 12.03.2014 14:47, Mauro Carvalho Chehab wrote:
> >> Em Wed, 12 Mar 2014 14:26:35 +0200
> >> Antti Palosaari <crope@iki.fi> escreveu:
> >>
> >>> On 12.03.2014 13:02, Mauro Carvalho Chehab wrote:
> >>>> Em Mon, 10 Mar 2014 12:01:28 +0200
> >>>> Antti Palosaari <crope@iki.fi> escreveu:
> >>>>
> >>>>> On 05.03.2014 20:49, Mauro Carvalho Chehab wrote:
> >>>>>> Em Thu, 27 Feb 2014 02:22:06 +0200
> >>>>>> Antti Palosaari <crope@iki.fi> escreveu:
> >>>>>>
> >>>>>>> Add documentation for RF tuner bandwidth controls. These controls
> >>>>>>> are
> >>>>>>> used to set filters on tuner signal path.
> >>>>>>>
> >>>>>>> Cc: Hans Verkuil <hverkuil@xs4all.nl>
> >>>>>>> Signed-off-by: Antti Palosaari <crope@iki.fi>
> >>>>>>> ---
> >>>>>>>     Documentation/DocBook/media/v4l/controls.xml | 19
> >>>>>>> +++++++++++++++++++
> >>>>>>>     1 file changed, 19 insertions(+)
> >>>>>>>
> >>>>>>> diff --git a/Documentation/DocBook/media/v4l/controls.xml
> >>>>>>> b/Documentation/DocBook/media/v4l/controls.xml
> >>>>>>> index 6c9dbf6..5550fea 100644
> >>>>>>> --- a/Documentation/DocBook/media/v4l/controls.xml
> >>>>>>> +++ b/Documentation/DocBook/media/v4l/controls.xml
> >>>>>>> @@ -5007,6 +5007,25 @@ descriptor. Calling &VIDIOC-QUERYCTRL; for
> >>>>>>> this control will return a
> >>>>>>>     description of this control class.</entry>
> >>>>>>>                 </row>
> >>>>>>>                 <row>
> >>>>>>> +              <entry
> >>>>>>> spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH_AUTO</constant>&nbsp;</entry>
> >>>>>>>
> >>>>>>> +              <entry>boolean</entry>
> >>>>>>> +            </row>
> >>>>>>> +            <row>
> >>>>>>> +              <entry spanname="descr">Enables/disables tuner
> >>>>>>> radio channel
> >>>>>>> +bandwidth configuration. In automatic mode bandwidth
> >>>>>>> configuration is performed
> >>>>>>> +by the driver.</entry>
> >>>>>>> +            </row>
> >>>>>>> +            <row>
> >>>>>>> +              <entry
> >>>>>>> spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>
> >>>>>>>
> >>>>>>> +              <entry>integer</entry>
> >>>>>>> +            </row>
> >>>>>>> +            <row>
> >>>>>>> +              <entry spanname="descr">Filter(s) on tuner signal
> >>>>>>> path are used to
> >>>>>>> +filter signal according to receiving party needs. Driver
> >>>>>>> configures filters to
> >>>>>>> +fulfill desired bandwidth requirement. Used when
> >>>>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO is not
> >>>>>>> +set. The range and step are driver-specific.</entry>
> >>>>>>
> >>>>>> Huh? If this is enable/disable, why "the range and step are
> >>>>>> driver-specific"?
> >>>>>
> >>>>> Because there is two controls grouped. That is situation of having
> >>>>> AUTO/MANUAL.
> >>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO
> >>>>> V4L2_CID_RF_TUNER_BANDWIDTH
> >>>>>
> >>>>> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when
> >>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO == false.
> >>>>>
> >>>>
> >>>> Sorry, but I'm not understanding what you're arguing.
> >>>>
> >>>> Yeah, it is clear at the patch that there are two controls, and that
> >>>> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when AUTO is disabled, but
> >>>> this doesn't answer my question:
> >>>>
> >>>> Why V4L2_CID_RF_TUNER_BANDWIDTH's range and step are driver-specific?
> >>>>
> >>>
> >>> Hmmm. That control is used to configure RF filters. Filters set
> >>> bandwidth of radio channel. There is usually quite limited set of
> >>> available analog filters inside RF tuner. If you look for example
> >>> FC0012/FC0013 possible filters are 6/7/8 MHz. E4000 has something 4-11
> >>> MHz. If you look those very old 1st gen silicon tuners like QT1010 /
> >>> MT2060, there is no integrated filters at all - but there is external
> >>> saw filter which is usually 8MHz at 36.125 MHz IF.
> >>>
> >>> Did you remember there is same parameter already in DVB API (struct
> >>> dtv_frontend_properties bandwidth_hz)? That is control is currently used
> >>> to set r820t, fc0012, fc10013 .bandwidth_hz value, e4000 implements it
> >>> correctly as own control.
> >>>
> >>> I am quite astonished we have that big gap with our views.
> >>
> >> Well, on DVB, the bandwidth is specified in Hz, at DVBv5 (or via
> >> an enum on DVBv3).
> >>
> >> Here, there's no description about the unit to be used (Hz? kHz?).
> >> It just says that this is an integer, with a driver-specific
> >> range and step.
> >>
> >> So, one driver might choose to use Hz, other kHz, and other to
> >> expose some internal counter. That's bad.
> >>
> >> We should either use a V4L2_CTRL_TYPE_MENU type of control, where it
> >> would be possible to do something similar to DVBv3 way to specify
> >> the bandwidth filter, or to define that the bandwidth will be
> >> in Hz, kHz or MHz.
> >
> > Yeah, indeed. That was my mistake. The aim was Hz yes.
> >
> >>
> >> Probably, a menu type is better, as it allows userspace to get
> >> all supported bandwidths.
> >
> > I though it too, but there is already a lot choices for some tuners,
> > E4000 has over 30. What is maximum reasonable filter count for
> > V4L2_CTRL_TYPE_MENU?

I don't see any troubles on having 30 items there. Maybe Hans is aware
of some troubles on having such number of items.

The advantage of a menu type is that it helps userspace to select
an existing range.

> One fear there is also what happens when there will be some day new RF 
> tuner having DSP which does digital filtering ~1 Hz step?

It is possible.

> Mabbe the current control is enough, but probably it is place to add 
> comment unit is Hz (even I think people should expect it is Hz when RF 
> frequencies are spoken).

Please remind that V4L2 API has 3 scales already for frequencies,
HZ being the less obvious one, as it is the one added only for
3.14 and upper.

I see two alternatives here:

1) say that this is always Hz. The problem is if some future hardware
would support a bandwidth bigger than 2 GHz. That's unlikely, as
using such filter would require a wide band antenna, but
I won't doubt that this might happen some day;

2) say that this should follow the corresponding tuner CAPS for
frequencies (V4L2_TUNER_CAP_LOW, V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_1HZ).

The advantage of (2) is that, if we latter need to support wide band
filters, one would just need to use V4L2_TUNER_CAP_NORM (or a newer
V4L2_TUNER_CAP_1KHZ).

Regards,
Mauro

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

* Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls
  2014-03-12 13:21                 ` Mauro Carvalho Chehab
@ 2014-03-12 14:23                   ` Antti Palosaari
  2014-03-12 17:15                     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 24+ messages in thread
From: Antti Palosaari @ 2014-03-12 14:23 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: LMML, Hans Verkuil

On 12.03.2014 15:21, Mauro Carvalho Chehab wrote:
> Em Wed, 12 Mar 2014 15:07:02 +0200
> Antti Palosaari <crope@iki.fi> escreveu:
>
>> On 12.03.2014 14:57, Antti Palosaari wrote:
>>> On 12.03.2014 14:47, Mauro Carvalho Chehab wrote:
>>>> Em Wed, 12 Mar 2014 14:26:35 +0200
>>>> Antti Palosaari <crope@iki.fi> escreveu:
>>>>
>>>>> On 12.03.2014 13:02, Mauro Carvalho Chehab wrote:
>>>>>> Em Mon, 10 Mar 2014 12:01:28 +0200
>>>>>> Antti Palosaari <crope@iki.fi> escreveu:
>>>>>>
>>>>>>> On 05.03.2014 20:49, Mauro Carvalho Chehab wrote:
>>>>>>>> Em Thu, 27 Feb 2014 02:22:06 +0200
>>>>>>>> Antti Palosaari <crope@iki.fi> escreveu:
>>>>>>>>
>>>>>>>>> Add documentation for RF tuner bandwidth controls. These controls
>>>>>>>>> are
>>>>>>>>> used to set filters on tuner signal path.
>>>>>>>>>
>>>>>>>>> Cc: Hans Verkuil <hverkuil@xs4all.nl>
>>>>>>>>> Signed-off-by: Antti Palosaari <crope@iki.fi>
>>>>>>>>> ---
>>>>>>>>>      Documentation/DocBook/media/v4l/controls.xml | 19
>>>>>>>>> +++++++++++++++++++
>>>>>>>>>      1 file changed, 19 insertions(+)
>>>>>>>>>
>>>>>>>>> diff --git a/Documentation/DocBook/media/v4l/controls.xml
>>>>>>>>> b/Documentation/DocBook/media/v4l/controls.xml
>>>>>>>>> index 6c9dbf6..5550fea 100644
>>>>>>>>> --- a/Documentation/DocBook/media/v4l/controls.xml
>>>>>>>>> +++ b/Documentation/DocBook/media/v4l/controls.xml
>>>>>>>>> @@ -5007,6 +5007,25 @@ descriptor. Calling &VIDIOC-QUERYCTRL; for
>>>>>>>>> this control will return a
>>>>>>>>>      description of this control class.</entry>
>>>>>>>>>                  </row>
>>>>>>>>>                  <row>
>>>>>>>>> +              <entry
>>>>>>>>> spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH_AUTO</constant>&nbsp;</entry>
>>>>>>>>>
>>>>>>>>> +              <entry>boolean</entry>
>>>>>>>>> +            </row>
>>>>>>>>> +            <row>
>>>>>>>>> +              <entry spanname="descr">Enables/disables tuner
>>>>>>>>> radio channel
>>>>>>>>> +bandwidth configuration. In automatic mode bandwidth
>>>>>>>>> configuration is performed
>>>>>>>>> +by the driver.</entry>
>>>>>>>>> +            </row>
>>>>>>>>> +            <row>
>>>>>>>>> +              <entry
>>>>>>>>> spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>
>>>>>>>>>
>>>>>>>>> +              <entry>integer</entry>
>>>>>>>>> +            </row>
>>>>>>>>> +            <row>
>>>>>>>>> +              <entry spanname="descr">Filter(s) on tuner signal
>>>>>>>>> path are used to
>>>>>>>>> +filter signal according to receiving party needs. Driver
>>>>>>>>> configures filters to
>>>>>>>>> +fulfill desired bandwidth requirement. Used when
>>>>>>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO is not
>>>>>>>>> +set. The range and step are driver-specific.</entry>
>>>>>>>>
>>>>>>>> Huh? If this is enable/disable, why "the range and step are
>>>>>>>> driver-specific"?
>>>>>>>
>>>>>>> Because there is two controls grouped. That is situation of having
>>>>>>> AUTO/MANUAL.
>>>>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO
>>>>>>> V4L2_CID_RF_TUNER_BANDWIDTH
>>>>>>>
>>>>>>> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when
>>>>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO == false.
>>>>>>>
>>>>>>
>>>>>> Sorry, but I'm not understanding what you're arguing.
>>>>>>
>>>>>> Yeah, it is clear at the patch that there are two controls, and that
>>>>>> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when AUTO is disabled, but
>>>>>> this doesn't answer my question:
>>>>>>
>>>>>> Why V4L2_CID_RF_TUNER_BANDWIDTH's range and step are driver-specific?
>>>>>>
>>>>>
>>>>> Hmmm. That control is used to configure RF filters. Filters set
>>>>> bandwidth of radio channel. There is usually quite limited set of
>>>>> available analog filters inside RF tuner. If you look for example
>>>>> FC0012/FC0013 possible filters are 6/7/8 MHz. E4000 has something 4-11
>>>>> MHz. If you look those very old 1st gen silicon tuners like QT1010 /
>>>>> MT2060, there is no integrated filters at all - but there is external
>>>>> saw filter which is usually 8MHz at 36.125 MHz IF.
>>>>>
>>>>> Did you remember there is same parameter already in DVB API (struct
>>>>> dtv_frontend_properties bandwidth_hz)? That is control is currently used
>>>>> to set r820t, fc0012, fc10013 .bandwidth_hz value, e4000 implements it
>>>>> correctly as own control.
>>>>>
>>>>> I am quite astonished we have that big gap with our views.
>>>>
>>>> Well, on DVB, the bandwidth is specified in Hz, at DVBv5 (or via
>>>> an enum on DVBv3).
>>>>
>>>> Here, there's no description about the unit to be used (Hz? kHz?).
>>>> It just says that this is an integer, with a driver-specific
>>>> range and step.
>>>>
>>>> So, one driver might choose to use Hz, other kHz, and other to
>>>> expose some internal counter. That's bad.
>>>>
>>>> We should either use a V4L2_CTRL_TYPE_MENU type of control, where it
>>>> would be possible to do something similar to DVBv3 way to specify
>>>> the bandwidth filter, or to define that the bandwidth will be
>>>> in Hz, kHz or MHz.
>>>
>>> Yeah, indeed. That was my mistake. The aim was Hz yes.
>>>
>>>>
>>>> Probably, a menu type is better, as it allows userspace to get
>>>> all supported bandwidths.
>>>
>>> I though it too, but there is already a lot choices for some tuners,
>>> E4000 has over 30. What is maximum reasonable filter count for
>>> V4L2_CTRL_TYPE_MENU?
>
> I don't see any troubles on having 30 items there. Maybe Hans is aware
> of some troubles on having such number of items.
>
> The advantage of a menu type is that it helps userspace to select
> an existing range.
>
>> One fear there is also what happens when there will be some day new RF
>> tuner having DSP which does digital filtering ~1 Hz step?
>
> It is possible.
>
>> Mabbe the current control is enough, but probably it is place to add
>> comment unit is Hz (even I think people should expect it is Hz when RF
>> frequencies are spoken).
>
> Please remind that V4L2 API has 3 scales already for frequencies,
> HZ being the less obvious one, as it is the one added only for
> 3.14 and upper.
>
> I see two alternatives here:
>
> 1) say that this is always Hz. The problem is if some future hardware
> would support a bandwidth bigger than 2 GHz. That's unlikely, as
> using such filter would require a wide band antenna, but
> I won't doubt that this might happen some day;

Antenna dimensions are relative. 2GHz is not so much when we speak 
frequencies over 100 GHz and so. But it is very far away from the 
environment we are now playing with...


> 2) say that this should follow the corresponding tuner CAPS for
> frequencies (V4L2_TUNER_CAP_LOW, V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_1HZ).
>
> The advantage of (2) is that, if we latter need to support wide band
> filters, one would just need to use V4L2_TUNER_CAP_NORM (or a newer
> V4L2_TUNER_CAP_1KHZ).

That is fine for me too, but I suspect Hans don't like it, as those 
steps are mapped "V4L tuner API", right?

Anyway, is that something we can just put in and fine tune later if 
needed? I cannot see big issues and it is still experimental and all 
drivers are staging....

regards
Antti

-- 
http://palosaari.fi/

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

* Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls
  2014-03-12 14:23                   ` Antti Palosaari
@ 2014-03-12 17:15                     ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 24+ messages in thread
From: Mauro Carvalho Chehab @ 2014-03-12 17:15 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: LMML, Hans Verkuil

Em Wed, 12 Mar 2014 16:23:14 +0200
Antti Palosaari <crope@iki.fi> escreveu:

> On 12.03.2014 15:21, Mauro Carvalho Chehab wrote:
> > Em Wed, 12 Mar 2014 15:07:02 +0200
> > Antti Palosaari <crope@iki.fi> escreveu:
> >
> >> On 12.03.2014 14:57, Antti Palosaari wrote:
> >>> On 12.03.2014 14:47, Mauro Carvalho Chehab wrote:
> >>>> Em Wed, 12 Mar 2014 14:26:35 +0200
> >>>> Antti Palosaari <crope@iki.fi> escreveu:
> >>>>
> >>>>> On 12.03.2014 13:02, Mauro Carvalho Chehab wrote:
> >>>>>> Em Mon, 10 Mar 2014 12:01:28 +0200
> >>>>>> Antti Palosaari <crope@iki.fi> escreveu:
> >>>>>>
> >>>>>>> On 05.03.2014 20:49, Mauro Carvalho Chehab wrote:
> >>>>>>>> Em Thu, 27 Feb 2014 02:22:06 +0200
> >>>>>>>> Antti Palosaari <crope@iki.fi> escreveu:
> >>>>>>>>
> >>>>>>>>> Add documentation for RF tuner bandwidth controls. These controls
> >>>>>>>>> are
> >>>>>>>>> used to set filters on tuner signal path.
> >>>>>>>>>
> >>>>>>>>> Cc: Hans Verkuil <hverkuil@xs4all.nl>
> >>>>>>>>> Signed-off-by: Antti Palosaari <crope@iki.fi>
> >>>>>>>>> ---
> >>>>>>>>>      Documentation/DocBook/media/v4l/controls.xml | 19
> >>>>>>>>> +++++++++++++++++++
> >>>>>>>>>      1 file changed, 19 insertions(+)
> >>>>>>>>>
> >>>>>>>>> diff --git a/Documentation/DocBook/media/v4l/controls.xml
> >>>>>>>>> b/Documentation/DocBook/media/v4l/controls.xml
> >>>>>>>>> index 6c9dbf6..5550fea 100644
> >>>>>>>>> --- a/Documentation/DocBook/media/v4l/controls.xml
> >>>>>>>>> +++ b/Documentation/DocBook/media/v4l/controls.xml
> >>>>>>>>> @@ -5007,6 +5007,25 @@ descriptor. Calling &VIDIOC-QUERYCTRL; for
> >>>>>>>>> this control will return a
> >>>>>>>>>      description of this control class.</entry>
> >>>>>>>>>                  </row>
> >>>>>>>>>                  <row>
> >>>>>>>>> +              <entry
> >>>>>>>>> spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH_AUTO</constant>&nbsp;</entry>
> >>>>>>>>>
> >>>>>>>>> +              <entry>boolean</entry>
> >>>>>>>>> +            </row>
> >>>>>>>>> +            <row>
> >>>>>>>>> +              <entry spanname="descr">Enables/disables tuner
> >>>>>>>>> radio channel
> >>>>>>>>> +bandwidth configuration. In automatic mode bandwidth
> >>>>>>>>> configuration is performed
> >>>>>>>>> +by the driver.</entry>
> >>>>>>>>> +            </row>
> >>>>>>>>> +            <row>
> >>>>>>>>> +              <entry
> >>>>>>>>> spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>
> >>>>>>>>>
> >>>>>>>>> +              <entry>integer</entry>
> >>>>>>>>> +            </row>
> >>>>>>>>> +            <row>
> >>>>>>>>> +              <entry spanname="descr">Filter(s) on tuner signal
> >>>>>>>>> path are used to
> >>>>>>>>> +filter signal according to receiving party needs. Driver
> >>>>>>>>> configures filters to
> >>>>>>>>> +fulfill desired bandwidth requirement. Used when
> >>>>>>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO is not
> >>>>>>>>> +set. The range and step are driver-specific.</entry>
> >>>>>>>>
> >>>>>>>> Huh? If this is enable/disable, why "the range and step are
> >>>>>>>> driver-specific"?
> >>>>>>>
> >>>>>>> Because there is two controls grouped. That is situation of having
> >>>>>>> AUTO/MANUAL.
> >>>>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO
> >>>>>>> V4L2_CID_RF_TUNER_BANDWIDTH
> >>>>>>>
> >>>>>>> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when
> >>>>>>> V4L2_CID_RF_TUNER_BANDWIDTH_AUTO == false.
> >>>>>>>
> >>>>>>
> >>>>>> Sorry, but I'm not understanding what you're arguing.
> >>>>>>
> >>>>>> Yeah, it is clear at the patch that there are two controls, and that
> >>>>>> V4L2_CID_RF_TUNER_BANDWIDTH is valid only when AUTO is disabled, but
> >>>>>> this doesn't answer my question:
> >>>>>>
> >>>>>> Why V4L2_CID_RF_TUNER_BANDWIDTH's range and step are driver-specific?
> >>>>>>
> >>>>>
> >>>>> Hmmm. That control is used to configure RF filters. Filters set
> >>>>> bandwidth of radio channel. There is usually quite limited set of
> >>>>> available analog filters inside RF tuner. If you look for example
> >>>>> FC0012/FC0013 possible filters are 6/7/8 MHz. E4000 has something 4-11
> >>>>> MHz. If you look those very old 1st gen silicon tuners like QT1010 /
> >>>>> MT2060, there is no integrated filters at all - but there is external
> >>>>> saw filter which is usually 8MHz at 36.125 MHz IF.
> >>>>>
> >>>>> Did you remember there is same parameter already in DVB API (struct
> >>>>> dtv_frontend_properties bandwidth_hz)? That is control is currently used
> >>>>> to set r820t, fc0012, fc10013 .bandwidth_hz value, e4000 implements it
> >>>>> correctly as own control.
> >>>>>
> >>>>> I am quite astonished we have that big gap with our views.
> >>>>
> >>>> Well, on DVB, the bandwidth is specified in Hz, at DVBv5 (or via
> >>>> an enum on DVBv3).
> >>>>
> >>>> Here, there's no description about the unit to be used (Hz? kHz?).
> >>>> It just says that this is an integer, with a driver-specific
> >>>> range and step.
> >>>>
> >>>> So, one driver might choose to use Hz, other kHz, and other to
> >>>> expose some internal counter. That's bad.
> >>>>
> >>>> We should either use a V4L2_CTRL_TYPE_MENU type of control, where it
> >>>> would be possible to do something similar to DVBv3 way to specify
> >>>> the bandwidth filter, or to define that the bandwidth will be
> >>>> in Hz, kHz or MHz.
> >>>
> >>> Yeah, indeed. That was my mistake. The aim was Hz yes.
> >>>
> >>>>
> >>>> Probably, a menu type is better, as it allows userspace to get
> >>>> all supported bandwidths.
> >>>
> >>> I though it too, but there is already a lot choices for some tuners,
> >>> E4000 has over 30. What is maximum reasonable filter count for
> >>> V4L2_CTRL_TYPE_MENU?
> >
> > I don't see any troubles on having 30 items there. Maybe Hans is aware
> > of some troubles on having such number of items.
> >
> > The advantage of a menu type is that it helps userspace to select
> > an existing range.
> >
> >> One fear there is also what happens when there will be some day new RF
> >> tuner having DSP which does digital filtering ~1 Hz step?
> >
> > It is possible.
> >
> >> Mabbe the current control is enough, but probably it is place to add
> >> comment unit is Hz (even I think people should expect it is Hz when RF
> >> frequencies are spoken).
> >
> > Please remind that V4L2 API has 3 scales already for frequencies,
> > HZ being the less obvious one, as it is the one added only for
> > 3.14 and upper.
> >
> > I see two alternatives here:
> >
> > 1) say that this is always Hz. The problem is if some future hardware
> > would support a bandwidth bigger than 2 GHz. That's unlikely, as
> > using such filter would require a wide band antenna, but
> > I won't doubt that this might happen some day;
> 
> Antenna dimensions are relative. 2GHz is not so much when we speak 
> frequencies over 100 GHz and so.

Yes, I know.

> But it is very far away from the  environment we are now playing with...

I went once to a speech from one engineer working at one mobile manufacturer
that was experimenting with very wide band antenas. The idea were to have
just one antenna and one radio able to get the all the band used by AM, FM
and GSM/CDMA at the same time. This was several years ago. Not sure about
any progress made on that direction, but we should keep our minds open,
when dealing with an API that could potentially support things like that.

> > 2) say that this should follow the corresponding tuner CAPS for
> > frequencies (V4L2_TUNER_CAP_LOW, V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_1HZ).
> >
> > The advantage of (2) is that, if we latter need to support wide band
> > filters, one would just need to use V4L2_TUNER_CAP_NORM (or a newer
> > V4L2_TUNER_CAP_1KHZ).
> 
> That is fine for me too, but I suspect Hans don't like it, as those 
> steps are mapped "V4L tuner API", right?

Hans?

> Anyway, is that something we can just put in and fine tune later if 
> needed? 

Well, we should define something there. I would then say that this
is in 1Hz scale, and should be used only for SDR drivers that use
V4L2_TUNER_CAP_1HZ.

That would give us some flexibility to change it later if needed.

> I cannot see big issues and it is still experimental and all 
> drivers are staging....

Having the drivers at staging helps, but I doubt that we'll remind
to review this when moving the driver upstream. So, better to let
the API document to reflect what's implemented, in order to make
our lives easier when migrating this out of staging.

Regards,
Mauro

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

end of thread, other threads:[~2014-03-12 17:15 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-27  0:21 [REVIEW PATCH 00/13] SDR API - V4L API stuff itself Antti Palosaari
2014-02-27  0:21 ` [REVIEW PATCH 01/13] v4l: add RF tuner gain controls Antti Palosaari
2014-02-27  0:21 ` [REVIEW PATCH 02/13] v4l: add RF tuner channel bandwidth control Antti Palosaari
2014-02-27  0:21 ` [REVIEW PATCH 03/13] v4l: reorganize RF tuner control ID numbers Antti Palosaari
2014-02-27  0:21 ` [REVIEW PATCH 04/13] v4l: uapi: add SDR formats CU8 and CU16LE Antti Palosaari
2014-02-27  0:22 ` [REVIEW PATCH 05/13] v4l: add enum_freq_bands support to tuner sub-device Antti Palosaari
2014-02-27  0:22 ` [REVIEW PATCH 06/13] v4l: add control for RF tuner PLL lock flag Antti Palosaari
2014-02-27  0:22 ` [REVIEW PATCH 07/13] DocBook: V4L: add V4L2_SDR_FMT_CU8 - 'CU08' Antti Palosaari
2014-02-27  0:22 ` [REVIEW PATCH 08/13] DocBook: V4L: add V4L2_SDR_FMT_CU16LE - 'CU16' Antti Palosaari
2014-02-27  0:22 ` [REVIEW PATCH 09/13] DocBook: document RF tuner gain controls Antti Palosaari
2014-02-27  0:22 ` [REVIEW PATCH 10/13] DocBook: media: document V4L2_CTRL_CLASS_RF_TUNER Antti Palosaari
2014-02-27  0:22 ` [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls Antti Palosaari
     [not found]   ` <20140305154922.508c48d7@samsung.com>
2014-03-10 10:01     ` Antti Palosaari
2014-03-12 11:02       ` Mauro Carvalho Chehab
2014-03-12 12:26         ` Antti Palosaari
2014-03-12 12:37           ` Antti Palosaari
2014-03-12 12:47           ` Mauro Carvalho Chehab
2014-03-12 12:57             ` Antti Palosaari
2014-03-12 13:07               ` Antti Palosaari
2014-03-12 13:21                 ` Mauro Carvalho Chehab
2014-03-12 14:23                   ` Antti Palosaari
2014-03-12 17:15                     ` Mauro Carvalho Chehab
2014-02-27  0:22 ` [REVIEW PATCH 12/13] DocBook: media: document PLL lock control Antti Palosaari
2014-02-27  0:22 ` [REVIEW PATCH 13/13] DocBook: media: add some general info about RF tuners Antti Palosaari

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.