Notices


Reply
Thread Tools
Posts: 37 | Thanked: 11 times | Joined on Feb 2010
#1
Hi there,
I was thinking about buying something like this, a radio which has a delay function so you can do "timeshift" with it (with this, I can delay / pause the sound for a couple of seconds so I can watch any sports on TV synced with the FM radio commentary)...
...and then I thought of my beloved N900 which has saved me so many times before doing things my Android phone can't.
Would it be possible to write the FM radio output to a buffer or something like that, effectively "pausing" the radio stream so I can listen to it a couple of seconds "behind" live streaming? I know it's possible to do this with live stations on the web, but they're already too much delayed, so I need this done with the FM receiver.
Any thoughts?
And of course, thank you as always!
 

The Following 3 Users Say Thank You to vkthor For This Useful Post:
Posts: 72 | Thanked: 184 times | Joined on Apr 2011 @ Germany
#2
Originally Posted by vkthor View Post
Hi there,
I was thinking about buying something like this, a radio which has a delay function so you can do "timeshift" with it (with this, I can delay / pause the sound for a couple of seconds so I can watch any sports on TV synced with the FM radio commentary)
I think the recaller widget has the possibility to record the fm radio output to a file, there is some kind of "monitor-source" in pulse audio that does that.

Code:
gst-launch pulsesrc device=sink.hw0.monitor
gives you the source for a gst pipeline, and look into this post how to add a delay. Pitfall is, it's still putting the original audio on the speaker/headphones. But you can stream it over network to another device.
 

The Following 2 Users Say Thank You to Oblomow For This Useful Post:
Posts: 37 | Thanked: 11 times | Joined on Feb 2010
#3
Thank you very much for the answer, but I want to avoid streaming as it would induce a delay of a couple of seconds already, and anyway, I suppose I could do what you're telling me in an easier way with the phonestreamer app and then delay the incoming on the other device.
I'm looking for a solution in the phone, with just the phone. If I had two devices I could always just connect a jack between the N900 and the other thing and then delay the audio with VLC, which is what I already do when I'm at home, so as I'm telling you, what I'm looking for is a solution using only the N900.
Anyway, thank you again!
 
Posts: 838 | Thanked: 3,384 times | Joined on Mar 2009
#4
Originally Posted by vkthor View Post
Would it be possible to write the FM radio output to a buffer or something like that, effectively "pausing" the radio stream so I can listen to it a couple of seconds "behind" live streaming?
a)
I tested what comes first to my mind (warning: it is not yet working)

Connect headset for antenna, start qradio and start playing.
Then on terminal:
Code:
gst-launch autoaudiosrc device=hw:1 ! audioconvert !  queue min-threshold-time=1000000000  !  autoaudiosink
(take audio which is going to out, delay it one second and forward it back)

-> You will hear audio two times and it has bad snapping (not even smooth echo).
I don't know how to continue with that.

b) modify code of e.g. qradio. I already fetched the code, but didn't understand how it works.
Couple of other radio application listed on wiki:
http://maemo.org/packages/view/cfmradio/
http://maemo.org/packages/view/fmradio/

c) Compile gstplugin: v4l2radio e.g. from harmattan:
Code:
git clone git@gitorious.org:harmattan-projects/gst-plugins-good.git
(Source-deb would be better. Link please?)
Harmattan use newer gstreamer, so plugin might need code modifications and then it could work.


And use it: http://harmattan-dev.nokia.com/docs/...v4l2radio.html

I'm not sure would it then just work. There are example for Ubuntu where audio comes from mic and goes to speaker:
http://ubuntuforums.org/showthread.php?t=1189559
 

The Following User Says Thank You to AapoRantalainen For This Useful Post:
Posts: 37 | Thanked: 11 times | Joined on Feb 2010
#5
Thank you VERY much, I think this is great progress.
I'm not a developer (I just know basics of C and little else), but I'll look into the code and try to see if anything comes to my mind.
 
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#6
In cfmradio, just change cfmradio.c:430 to

Code:
g_object_set(G_OBJECT(radio), "output", CFM_RADIO_OUTPUT_MUTE, NULL);
to disable the builtin loop that copies audio to speakers. That way you can launch an external gstreamer loop that does whatever processing/delay you want, as suggested in the above post, method (a).

It would not be very hard to add a fixed delay to cfmradio itself (you just need to buffer up the raw audio data before forwarding to speakers), but you will indeed need some C and basic audio processing knowledge.
 

The Following 3 Users Say Thank You to javispedro For This Useful Post:
Posts: 37 | Thanked: 11 times | Joined on Feb 2010
#7
Noob alert: I've had some free time but I've not been able to compile cfmradio for the N900 . I tried compiling the (modified) source using make, after installing build-essential-tools, but no luck.
Could you perhaps point me in the right direction here?
Thank you very much
 
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#8
Originally Posted by vkthor View Post
Noob alert: I've had some free time but I've not been able to compile cfmradio for the N900 . I tried compiling the (modified) source using make, after installing build-essential-tools, but no luck.
Could you perhaps point me in the right direction here?
Thank you very much
Are you using scratchbox (the Maemo SDK)? If not, you may want to read any of the Maemo SDK guides, e.g. http://wiki.maemo.org/Documentation/...ment/Maemo_SDK.

If you are already using scratchbox, then you should install maemo-sdk-dev before continuing.
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:47.