 
            With rtl_fm, I get a tiny burst of audio about once a minute.
My dongle is a vendor ID 0x0bda, product ID0x2838 from http://www.amazon.com/gp/browse.html?ie=UTF8&marketplaceID=ATVPDKIKX0DER...
I did: rtl_fm -f 88500000 - | play -t raw -r 24k -e signed-integer -b 16 -c 1 -V1 -
I got: Found 1 device(s): 0: Realtek, RTL2838UHIDIR, SN: 00000013
Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle Found Rafael Micro R820T tuner
-: (raw)
Encoding: Signed PCM Channels: 1 @ 16-bit Samplerate: 24000Hz Replaygain: off Duration: unknown
In:0.00% 00:00:00.00 [00:00:00.00] Out:0 [ | ] Clip:0 Oversampling input by: 42x. Oversampling output by: 1x. Buffer size: 8.13ms Tuned to 88752000 Hz. Sampling at 1008000 Hz. Output at 24000 Hz. Exact sample rate is: 1008000.009613 Hz Tuner gain set to automatic. In:0.00% 00:00:00.68 [00:00:00.00] Out:16.4k [ =====|===== ] Clip:0 ^CSignal caught, exiting!
The dongle works if I boot into Windows, but in OpenBSD I can't get anything out of it. I'm still trying to get dependencies for Gnuradio together. The only odd thing is that being OpenBSD, there's no -lrt when I link. Those functions are built into something else so I compile without the -lrt. There isn't an -lrt library.
I've tried writing little scripts to run it so I do it consistently. My wide FM one:
#!/bin/sh rtl_fm -W -l 0 -f 88500000 - | play -t raw -r 32000 -e signed-integer -b 16 -c 1 -V4 -
Narrow: #!/bin/sh rtl_fm -N -l 0 -f 162550000 - | play -t raw -r 32k -e signed-integer -b 16 -c 1 -V4 -
I've played with various options. If I use -R it runs for a long time with lots of data by Sox's meter, but I don't hear anything. If I pipe it to a file (without -R) the file is very small and grows slowly, not what I would expect from audio. I just grabbed a fresh copy by git yesterday but it works about the same.
A fresh run: freebie# rtl_fm -N -f 162550000 - | play -t raw -r 32k -e signed-integer -b 16 -c 1 -V 4 - Found 1 device(s): play: SoX v14.3.2 0: Realtek, RTL2838UHIDIR, SN: 00000013
Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle Found Rafael Micro R820T tuner Oversampling input by: 42x. Oversampling output by: 1x. Buffer size: 8.13ms Tuned to 162802000 Hz. Sampling at 1008000 Hz. Output at 24000 Hz. Exact sample rate is: 1008000.009613 Hz Tuner gain set to automatic. Signal caught, exiting!
I don't have much idea what's going on, but I'm tempted to try opening it from a pipe (in C) to see if I can capture anything more.
Alan
----- Radio Astronomy - the ultimate DX
 
            With rtl_fm, I get a tiny burst of audio about once a minute.
A fresh run: freebie# rtl_fm -N -f 162550000 - | play -t raw -r 32k -e signed-integer -b 16 -c 1 -V 4 -
Just FYI, you can see here that:
Output at 24000 Hz.
However you have told 'play' to play the audio at a sampling rate of 32kHz, even though the audio data is only arriving at 24kHz. So you will get stuttering as the audio buffer keeps running out and waiting for more data to arrive.
For me (under Linux), I get best results using the -r option to rtl_fm to set the output audio sampling rate to 48kHz, then tell play to play at 48kHz too. This way my system doesn't have to resample it to 48kHz before it can mix the stream into the system-wide audio output.
Note that the -s option sets the signal bandwidth and -r sets the output audio sampling rate. A lot of people misunderstand the purpose of the -s option, however you shouldn't need it unless you are trying to receive data signals. -W and -N set -s to the correct values for voice transmissions.
I would also suggest playing a .wav file with the same 'play' options just to make sure your system can play mono audio at low sampling rates. I know my sound card drivers won't (possibly because I am using a SPDIF connection to an external amplifier) so I need the Linux audio system to upmix it to 48kHz 16-bit stereo or I won't hear anything.
Cheers, Adam.
 
            I've tried matching the sample rates, it doesn't seem to make much difference. I just didn't happen to have saved the text from one of those.
