Skip to contentSkip to conversation

SDR API - V4L API stuff itself

PATCH In review Antti Palosaari 2 participants 24 messages Feb 27, 2014 – Mar 12, 2014 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover SDR API - V4L API stuff itself

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
Signature · 1 line
1.8.5.3
#1 lore raw

PATCH 1/13 v4l: add RF tuner gain controls

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.

---
 drivers/media/v4l2-core/v4l2-ctrls.c | 15 +++++++++++++++
 include/uapi/linux/v4l2-controls.h   | 11 +++++++++++
 2 files changed, 26 insertions(+)
drivers/media/v4l2-core/v4l2-ctrls.c +15 -0
index 6ff002b..7c6305c 100644
@@ -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:
include/uapi/linux/v4l2-controls.h +11 -0
index 2cbe605..817e2df 100644
@@ -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
Signature · 1 line
1.8.5.3
#2 lore raw

PATCH 2/13 v4l: add RF tuner channel bandwidth control

In reply to 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.

---
 drivers/media/v4l2-core/v4l2-ctrls.c | 4 ++++
 include/uapi/linux/v4l2-controls.h   | 2 ++
 2 files changed, 6 insertions(+)
drivers/media/v4l2-core/v4l2-ctrls.c +4 -0
index 7c6305c..07400dc 100644
@@ -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:
include/uapi/linux/v4l2-controls.h +2 -0
index 817e2df..2f6b5fb 100644
@@ -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
Signature · 1 line
1.8.5.3
#3 lore raw

PATCH 3/13 v4l: reorganize RF tuner control ID numbers

In reply to 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.

---
 include/uapi/linux/v4l2-controls.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
include/uapi/linux/v4l2-controls.h +8 -8
index 2f6b5fb..b7d4bb8 100644
@@ -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
Signature · 1 line
1.8.5.3
#4 lore raw

PATCH 4/13 v4l: uapi: add SDR formats CU8 and CU16LE

In reply to Antti Palosaari

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

---
 include/uapi/linux/videodev2.h | 4 ++++
 1 file changed, 4 insertions(+)
include/uapi/linux/videodev2.h +4 -0
index 27fedfe..3411215 100644
@@ -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
  */
Signature · 1 line
1.8.5.3
#5 lore raw

PATCH 5/13 v4l: add enum_freq_bands support to tuner sub-device

In reply to Antti Palosaari

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

---
 include/media/v4l2-subdev.h | 1 +
 1 file changed, 1 insertion(+)
include/media/v4l2-subdev.h +1 -0
index d67210a..4682aad 100644
@@ -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);
Signature · 1 line
1.8.5.3
#6 lore raw

PATCH 6/13 v4l: add control for RF tuner PLL lock flag

In reply to Antti Palosaari

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 <[email protected]>
Cc Hans Verkuil <[email protected]>
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 5 +++++
 include/uapi/linux/v4l2-controls.h   | 1 +
 2 files changed, 6 insertions(+)
drivers/media/v4l2-core/v4l2-ctrls.c +5 -0
index 07400dc..7f1bcab 100644
@@ -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);
include/uapi/linux/v4l2-controls.h +1 -0
index b7d4bb8..363a092 100644
@@ -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
Signature · 1 line
1.8.5.3
#7 lore raw

PATCH 7/13 DocBook: V4L: add V4L2_SDR_FMT_CU8 - 'CU08'

In reply to Antti Palosaari

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

---
 .../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
Documentation/DocBook/media/v4l/pixfmt-sdr-cu08.xml new file +44 -0
new file mode 100644
index 0000000..2d80104
@@ -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>
Documentation/DocBook/media/v4l/pixfmt.xml +2 -0
index f586d34..40adcb8 100644
@@ -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">
Signature · 1 line
1.8.5.3
#8 lore raw

PATCH 8/13 DocBook: V4L: add V4L2_SDR_FMT_CU16LE - 'CU16'

In reply to Antti Palosaari

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

---
 .../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
Documentation/DocBook/media/v4l/pixfmt-sdr-cu16le.xml new file +46 -0
new file mode 100644
index 0000000..26288ff
@@ -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>
Documentation/DocBook/media/v4l/pixfmt.xml +1 -0
index 40adcb8..f535d9b 100644
@@ -818,6 +818,7 @@ extended control <constant>V4L2_CID_MPEG_STREAM_TYPE</constant>, see
 interface only.</para>
 
     &sub-sdr-cu08;
+    &sub-sdr-cu16le;
 
   </section>
 
Signature · 1 line
1.8.5.3
#9 lore raw

PATCH 9/13 DocBook: document RF tuner gain controls

In reply to Antti Palosaari

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

---
 Documentation/DocBook/media/v4l/controls.xml | 91 ++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)
