Hi. I have tried (in a bash shell): rtl_fm -f 96.3e6 -s 48000 - | aplay -r raw -f dat -c 1
That was proposed somewhere as an example to listen to an FM station. But everything terminates with: aplay: main:576: bad speed value 0 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 Oversampling input by: 21x. Oversampling output by: 1x. Buffer size: 8.13ms Tuned to 96552000 Hz. Sampling at 1008000 Hz. Output at 48000 Hz. Exact sample rate is: 1008000.009613 Hz Tuner gain set to automatic. Signal caught, exiting!
User cancel, exiting...
I run Fedora 16 on a 64-bit AMD machine. aplay version is 1.0.26
If I break the command apart and generates a intermediate file it works but using a pipe does not.
So is there some other shell that I where this might work or is there some better why to do this?
Regards
Olof
I have tried (in a bash shell): rtl_fm -f 96.3e6 -s 48000 - | aplay -r raw -f dat -c 1
For rtl_fm, -s sets the station bandwidth, you probably want -r to set the output sample rate instead. You probably also want -W for wideband FM mode.
For aplay, -r sets the input sample rate, and "raw" isn't a valid sample rate. You probably mean -t instead. This works for me:
rtl_fm -f 105.3e6 -W -r 48000 - | aplay -t raw -f dat -c 1
Cheers, Adam.
On Sat, 17 Nov 2012 15:18:18 +0100 Olof Tangrot olof.tangrot@gmail.com wrote:
rtl_fm -f 96.3e6 -s 48000 - | aplay -r raw -f dat -c 1
aplay: main:576: bad speed value 0
Set the speed and format with aplay -r 48k -f S16_LE -t raw as the help message of rtl_fm suggests. That works (on Fedora too). Apparently -f dat shorthand is not enough for pipes.
-- Pete
Olof Tangrot wrote:
aplay: main:576: bad speed value 0
The error message indicates that aplay does not function.
If I break the command apart and generates a intermediate file it works but using a pipe does not.
And your testing confirms beyond doubt that your problem is completely with playback, and not with capture.
So is there some other shell that I where this might work or is there some better why to do this?
Just provide aplay the information that it wants. Or patch it to discover the information automatically, though that may be difficult.
//Peter