I've also tried the -r option, but I didn't hear anything and I wasn't sure it was sending "raw" audio and not I/Q signals. It acted better, aside from that: the progress meter in Play was responding constantly like it was getting more audio and the file sizes were more like what I'd expect. With the bursting, I get 16k every minute, which is way too short.
I wrote some C to import one of the files and export as ascii, then make a Gnuplot file to plot it. There's a sample at: http://ab1jx.webs.com/toys/dongle/wfm2_dat3.gif (The X axis labels are data point numbers.) It looks like audio, but I see something in the output about a 6 millisecond sample buffer. That's possibly how much sound I get, and this sample is from the local NPR station so I don't know what they were doing at that instant, music or voice. I also haven't tried plotting I/Q output so I don't know what that looks like.
Yes, my sound works and playing a wav file with Play (Sox) works. I normally work at 8000 samples/second mono. No Linux sound to get in the way here (OpenBSD). From reading, it doesn't make sense to have the RF sampling rate the same as the audio sampling rate (I think) but that's what it defaults to.
OK, it helps to be reassured that somebody actually uses this and has it working. I'll mess with sampling rates and raw mode. Some real documentation for these programs would be a help.
Alan
----- Radio Astronomy - the ultimate DX
----- Original Message -----
From: Adam Nielsen a.nielsen@shikadi.net To: Alan Corey alancorey@yahoo.com Cc: "osmocom-sdr@lists.osmocom.org" osmocom-sdr@lists.osmocom.org Sent: Monday, December 31, 2012 1:28 AM Subject: Re: Trying to use rtl_fm, etc
With rtl_fm, I get a tiny burst of audio about once a minute.
A fresh run: freebie# rtl_fm -N -f 162550000 - | play -t raw -r 32k -e signed-integer -b
16
-c 1 -V 4 -
Just FYI, you can see here that:
Output at 24000 Hz.
However you have told 'play' to play the audio at a sampling rate of 32kHz, even though the audio data is only arriving at 24kHz. So you will get stuttering as the audio buffer keeps running out and waiting for more data to arrive.
For me (under Linux), I get best results using the -r option to rtl_fm to set the output audio sampling rate to 48kHz, then tell play to play at 48kHz too. This way my system doesn't have to resample it to 48kHz before it can mix the stream into the system-wide audio output.
Note that the -s option sets the signal bandwidth and -r sets the output audio sampling rate. A lot of people misunderstand the purpose of the -s option, however you shouldn't need it unless you are trying to receive data signals. -W and -N set -s to the correct values for voice transmissions.
I would also suggest playing a .wav file with the same 'play' options just to make sure your system can play mono audio at low sampling rates. I know my sound card drivers won't (possibly because I am using a SPDIF connection to an external amplifier) so I need the Linux audio system to upmix it to 48kHz 16-bit stereo or I won't hear anything.
Cheers, Adam.
 
            Still no luck. If I use -R for raw mode a little more data gets through (as seen by file sizes or the Play progress meter) but it seems to be less intelligible if anything. When I write to a file, the size is always in chunks of 16384 bytes (0x4000 or 2^14). At a sample rate of 24000 that's 1/3 second, which is about right compared to what I hear. Without using -R, this doesn't repeat for about a minute. That 16384 must be some buffer size or something in the rtl_fm program, but I haven't found it yet. I think this is supposed to repeat often enough to be continuous. Could computer speed be an issue? I'm on a single core P4 at 3.2 GHz.
From rtl_fm -f 146970000 -f 146985000 -f 146910000 -f 146940000 scan2.dat I got this which looks like bursts of noise as rtl_fm is scanning, still all within about 1/3 second:
http://ab1jx.webs.com/toys/dongle/scan2.dat.gif
There's a curious ripple in the baseline which doesn't quite look like power supply ripple, more like something from some filter.
Alan
----- Radio Astronomy - the ultimate DX
----- Original Message -----
From: Adam Nielsen a.nielsen@shikadi.net To: Alan Corey alancorey@yahoo.com Cc: "osmocom-sdr@lists.osmocom.org" osmocom-sdr@lists.osmocom.org Sent: Monday, December 31, 2012 1:28 AM Subject: Re: Trying to use rtl_fm, etc
With rtl_fm, I get a tiny burst of audio about once a minute.
A fresh run: freebie# rtl_fm -N -f 162550000 - | play -t raw -r 32k -e signed-integer -b
16
-c 1 -V 4 -
Just FYI, you can see here that:
Output at 24000 Hz.
However you have told 'play' to play the audio at a sampling rate of 32kHz, even though the audio data is only arriving at 24kHz. So you will get stuttering as the audio buffer keeps running out and waiting for more data to arrive.
For me (under Linux), I get best results using the -r option to rtl_fm to set the output audio sampling rate to 48kHz, then tell play to play at 48kHz too. This way my system doesn't have to resample it to 48kHz before it can mix the stream into the system-wide audio output.
Note that the -s option sets the signal bandwidth and -r sets the output audio sampling rate. A lot of people misunderstand the purpose of the -s option, however you shouldn't need it unless you are trying to receive data signals. -W and -N set -s to the correct values for voice transmissions.
I would also suggest playing a .wav file with the same 'play' options just to make sure your system can play mono audio at low sampling rates. I know my sound card drivers won't (possibly because I am using a SPDIF connection to an external amplifier) so I need the Linux audio system to upmix it to 48kHz 16-bit stereo or I won't hear anything.
Cheers, Adam.

