After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 640118 - v4l2: add element to control radio devices
v4l2: add element to control radio devices
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: 0.10.29
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2011-01-20 22:40 UTC by Alexey Chernov
Modified: 2011-03-27 19:47 UTC
See Also:
GNOME target: ---
GNOME version: ---

Patch adding v4l2radio element code (27.23 KB, application/octet-stream)
2011-01-20 22:40 UTC, Alexey Chernov
Updated patch (27.21 KB, patch)
2011-03-26 21:09 UTC, Alexey Chernov
none Details | Review
Alternative version of patch (24.02 KB, patch)
2011-03-26 22:30 UTC, Alexey Chernov
committed Details | Review
Test source to test v4l2radio element (9.70 KB, text/plain)
2011-03-27 19:47 UTC, Alexey Chernov

Description Alexey Chernov 2011-01-20 22:40:22 UTC
Created attachment 178899 [details]
Patch adding v4l2radio element code

GStreamer plugins lack an element which provides control over v4l2 radio devices as there's no separate element for it and v4l2src element couldn't be used due to several limitations of radio V4L2 devices against video V4L2 devices.

Last year I wrote separate radiotuner GStreamer plugin ( and during discussion in the mailing-list several developers suggested me not to include the plugin separately (to -bad package, obviously) but to try to merge it with existing video4linux2 plugin range (which consists of v4l2src and v4l2sink). I worked at it and I actually managed to use most of the low-level calls from already existing code. With some additional radiodevice-specific code I wrote the new v4l2radio element to close the gap in this part of functionality.

Attached patch includes code to video4linux2 plugin and adds v4l2radio element. The element itself implements GstTuner, GstURIHandler, GstPropertyProbe and GstImplementsInterface interfaces as completely as it's possible.
In terms of GstTuner interface, v4l2radio element has single channel (according to the official V4L2 API radio devices can contain exactly one channel) and supports changing frequency, sending certain signals and receiving signal strength. List of norms is NULL as norms aren't supported for radio.
As for GstURIHandler, the element supports 'radio' protocol. I decided to implement it very similar to MPlayer example, i.e. the format is "radio://"+ <frequency in MHz>.

Also, device and frequency can be set using certain properties.

I hope the patch is useful and would enhance GStreamer's functionality.
Comment 1 Alexey Chernov 2011-02-14 19:34:35 UTC
Could someone please review the patch? Is it possible to merge it? Thanks a lot in advance
Comment 2 Alexey Chernov 2011-03-26 21:09:40 UTC
Created attachment 184326 [details] [review]
Updated patch

Updated version of the patch against most modern git master in git format-patch format
Comment 3 Alexey Chernov 2011-03-26 22:30:00 UTC
Created attachment 184327 [details] [review]
Alternative version of patch

Here's an alternative version with all the functions in v4l2radio_calls.* files moved to gstv4l2radio.c.
Comment 4 Tim-Philipp Müller 2011-03-27 19:37:19 UTC
Thanks for the update, I've pushed the second patch now with tiny changes (use static debug category, remove some trailing whitespaces, move ARG_* enum to top of file):

 commit e7a63c34ac93a180d785b2cfc50b066fa8a7c882
 Author: Alexey Chernov <>
 Date:   Sun Mar 27 01:19:58 2011 +0300

    v4l2: new v4l2radio element to control analog radio devices

Haven't tested it myself though, but at least it seems to error out fine :)
Comment 5 Alexey Chernov 2011-03-27 19:46:15 UTC
Thanks you very much, Tim!

I've tested it with the real device quite thoroughly, also have a test source code. It's depends on Qt, but maybe it will be useful for someone so I'll attach it here.
Comment 6 Alexey Chernov 2011-03-27 19:47:14 UTC
Created attachment 184383 [details]
Test source to test v4l2radio element