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 743108 - v4l2: support radio devices in device monitor
v4l2: support radio devices in device monitor
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.4.5
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-17 23:38 UTC by budaservantes
Modified: 2018-11-03 14:57 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description budaservantes 2015-01-17 23:38:46 UTC
I want to create a filter to monitored v4l2 radio device in my system using GstDeviceMonitor.
With actual API, can monitor a v4l2 device with tv tuner but do not know if it is possible to create a filter for radio tuner.
Comment 1 budaservantes 2015-01-19 03:18:18 UTC
Something that can be done with GUdevDevice:


  device_file = g_udev_device_get_device_file (udevice);
  if (device_file == NULL)
  {
    GST_WARNING ("Error getting V4L device");
    return;
  }

  /* vbi devices support capture capability too, but cannot be used,
   * so detect them by device name */
  if (strstr (device_file, "vbi"))
  {
    GST_INFO ("Skipping vbi device: %s", device_file);
    return;
  }

  v4l_version = g_udev_device_get_property_as_int (udevice, "ID_V4L_VERSION");
  if (v4l_version == 2 || v4l_version == 1)
  {
    const char *caps;

    caps = g_udev_device_get_property (udevice, "ID_V4L_CAPABILITIES");
    if (caps == NULL || strstr (caps, ":capture:") == NULL)
    {
      GST_WARNING ("Device %s seems to not have the capture capability, (radio tuner?)"
                   "Removing it from device list.", device_file);
      return;
    }
Comment 2 Nicolas Dufresne (ndufresne) 2015-01-25 16:29:50 UTC
Thanks for reporting this bug. In order to submit patch you should clone git master of gst-plugins-good, do the changes and commit them to your local branch. The patch can be produce with "git format-path -1". This is the format we accept for review.
Comment 3 Nicolas Dufresne (ndufresne) 2015-05-05 21:28:59 UTC
Any update ? I realize that radio device in V4L2 are not well integrated, as V4L2 only do the tuner part, while the actual stream is within alsa/pulse.
Comment 4 Nicolas Dufresne (ndufresne) 2015-07-06 13:06:17 UTC
Is there still an interest in getting this ?
Comment 5 GEO 2015-12-06 13:21:09 UTC
There is someone who can create a patch and implement this option?

According to the spec, a V4L2 radio device can be recognized through the
capability flags

"Devices supporting the radio interface set the |V4L2_CAP_RADIO| and
|V4L2_CAP_TUNER| or |V4L2_CAP_MODULATOR| flag in the /|capabilities|/
field of struct v4l2_capability
<http://linuxtv.org/downloads/v4l-dvb-apis/vidioc-querycap.html#v4l2-capability>"

So you'll get |(V4L2_CAP_RADIO| | |V4L2_CAP_TUNER) for tuners, and
(V4L2_CAP_RADIO || |V4L2_CAP_MODULATOR) for modulator.| Modulators are
not (yet?) supported in GStreamer.

This filtering is relatively trivial and should be added to
gst-plugins-good/sys/v4l2/gstv4l2deviceprovider.c
Comment 6 Nicolas Dufresne (ndufresne) 2015-12-06 14:50:58 UTC
This is for sure trivial, please go ahead if you have a interest and are going to use that.
Comment 7 Tim-Philipp Müller 2015-12-06 15:36:23 UTC
How would this be used via device monitor then? If the actual audio has to be captured using alsasrc then I'm not sure if it really makes sense to advertise a v4l2src element with radio capabilities. Perhaps one needs to create a bin of sorts that plugs an alsasrc configured with the right device?
Comment 8 Nicolas Dufresne (ndufresne) 2015-12-06 15:48:06 UTC
I think you are right, it's not that trivial. Would make sense to use v4l2 to enumerate, cause the information is mostly there. But to be useful, the radio element should become a GstBin. In a way that the radio can dynamically find and use the proper (pulsesrc or alsasrc) element and configure it the way the device monitor is designed. I'd like to keep that bug open still, as I think it's not impossible and probably wanted feature. On don't need a radio device, since we got vivid that simulate all of it now.
Comment 9 GEO 2015-12-07 10:12:12 UTC
Now can use GstCaps to monitor webcam via caps, for example:

caps = gst_caps_new_empty_simple ("video/x-raw");
gst_device_monitor_add_filter (priv->monitor, "Video/Source", caps);

but here there are no options to filter out devices with radio.

With actual API, can monitor a v4l2 tv and webcam devices but do not know if exist GstCaps (capabilities) describing media types for radio device.
Comment 10 Nicolas Dufresne (ndufresne) 2015-12-07 14:20:00 UTC
Currently the radio device only have a "Tuner" class. We can add more when this element is fixed. For the caps, with the Bin design, that should just work, note that caps are optional in the filter, radio caps will be an audio/x-raw in most cases (unless we decide to expose SDR signal that is not demodulated).
Comment 11 GStreamer system administrator 2018-11-03 14:57:05 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/152.