Help with Raspberry Pi Zero and RTL_FM

Status
Not open for further replies.

freema22

Member
Feed Provider
Joined
Sep 22, 2003
Messages
175
Location
Michigan
This is really starting to drive me nuts. I switched back over to the local NOAA channel, with everything else staying the same (gain, squelch, etc.). The audio is now cutting in and out, which leads me to believe that my squelch setting is too high. But, if I lower it for use on the channel I am trying to stream, I get nothing but static.

If I haven't said it enough, you guys are awesome for helping me with this!
 

freema22

Member
Feed Provider
Joined
Sep 22, 2003
Messages
175
Location
Michigan
Hi guys. Have you had any luck duplicating my situation? I have continued to screw around with the squelch and gain settings. If I leave the squelch really low, the dispatch audio sounds great, but there is tones of noise on either side of it. If I bring the squelch up to stop the noise, then the dispatch audio goes away. I don't quite understand the relationship between gain and squelch. It seems like if I bring the squelch up to stop the white noise, then go back and adjust the gain to bring up the dispatch audio. However, I have tried settings for each at opposite ends of the spectrums and it's either all or nothing. I'm also still not sure what the "-E pad" setting does.

Thanks again.
 

vagrant

ker-muhj-uhn
Premium Subscriber
Joined
Nov 19, 2005
Messages
3,182
Location
California
I'm lagging. I initially had a errors on two cards and ordered more and they arrived this week. Turns out that particular Windows computer has problems with its MicroSD card reader. - sigh

I also setup a stream w/Broadcastify and I'm going to test on that during an off peak time, as it can get popular at times. Honestly, I only planned on using it to test, but people are using it so I'll leave it up when done.

I should have time over the next couple of days to test using a Pi Zero W. I'll install the clients, configure things and give it a whirl. I'll report back after I confirm a working configuration.

As to the -E pad, I read that buffers the stream with zeros. I presume that is to keep the stream alive/open, so that Broadcastify still thinks it is active and shows it to be "Online". I could be wrong and or things may have changed with Broadcastify or with the client. I'll probably try it with and without -E pad anyways to see what happens.

Gain
If your audio is loud and clear, do not mess with the gain. You may not even need to provide any parameters for the gain. I would just leave the squelch off and listen to the audio from dispatch. If you can hear and it is loud enough without much white noise along with the audio, just leave the gain alone. Boosting the gain to 49.7 or whatever the max is will not eliminate the white noise until you improve your antenna or coax. Hell, even then you could be getting interference and it may never go away.

Squelch
Adjust your squelch until the white noise is gone while no one is transmitting. Let's say the noise is gone at 65, I would restart the client again, but with a setting of 64 and keep going down/restarting until you hear the noise. Then come back up say +2 or +3 more and remove the noise so that the stream is silent. The signal from the repeater should be well above the noise floor and I did hear your stream one day and it did come up quite a bit over the noise floor.

At that point you should be golden. Honestly, if the signal is clear do not even fool around with the gain. Gain will improve the dispatch audio plus the noise with it.
 

freema22

Member
Feed Provider
Joined
Sep 22, 2003
Messages
175
Location
Michigan
I'm lagging. I initially had a errors on two cards and ordered more and they arrived this week. Turns out that particular Windows computer has problems with its MicroSD card reader. - sigh

Thanks for the input. Here's where I am. I removed the gain setting all together, and when I start RTL_FM, it says "Tuner gain set to automatic." I set the squelch to 65, and it is full quieting. Like, really full, because the only thing I hear is the occasional "pop". Absolutely no voice of any kind. If I dial the squelch to 64, it's just white noise and if there is any voice, it is unreadable due to "clipping" every other syllable. I wonder if I force the gain to a very low setting, would it be enough to overcome the crappy squelch. I I am really running out of options, and I feel like I am missing something here.
 

vagrant

ker-muhj-uhn
Premium Subscriber
Joined
Nov 19, 2005
Messages
3,182
Location
California
Raising the gain will probably raise your noise floor as well, so then you'll need to adjust the squelch and you're back to where you were before doing that, so avoid that.

Hmm...based on what you noted, it seems as though the audio from the repeater/dispatch is about the same level as your noise floor. I don't remember it being that low. I'm monitoring now, so give me a while as what you're streaming is not aways transmitting and I'm in and out the shack getting stuff done around the house today.

I'm not hearing any white noise, so I'm figuring your squelch is set to 65. Let's give it a bit till the end of the day, or until I hear some traffic.
 

vagrant

ker-muhj-uhn
Premium Subscriber
Joined
Nov 19, 2005
Messages
3,182
Location
California
Hmm...I'm hearing something if I turn up the volume full on my computer and on the player window. Some low noise/hum. Every once in a while I will hear a tone, it may change a bit, but then goes back and then finally it is gone, all within a minute. At one time a week or so ago I could hear the dispatch talking on your feed with the squelch open, now nothing. This drastic change is odd, like hardware wonky odd.