Documentation/DocBook/media/v4l/controls.xml +91 -0
index a5a3188..6c9dbf6 100644
@@ -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>
Signature · 1 line
1.8.5.3
#10 lore raw

PATCH 10/13 DocBook: media: document V4L2_CTRL_CLASS_RF_TUNER

In reply to Antti Palosaari

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

---
 Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml +6 -1
index b3bb957..e9f6735 100644
@@ -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>
Signature · 1 line
1.8.5.3
#11 lore raw

PATCH 11/13 DocBook: document RF tuner bandwidth controls

In reply to Antti Palosaari

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

---
 Documentation/DocBook/media/v4l/controls.xml | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
Documentation/DocBook/media/v4l/controls.xml +19 -0
index 6c9dbf6..5550fea 100644
@@ -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>
Signature · 1 line
1.8.5.3

A message that is not in the archive (sent off-list or not yet received): [email protected]

#13 lore raw

Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls

Quoted 31 lines · Mauro Carvalho Chehab

Em Thu, 27 Feb 2014 02:22:06 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 28 lines

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

---
  Documentation/DocBook/media/v4l/controls.xml | 19 +++++++++++++++++++
  1 file changed, 19 insertions(+)
Documentation/DocBook/media/v4l/controls.xml +11 -0
index 6c9dbf6..5550fea 100644
@@ -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>
Quoted 8 lines

Documentation/DocBook/media/v4l/controls.xml descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a · line 5026

Quoted 6 lines
Documentation/DocBook/media/v4l/controls.xml +6 -0
+            </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

Quoted 8 lines
Quoted 6 lines
Documentation/DocBook/media/v4l/controls.xml +2 -0
+            </row>
+            <row>
                <entry spanname="id"><constant>V4L2_CID_RF_TUNER_LNA_GAIN_AUTO</constant>&nbsp;</entry>
                <entry>boolean</entry>
              </row>
Signature · 1 line
http://palosaari.fi/
#14 lore raw

Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls

Em Mon, 10 Mar 2014 12:01:28 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 41 lines · Mauro Carvalho Chehab
Quoted 31 lines

Em Thu, 27 Feb 2014 02:22:06 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 28 lines

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

---
  Documentation/DocBook/media/v4l/controls.xml | 19 +++++++++++++++++++
  1 file changed, 19 insertions(+)
Documentation/DocBook/media/v4l/controls.xml +11 -0
index 6c9dbf6..5550fea 100644
@@ -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>
Quoted 8 lines

Documentation/DocBook/media/v4l/controls.xml descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a · line 5026

Quoted 6 lines
Documentation/DocBook/media/v4l/controls.xml +6 -0
+            </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"?

Quoted 8 lines

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?

Signature · 2 lines
Regards,
Mauro
#15 lore raw

Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls

Quoted 53 lines · Mauro Carvalho Chehab

Em Mon, 10 Mar 2014 12:01:28 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 41 lines · Mauro Carvalho Chehab
Quoted 31 lines

Em Thu, 27 Feb 2014 02:22:06 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 28 lines

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

---
   Documentation/DocBook/media/v4l/controls.xml | 19 +++++++++++++++++++
   1 file changed, 19 insertions(+)
Documentation/DocBook/media/v4l/controls.xml +11 -0
index 6c9dbf6..5550fea 100644
@@ -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>
Quoted 8 lines

Documentation/DocBook/media/v4l/controls.xml descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a · line 5026

Quoted 6 lines
Documentation/DocBook/media/v4l/controls.xml +6 -0
+            </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"?

Quoted 8 lines

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.

Quoted 8 lines

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

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

Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls

Quoted 84 lines · Antti Palosaari
Quoted 66 lines · Mauro Carvalho Chehab

Em Mon, 10 Mar 2014 12:01:28 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 54 lines · Mauro Carvalho Chehab
Quoted 39 lines

Em Thu, 27 Feb 2014 02:22:06 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 36 lines

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

---
   Documentation/DocBook/media/v4l/controls.xml | 19
+++++++++++++++++++
   1 file changed, 19 insertions(+)
Documentation/DocBook/media/v4l/controls.xml +0 -0
index 6c9dbf6..5550fea 100644
@@ -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>

Documentation/DocBook/media/v4l/controls.xml +4 -0
+              <entry>boolean</entry>
+            </row>
+            <row>
+              <entry spanname="descr">Enables/disables tuner radio

channel
+bandwidth configuration. In automatic mode bandwidth configuration is performed

Documentation/DocBook/media/v4l/controls.xml +4 -0
+by the driver.</entry>
+            </row>
+            <row>
+              <entry

spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>

Quoted 13 lines
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +4 -0
+              <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"?

Quoted 8 lines

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.

Quoted 8 lines

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.

