Invalid Sample rate and Audio Underruns

Need help installing or figuring out something about your SDR? Ask here.
Spaghetti_No_Name
Posts: 5
Joined: Tue Nov 24, 2015 2:27 am

Invalid Sample rate and Audio Underruns

Post by Spaghetti_No_Name » Tue Nov 24, 2015 2:53 am

I'm currently going through Mike Ossmann's educational series and I keep running into the same problem with the rtl2832. When I run the FM demodulation flow graph on GNUradio, the fft is extremely choppy and no audio is played. In the lower screen it says the sample rate is invalid and keeps spitting out aU's. I've tried lower sample rates with the same result.
I can't figure out why it does this, since it works perfectly fine in gqrx. I'm sure it doesn't help that I'm using a Mac, but I haven't found anything that addresses this problem.
(output):
Using Volk machine: avx_64_mmx_orc
gr-osmosdr v0.1.x-xxx-xunknown (0.1.5git) gnuradio 3.7.8.1
built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy
Using device #0 Realtek RTL2838UHIDIR SN: 00000001
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Invalid sample rate: 20000000 Hz
gr::log :INFO: audio source - Audio sink arch: osx
gr::log :INFO: audio_osx_sink0 -

aUaUaUaUaUaUaUaUaUaUaU..... (keeps going on)

pivi
Posts: 3
Joined: Wed Dec 30, 2015 3:59 pm

Re: Invalid Sample rate and Audio Underruns

Post by pivi » Wed Dec 30, 2015 6:01 pm

Spaghetti_No_Name wrote:I'm currently going through Mike Ossmann's educational series and I keep running into the same problem with the rtl2832. When I run the FM demodulation flow graph on GNUradio, the fft is extremely choppy and no audio is played. In the lower screen it says the sample rate is invalid and keeps spitting out aU's. I've tried lower sample rates with the same result.
I can't figure out why it does this, since it works perfectly fine in gqrx. I'm sure it doesn't help that I'm using a Mac, but I haven't found anything that addresses this problem.
(output):
Using Volk machine: avx_64_mmx_orc
gr-osmosdr v0.1.x-xxx-xunknown (0.1.5git) gnuradio 3.7.8.1
built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy
Using device #0 Realtek RTL2838UHIDIR SN: 00000001
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Invalid sample rate: 20000000 Hz
gr::log :INFO: audio source - Audio sink arch: osx
gr::log :INFO: audio_osx_sink0 -

aUaUaUaUaUaUaUaUaUaUaU..... (keeps going on)
If yo have no name than you are a nobody. I will not give advise to spaghetti!

rtlsdrblog
Site Admin
Posts: 2784
Joined: Mon Nov 19, 2012 11:54 pm

Re: Invalid Sample rate and Audio Underruns

Post by rtlsdrblog » Wed Jan 06, 2016 4:23 am

The aUaUaU indicates some sort of audio under run. Usually a problem with a miconfigured audio driver in your OS. Try setting the sample rate of your sound card to the output sample rate you are using in GNU Radio.

Either that or you Mac is simply too slow to run the SDR. What are its specs?

Can you boot into a Linux partition, or even perhaps try on a VM?

Spaghetti_No_Name
Posts: 5
Joined: Tue Nov 24, 2015 2:27 am

Re: Invalid Sample rate and Audio Underruns

Post by Spaghetti_No_Name » Thu Jan 07, 2016 5:01 am

rtlsdrblog wrote:The aUaUaU indicates some sort of audio under run. Usually a problem with a miconfigured audio driver in your OS. Try setting the sample rate of your sound card to the output sample rate you are using in GNU Radio.

Either that or you Mac is simply too slow to run the SDR. What are its specs?

Can you boot into a Linux partition, or even perhaps try on a VM?

My mac is a late 2013, with an i5. I don't think It should have an issue. Do you think it might have anything to do with USB 3 versus USB 2?
I have a linux desktop that I've tried the same flow graph on and it works, just poorly b/c of the lack of processing power I have in it.

rtlsdrblog
Site Admin
Posts: 2784
Joined: Mon Nov 19, 2012 11:54 pm

Re: Invalid Sample rate and Audio Underruns

Post by rtlsdrblog » Thu Jan 07, 2016 10:21 pm

