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 168735 - Make v4l radio use normal (gstreamer) backend
Make v4l radio use normal (gstreamer) backend
Product: rhythmbox
Classification: Other
Component: Internet Radio
Other Linux
: Normal enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
: 300070 (view as bug list)
Depends on:
Reported: 2005-02-28 09:15 UTC by Nickolay V. Shmyrev
Modified: 2018-05-24 10:42 UTC
See Also:
GNOME target: ---
GNOME version: ---

tar.gz with patch and additional sources (21.19 KB, application/x-compressed-tar)
2005-03-03 16:28 UTC, Nickolay V. Shmyrev
Tar.gz with patch and new files. (21.65 KB, application/x-compressed-tar)
2005-06-12 22:16 UTC, Nickolay V. Shmyrev
Updated patch (21.46 KB, application/x-compressed-tar)
2006-02-19 12:35 UTC, Nickolay V. Shmyrev
rhythmbox-fmradio.patch (39.14 KB, patch)
2007-05-21 10:07 UTC, James Henstridge
committed Details | Review

Description Nickolay V. Shmyrev 2005-02-28 09:15:32 UTC
I hope there will be support for video4linux radio in gstreamer

So it would be nice to make rhythmbox support radio. 

Some design moments are not clear for me:

1. Should I create a new source like iradio?
2. Should I add new uri like v4lradio:// ?
3. Any other ideas on this feature?
Comment 1 Nickolay V. Shmyrev 2005-03-03 16:28:39 UTC
Created attachment 38209 [details]
tar.gz with patch and additional sources

First version :)
Comment 2 Christophe Fergeau 2005-03-04 09:00:00 UTC