Quoted 6 lines

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

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

Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls

In reply to Antti Palosaari

Em Wed, 12 Mar 2014 14:26:35 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 71 lines · Mauro Carvalho Chehab
Quoted 53 lines

Em Mon, 10 Mar 2014 12:01:28 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 41 lines · Mauro Carvalho Chehab
Quoted 31 lines

Em Thu, 27 Feb 2014 02:22:06 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 28 lines

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

---
   Documentation/DocBook/media/v4l/controls.xml | 19 +++++++++++++++++++
   1 file changed, 19 insertions(+)
Documentation/DocBook/media/v4l/controls.xml +11 -0
index 6c9dbf6..5550fea 100644
@@ -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>
Quoted 8 lines

Documentation/DocBook/media/v4l/controls.xml descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a · line 5026

Quoted 6 lines
Documentation/DocBook/media/v4l/controls.xml +6 -0
+            </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"?

Quoted 8 lines

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.

Quoted 8 lines

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.

Quoted 6 lines

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

#18 lore raw

Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls

Quoted 88 lines · Mauro Carvalho Chehab

Em Wed, 12 Mar 2014 14:26:35 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 71 lines · Mauro Carvalho Chehab
Quoted 53 lines

Em Mon, 10 Mar 2014 12:01:28 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 41 lines · Mauro Carvalho Chehab
Quoted 31 lines

Em Thu, 27 Feb 2014 02:22:06 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 28 lines

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

---
    Documentation/DocBook/media/v4l/controls.xml | 19 +++++++++++++++++++
    1 file changed, 19 insertions(+)
Documentation/DocBook/media/v4l/controls.xml +11 -0
index 6c9dbf6..5550fea 100644
@@ -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>
Quoted 8 lines

Documentation/DocBook/media/v4l/controls.xml descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a · line 5026

Quoted 6 lines
Documentation/DocBook/media/v4l/controls.xml +6 -0
+            </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"?

Quoted 8 lines

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.

Quoted 8 lines

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.

Quoted 6 lines

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.

Quoted 7 lines

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.

Quoted 3 lines

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

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

Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls

Quoted 114 lines · Antti Palosaari
Quoted 102 lines · Mauro Carvalho Chehab

Em Wed, 12 Mar 2014 14:26:35 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 85 lines · Mauro Carvalho Chehab
Quoted 67 lines

Em Mon, 10 Mar 2014 12:01:28 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 55 lines · Mauro Carvalho Chehab
Quoted 40 lines

Em Thu, 27 Feb 2014 02:22:06 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 37 lines

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

---
    Documentation/DocBook/media/v4l/controls.xml | 19
+++++++++++++++++++
    1 file changed, 19 insertions(+)
Documentation/DocBook/media/v4l/controls.xml +0 -0
index 6c9dbf6..5550fea 100644
@@ -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>

Documentation/DocBook/media/v4l/controls.xml +4 -0
+              <entry>boolean</entry>
+            </row>
+            <row>
+              <entry spanname="descr">Enables/disables tuner

radio channel
+bandwidth configuration. In automatic mode bandwidth configuration is performed

Documentation/DocBook/media/v4l/controls.xml +4 -0
+by the driver.</entry>
+            </row>
+            <row>
+              <entry

spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>

Quoted 13 lines
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +4 -0
+              <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"?

Quoted 8 lines

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.

Quoted 8 lines

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.

Quoted 6 lines

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.

Quoted 7 lines

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.

Quoted 1 line
Quoted 6 lines
Quoted 2 lines

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

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

Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls

Em Wed, 12 Mar 2014 15:07:02 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 115 lines · Antti Palosaari
Quoted 114 lines · Mauro Carvalho Chehab
Quoted 102 lines

Em Wed, 12 Mar 2014 14:26:35 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 85 lines · Mauro Carvalho Chehab
Quoted 67 lines

Em Mon, 10 Mar 2014 12:01:28 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 55 lines · Mauro Carvalho Chehab
Quoted 40 lines

Em Thu, 27 Feb 2014 02:22:06 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 37 lines

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

---
    Documentation/DocBook/media/v4l/controls.xml | 19
+++++++++++++++++++
    1 file changed, 19 insertions(+)
Documentation/DocBook/media/v4l/controls.xml +0 -0
index 6c9dbf6..5550fea 100644
@@ -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>

Documentation/DocBook/media/v4l/controls.xml +4 -0
+              <entry>boolean</entry>
+            </row>
+            <row>
+              <entry spanname="descr">Enables/disables tuner

radio channel
+bandwidth configuration. In automatic mode bandwidth configuration is performed

Documentation/DocBook/media/v4l/controls.xml +4 -0
+by the driver.</entry>
+            </row>
+            <row>
+              <entry

spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>