Are you using a USB port? Some USB 3 ports are kind of buggy when working in USB 2 mode and could cause trouble, but i'd assume that Apple would use good quality USB controllers. Do other programs like GQRX or rtl_fm run fine our your Mac? If they do then your USB port should be fine.

You might be better off asking this on the GNU Radio mailing list or on IRC where the devs and hardcore GNU Radio users hang around.

Spaghetti_No_Name
Posts: 5
Joined: Tue Nov 24, 2015 2:27 am

Re: Invalid Sample rate and Audio Underruns

Post by Spaghetti_No_Name » Fri Jan 08, 2016 12:44 am

rtlsdrblog wrote: You might be better off asking this on the GNU Radio mailing list or on IRC where the devs and hardcore GNU Radio users hang around.
I ask this here because I'm using your dongle and I'm confused of the output in the Terminal. Specifically "[R82XX] PLL not locked!,
Invalid sample rate: 20000000 Hz."

what does PLL not locked mean? And what are valid sample rates for the rtl2832 unit? I change the sample rate around and it always says its invalid.

rtlsdrblog
Site Admin
Posts: 2784
Joined: Mon Nov 19, 2012 11:54 pm

Re: Invalid Sample rate and Audio Underruns

Post by rtlsdrblog » Fri Jan 08, 2016 1:59 am

Ah I think I understand what you're doing. You're copying Micheal Ossmanns HackRF tutorial word for word, but trying to use it with the RTL-SDR? I haven't been through his tutorials so I don't know if he explains the things you'd need to change to make a flowgraph work for the RTL-SDR.

PLL not locked means that the SDR couldn't tune to the center frequency you set. The RTL-SDR supports 24 MHz to about 1.7 GHz. However, sometimes this error shows anyway even with a correct frequency at the very beginning because sometimes the PLL takes a few tries to lock.

Invalid sample rate: 20000000 Hz - Here it seems you've set the sample rate to 20 MSPS, which is way too high for the RTL-SDR. Try a sample rate of 2000000 (2MSPS). The max you can probably use with the RTL-SDR is 2.4 MSPS. But in the first post you say you've tried lower sample rates and it still doesn't work...so i'm not sure if this is the problem.

Also you say that the flowgraph works fine on your Linux PC, so this is why I think something else must be wrong. If that's the case then I still suggest asking the GNU Radio people because then it's probably a software or PC problem and not a SDR hardware one. When the aUaU shows up it usually indicates some buffer problem with the soundcard set up, and the input-output rate you've selected, but it could have happened if you set the sample rate incorrectly. See http://gnuradio.org/redmine/projects/gnuradio/wiki/FAQ, "I have a receiver with acoustic output, and keep getting aUaUaU errors?"

Also what flowgraph and tutorial are you trying to do? Upload your grc file here.

Spaghetti_No_Name
Posts: 5
Joined: Tue Nov 24, 2015 2:27 am

Re: Invalid Sample rate and Audio Underruns

Post by Spaghetti_No_Name » Fri Jan 08, 2016 4:42 am

It won't allow me to upload a grc file. If you go to Mikes website, https://greatscottgadgets.com/sdr/1/ , you'll find the grc file. I haven't changed anything, other than messing with the sample rates. I know of the rtl-sdr's frequency limits, but there's probably something in the flow chart that doesn't mesh well with the rtl-sdr. Learning by failing is my best attribute.

rtlsdrblog
Site Admin
Posts: 2784
Joined: Mon Nov 19, 2012 11:54 pm

Re: Invalid Sample rate and Audio Underruns

Post by rtlsdrblog » Fri Jan 08, 2016 5:15 am

Did you try change the sample rate (samp_rate) to 2 MSPS?

Spaghetti_No_Name
Posts: 5
Joined: Tue Nov 24, 2015 2:27 am

Re: Invalid Sample rate and Audio Underruns

Post by Spaghetti_No_Name » Sat Jan 09, 2016 12:19 am

rtlsdrblog wrote:Did you try change the sample rate (samp_rate) to 2 MSPS?
I've tried some other ways to demodulate fm and they work. I think it might have something to do with the way Mike resamples the signal in the flow graph. I'm not totally clear on the interpolation/decimation aspects of demodulation, but I'll mess around with it till I do. At least I know that the rtl-sdr is working.

Thank you for your help.

Post Reply