ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR
Name #
VIDIOC_G_MODULATOR - VIDIOC_S_MODULATOR - Get or set modulator attributes
Synopsis #
int ioctl(int fd, VIDIOC_G_MODULATOR, struct v4l2_modulator *argp)
int ioctl(int fd, VIDIOC_S_MODULATOR, const struct v4l2_modulator *argp)
Arguments #
-
fdFile descriptor returned by
open(). -
argpPointer to struct
v4l2_modulator.
Description #
To query the attributes of a modulator applications initialize the index field and zero out the reserved array of a struct v4l2_modulator and call the VIDIOC_G_MODULATOR ioctl with a pointer to this structure. Drivers fill the rest of the structure or return an EINVAL error code when the index is out of bounds. To enumerate all modulators applications shall begin at index zero, incrementing by one until the driver returns EINVAL.
Modulators have two writable properties, an audio modulation set and the radio frequency. To change the modulated audio subprograms, applications initialize the index and txsubchans fields and the reserved array and call the VIDIOC_S_MODULATOR ioctl. Drivers may choose a different audio modulation if the request cannot be satisfied. However this is a write-only ioctl, it does not return the actual audio modulation selected.
SDR specific modulator types are V4L2_TUNER_SDR and V4L2_TUNER_RF. For SDR devices txsubchans field must be initialized to zero. The term 'modulator' means SDR transmitter in this context.
To change the radio frequency the VIDIOC_S_FREQUENCY ioctl is available.
v4l2_modulator
|
__u32 |
|
Identifies the modulator, set by the application. |
||
|
__u8 |
|
Name of the modulator, a NUL-terminated ASCII string. This information is intended for the user. |
||
|
__u32 |
|
Modulator capability flags. No flags are defined for this field, the tuner flags in struct |
||
|
__u32 |
|
The lowest tunable frequency in units of 62.5 KHz, or if the |
||
|
__u32 |
|
The highest tunable frequency in units of 62.5 KHz, or if the |
||
|
__u32 |
|
With this field applications can determine how audio sub-carriers shall be modulated. It contains a set of flags as defined in modulator-txsubchans. |
||
|
__u32 |
|
Type of the modulator, see |
||
|
__u32 |
|
Reserved for future extensions. Drivers and applications must set the array to zero. |
||
|
|
0x0001 |
Modulate channel 1 as mono audio, when the input has more channels, a down-mix of channel 1 and 2. This flag does not combine with |
|
|
0x0002 |
Modulate channel 1 and 2 as left and right channel of a stereo audio signal. When the input has only one channel or two channels and |
|
|
0x0008 |
Modulate channel 1 and 2 as primary and secondary language of a bilingual audio signal. When the input has only one channel it is used for both languages. It is not possible to encode the primary or secondary language only. This flag does not combine with |
|
|
0x0004 |
Same effect as |
|
|
0x0004 |
When combined with |
|
|
0x0010 |
Enable the RDS encoder for a radio FM transmitter. |
Return Value #
On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.
-
EINVAL
The struct
v4l2_modulatorindexis out of bounds.