Quoted 13 lines
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +4 -0
+              <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"?

Quoted 8 lines

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.

Quoted 8 lines

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.

Quoted 6 lines

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.

Quoted 7 lines

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.

Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

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.

Quoted 2 lines

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.

Quoted 3 lines

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

#21 lore raw

Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls

Quoted 144 lines · Mauro Carvalho Chehab

Em Wed, 12 Mar 2014 15:07:02 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 115 lines · Antti Palosaari
Quoted 114 lines · Mauro Carvalho Chehab
Quoted 102 lines

Em Wed, 12 Mar 2014 14:26:35 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 85 lines · Mauro Carvalho Chehab
Quoted 67 lines

Em Mon, 10 Mar 2014 12:01:28 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 55 lines · Mauro Carvalho Chehab
Quoted 40 lines

Em Thu, 27 Feb 2014 02:22:06 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 37 lines

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

---
     Documentation/DocBook/media/v4l/controls.xml | 19
+++++++++++++++++++
     1 file changed, 19 insertions(+)
Documentation/DocBook/media/v4l/controls.xml +0 -0
index 6c9dbf6..5550fea 100644
@@ -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>

Documentation/DocBook/media/v4l/controls.xml +4 -0
+              <entry>boolean</entry>
+            </row>
+            <row>
+              <entry spanname="descr">Enables/disables tuner

radio channel
+bandwidth configuration. In automatic mode bandwidth configuration is performed

Documentation/DocBook/media/v4l/controls.xml +4 -0
+by the driver.</entry>
+            </row>
+            <row>
+              <entry

spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>

Quoted 13 lines
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +4 -0
+              <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"?

Quoted 8 lines

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.

Quoted 8 lines

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.

Quoted 6 lines

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.

Quoted 7 lines

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.

Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

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.

Quoted 2 lines

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.

Quoted 3 lines

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.

Quoted 6 lines

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

Quoted 6 lines

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

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

Re: [REVIEW PATCH 11/13] DocBook: document RF tuner bandwidth controls

Em Wed, 12 Mar 2014 16:23:14 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 147 lines · Mauro Carvalho Chehab
Quoted 146 lines

Em Wed, 12 Mar 2014 15:07:02 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 115 lines · Antti Palosaari
Quoted 114 lines · Mauro Carvalho Chehab
Quoted 102 lines

Em Wed, 12 Mar 2014 14:26:35 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 85 lines · Mauro Carvalho Chehab
Quoted 67 lines

Em Mon, 10 Mar 2014 12:01:28 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 55 lines · Mauro Carvalho Chehab
Quoted 40 lines

Em Thu, 27 Feb 2014 02:22:06 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 37 lines

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

---
     Documentation/DocBook/media/v4l/controls.xml | 19
+++++++++++++++++++
     1 file changed, 19 insertions(+)
Documentation/DocBook/media/v4l/controls.xml +0 -0
index 6c9dbf6..5550fea 100644
@@ -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>

Documentation/DocBook/media/v4l/controls.xml +4 -0
+              <entry>boolean</entry>
+            </row>
+            <row>
+              <entry spanname="descr">Enables/disables tuner

radio channel
+bandwidth configuration. In automatic mode bandwidth configuration is performed

Documentation/DocBook/media/v4l/controls.xml +4 -0
+by the driver.</entry>
+            </row>
+            <row>
+              <entry

spanname="id"><constant>V4L2_CID_RF_TUNER_BANDWIDTH</constant>&nbsp;</entry>

Quoted 13 lines
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +4 -0
+              <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"?

Quoted 8 lines

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.

Quoted 8 lines

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.

Quoted 6 lines

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.

Quoted 7 lines

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.

Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

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.

Quoted 2 lines

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.

Quoted 3 lines

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:

Quoted 7 lines
Quoted 4 lines

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.

Quoted 1 line

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.

Quoted 9 lines
Quoted 6 lines

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?

Quoted 2 lines

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.

Quoted 2 lines

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

#23 lore raw

PATCH 12/13 DocBook: media: document PLL lock control

In reply to Antti Palosaari

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 <[email protected]>
Cc Hans Verkuil <[email protected]>
---
 Documentation/DocBook/media/v4l/controls.xml | 9 +++++++++
 1 file changed, 9 insertions(+)
Documentation/DocBook/media/v4l/controls.xml +9 -0
index 5550fea..92e3335 100644
@@ -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>
Signature · 1 line
1.8.5.3
#24 lore raw

PATCH 13/13 DocBook: media: add some general info about RF tuners

In reply to Antti Palosaari

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

---
 Documentation/DocBook/media/v4l/controls.xml | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
Documentation/DocBook/media/v4l/controls.xml +21 -2
index 92e3335..9adf630 100644
@@ -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>
Signature · 1 line
1.8.5.3