At this point I would say it is the hardware you're using. The working spec is a Pi 2 which has 1GB of RAM as well as a quad core CPU. The Zero has 512 MB of RAM and is a single core CPU. That difference is significant. I would say give a Raspberry Pi 3B+ or one of the Pi 4 models a try. The processor and RAM in those should handle it.
 

freema22

Member
Feed Provider
Joined
Sep 22, 2003
Messages
175
Location
Michigan
Raising the gain will probably raise your noise floor as well, so then you'll need to adjust the squelch and you're back to where you were before doing that, so avoid that.

Hmm...based on what you noted, it seems as though the audio from the repeater/dispatch is about the same level as your noise floor. I don't remember it being that low. I'm monitoring now, so give me a while as what you're streaming is not aways transmitting and I'm in and out the shack getting stuff done around the house today.

I'm not hearing any white noise, so I'm figuring your squelch is set to 65. Let's give it a bit till the end of the day, or until I hear some traffic.

Last night I eliminated the gain setting, and none of the traffic was audible. It is currently set
Hmm...I'm hearing something if I turn up the volume full on my computer and on the player window. Some low noise/hum. Every once in a while.......

I was beginning to wonder about the hardware side of things. Luckily, I have a Pi3 that I could probably test with. I'll try to mess with that tomorrow.

Thanks so much for your help.
 

freema22

Member
Feed Provider
Joined
Sep 22, 2003
Messages
175
Location
Michigan
I have the Pi3+ up and running. I have had to raise the squelch up to 72 to eliminate the white noise. But, now when the dispatch audio comes through, it is being clipped. I do hear that weird hum behind the dispatch audio that is not present on my "real" radio that is sitting on my desk.
 

vagrant

ker-muhj-uhn
Premium Subscriber
Joined
Nov 19, 2005
Messages
3,182
Location
California
Okay, I can hear things now with your Pi 3. It sounds like you need to turn the squelch up just one or two more. Wait...now it's gone. I wonder if you are adjusting and restarting the client as I type.

I heard the dispatch audio as well, but another radio in the shack was RX at the same time, so I'm not sure if I heard clipping or if it was clear.

Update - Yes, I now hear the audio clipping.

Okay, although the audio is clipping the signal seems strong, so you should not need to adjust the gain. Hmm...I wonder if RTL_FM can do tone squelch. That may easily solve the problem. I doubt it offers that, but I'll look. - I'm not finding anything right off to squelch the audio until the tone is sent.
 
Last edited:

vagrant

ker-muhj-uhn
Premium Subscriber
Joined
Nov 19, 2005
Messages
3,182
Location
California
Listening now and your stream sounds fine. Please share your startup string so that others who drop in on this thread can benefit, as well as advising on what you did to finally get it to work.
 

freema22

Member
Feed Provider
Joined
Sep 22, 2003
Messages
175
Location
Michigan
Listening now and your stream sounds fine. Please share your startup string so that others who drop in on this thread can benefit, as well as advising on what you did to finally get it to work.

Between this post, and the one prior, I am exceptionally amused. I had not changed a thing to my setup! By leaving out the -g switch, it defaults to automatic gain mode. I am wondering if it did a little learning and has zeroed in on where it needs to be. Although I just checked the feed and the audio clipping is still occurring. My startup string is:

sudo /usr/local/bin/rtl_fm -d 0 -M fm -f 155.805M -l 71 -s 12k - | /usr/bin/lame -r -s 12 --resample 22.05 -m m -b 16 --cbr --lowpass 4 - - | /usr/bin/ezstream -c /etc/ezstream_bcfy.xml > /home/pi/bcfy2.log 2>&1 &
 

vagrant

ker-muhj-uhn
Premium Subscriber
Joined
Nov 19, 2005
Messages
3,182
Location
California
I am listening now and I do not hear the audio clipping. It still sounds okay. Signals can change from morning to evening and then back again. I would say leave it as is and we'll see if things change over the next 24~48 hours.

Hmm...it is just slightly distorting, but that is when they talk louder into their microphones.

Update: Okay, now it is definitely clipping on the other audio (different voices) coming through. Interesting.

I wonder if setting the gain lower and fixed will steady out the audio. I'll look at lame really quick and see if an adjustment can be made there instead.

Your gain options are the following. I wonder if trying 12.5 or even 0.0 would help. Sure would not hurt.
0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
 
Last edited:

vagrant

ker-muhj-uhn
Premium Subscriber
Joined
Nov 19, 2005
Messages
3,182
Location
California
Okay, I did some reading and try this instead.
1. Use the string as you noted above as the results were reasonbly working, other than the clipping. Change the following for lame.

--lowpass 4
Change the four to an eight. If the clipping is reduced, but still there, try using 12 instead of eight.
--lowpass 8
 

freema22

Member
Feed Provider
Joined
Sep 22, 2003
Messages
175
Location
Michigan
For some reason I didn't get a notification that there was a reply to my thread, so I apologize for the delay in responding. I changed the lowpass setting to 8, and listened for a little while (about 10 minutes). I changed it to 12, and am going to leave it alone, and let the archive record some audio. Then we'll see where we go from there.
 
Status
Not open for further replies.
Top