I haven't really had time to look at your patch, and without v4l hardware, I'll
probably have a hard time testing it :(... 
Does it play anything yet, or is it just for testing? It seems you have to
manually specify a frequency to add a v4l radio, any idea if it would be
possible to autodetect radio frequencies, and even better, get their name from
RDS ? (just a question, don't go like crazy coding that ;) 
The v4l-iradio source seems like a lot of code, does it have lot of common with
the standard iradio source, or is there really few code that can be shared?
Comment 3 Nickolay V. Shmyrev 2005-03-04 16:38:46 UTC
It works perfectly for me, really, it's ready for usage. Moreover, it's disabled
by default, so there should not be any problem.

There is nothing strange that there is much common code - the iradio code was a
good template. But in the future they can grow in different directions. For
example, v4lradio station has attributes like stereo/mono, signal level and so
on. The autodetect is also needed. Probably they genre column is not so needed
for v4lradio. So, the sources are really completely different. 

About autodetect. It possible to implement such feature. Hardware and v4l
interface has ways to detect signal strength. The implementation of such things
in gstreamer and rhythmbox is also possible, but there should be a code to start
with :)

Also, it's possible to get station list somewhere and use it.
Comment 4 Nickolay V. Shmyrev 2005-06-12 22:16:16 UTC
Created attachment 47676 [details]
Tar.gz with patch and new files.

This is updated patch, it applies cleanly to CVS.

There was suggestion to use HAL to detect radio devices, but it've meet a
number of problems. First of all, v4l support was in hal 0.4 and magically
disappear in 0.5, I've created a bug about it

But even with 0.4 it's impossible to use hal, since it detects only video
devices, not radio. 

So I've choosen to check radio presence with another way - I just check for
/sys/class/video4linux/radio0 presense. It should work perfectly on recent
kernel systems.
Comment 5 Nickolay V. Shmyrev 2005-08-11 20:25:07 UTC
*** Bug 300070 has been marked as a duplicate of this bug. ***
Comment 6 Colin Walters 2005-08-11 20:38:32 UTC
It seems relatively sane, although it does really point out some core changes we
should make, in particualr the player mode stuff is something a lot of people
are hitting.  

This looking at /radio0 seems a bit unclean; I guess it's going to be unusual
for a machine to have more than one radio, but besides that I'm also a bit
worried about depending on sysfs layout and such (what if they change it to
start with 1 or have a different prefix?).  Really as Christophe said we need to
get the support in HAL again.

You need to fix the copyright; add your name to e.g.
iradio/rb-new-v4lstation.[ch] since you made changes.  Although, is it really
necessary?  Let's remove the Genre thing if it's not being used.

Can you post some screenshots of how the UI works?  I know nothing about v4l.

Can you explain what this patch is for?

--- rhythmbox/rhythmdb/rhythmdb.c       2005-06-11 19:12:26.000000000 +0400
+++   2005-06-12 23:25:05.000000000 +0400
@@ -1491,9 +1491,14 @@ rhythmdb_execute_stat (RhythmDB *db, con
        GnomeVFSResult vfsresult = GNOME_VFS_OK;
        char *unescaped;
        vfsresult = GNOME_VFS_ERROR_GENERIC;
-       event->real_uri = rb_uri_resolve_symlink (uri);
+       if (!rb_uri_is_v4lradio (uri))
+           event->real_uri = rb_uri_resolve_symlink (uri);
+       else
+           event->real_uri = g_strdup ("/dev/radio0");
        if (!event->real_uri)
                goto error;
        event->vfsinfo = gnome_vfs_file_info_new ();

I think this might not be necessary anymore; can you try removing it with the
latest CVS?

I would like to get some core changes in to support custom pipelines for
different sources (this will replace your patches to player.c); after we do that
 and address the above issues I think this work is good to go in.
Comment 7 Bastien Nocera 2005-11-25 23:54:10 UTC
Nickolay, any chance to update your patch against the current CVS?
Does HAL recognise v4l radios now?
Comment 8 Nickolay V. Shmyrev 2005-11-26 01:05:55 UTC
As I understood, hal question is still open. I'll try to look closer and update
the patch soon.
Comment 9 Alex Lancaster 2006-01-27 11:12:53 UTC
Switch component to "Internet Radio"
Comment 10 tobias 2006-01-27 14:23:06 UTC
Why "Internet Radio"? It's radio without internet.
Comment 11 Nickolay V. Shmyrev 2006-02-19 12:35:30 UTC
Created attachment 59703 [details]
Updated patch

This patch is not functional since gstreamer support is broken and rhythmbox uses gstreamer in rather restrictive way. I am attaching it just to keep the work
Comment 12 James "Doc" Livingston 2006-02-21 12:19:25 UTC
Rather than doing a copy-and-paste of rb-iradio-source.c, it would probably be better to derive from it. You can change the "entry_type" property, and override impl_show_popup and impl_get_ui_actions -  however we need to make the entry-view popup configurable.

From the gstreamer side, all we really need is a v4lradiosrc element that accepts v4lradio:// URIs. Do you know what element we are supposed to use with 0.10? possible the base v4lsrc element?
Comment 13 James Henstridge 2007-05-21 10:07:17 UTC
Created attachment 88534 [details] [review]

Attached is a patch that adds the fmradio plugin I've been working on.  This is new work, rather than building on top of Nickolay's patches.

The plugin is not passing the audio through the GStreamer pipeline.  Instead it hooks up a source that outputs silence.  You'll need to adjust your mixer settings to pass through the audio with the right volume.

It uses the V4L2 tuner interface, so should work with current kernels (I've tested with my DSB-R100 using 2.6.20).  It'd need more work to support the V4L1 interface found in older kernels (should be possible to pick the right interface at runtime).
Comment 14 Christian Fredrik Kalager Schaller 2007-05-21 13:41:16 UTC
Be aware that there is a v4l2src plugin in GStreamer CVS (--good)
Comment 15 Nickolay V. Shmyrev 2007-05-21 14:04:39 UTC
Good progress, thanks :)

The biggest reason for gstreamer is that many common tv-tuner cards doesn't stream audio through cable to line-in, they use DMA through PCI. Card is visible as another alsa device and there should be an application to stream sound from one alsa device to another. So user have to run sox anyhow.

About v4l2src it would be nice to build pipeline with it automatically since rhythmbox uses uris :(
Comment 16 James Henstridge 2007-05-22 01:39:45 UTC
Christian: the existing Video4Linux2 GStreamer plugin is not usable with my card.  In general, V4L2 radio devices do not provide any audio or video through the device -- just a tuner input and one or more controls (mute on most, volume on some).  Often they don't support enough ioctls to properly introspect all these features either ...

The v4l2src element just segfaults if I try to instantiate it with the radio device (e.g. "gst-launch-0.10 v4l2src device=/dev/radio0").

Nickolay: we could probably change my patch to hook up an alsasrc for the appropriate sound card rather than feeding silence to GStreamer.  This'd handle your use case, and should work for cases like my DSB-R100 too.  We'd need a proper config dialog for it though ...

It'd also allow the volume control and visualisations in Rhythmbox to work with radio too, which would be good.
Comment 17 Nickolay V. Shmyrev 2007-05-22 05:06:32 UTC
That would be nice. About v4lsrc it's certainly not usable for radio. In gstreamer there was v4lradio container so you was able to use 

v4lradio frequency=8700 (gconfaudiosrc) ! gconfaudiosink

but unfortunately it wasn't ported during gstreamer update :(
Comment 18 James Henstridge 2007-08-22 07:57:15 UTC
Is there any further action that needs to be taken before my patch is considered?

Does the approach taken by my branch seem acceptable?  If not, are there any suggestions for changes/improvements?
Comment 19 Jonathan Matthew 2007-08-23 11:50:30 UTC
Sorry, I somehow got the impression this was still a work in progress last time I looked at it.  I haven't had a terribly close look, but it looks OK to me.
Comment 20 James "Doc" Livingston 2007-10-29 11:50:58 UTC
Sorry for taking so long to commit this, I'd missed it amongst the bugmail. I've committed the patch to svn with the addition of the appropriate keys to the gconf schema.

I'm leaving the bug open, but re-titled, in the hope that we can adapt it to sue the normal playback mechanisms in the future.
Comment 21 GNOME Infrastructure Team 2018-05-24 10:42:18 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME'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: