Using a Raspberry PI as an STL (stream) receiver

Everything technical about radio can be discussed here, whether it's transmitting or receiving. Guides, charts, diagrams, etc. are all welcome.
Post Reply
Elopid
big in da game.. trust
big in da game.. trust
Posts: 92
Joined: Sun Sep 06, 2015 8:50 pm

Using a Raspberry PI as an STL (stream) receiver

Post by Elopid » Wed Jan 27, 2021 12:43 am

Hi guys, and happy new year!
A friend of mine recently bought a raspberry PI and we would like to place it inside a transmitter high up a tree which we won't ever be able to get/climb back up again once it's up there.

I don't know anything about them but I know people who do and I would like to see if anyone here has successfully used one and find out what you did please?

We would really like to be able to process the deviation level to 75KHz limit and for it to keep on constantly trying to play the stream so if it ever cuts out it will start playing it again or have a silence-detector which cuts in playing until the stream comes back and then starts automatically playing the stream again.

I don't know if any of this is possible but from what I understand there are various "clued up" people on here who have used them and any information would be a great help.

From what I understand we can't use the Breakaway Broadcast processor for the PI so we will probably need to use stereotools, I would rather not have to pay to have to put it on this 20 quid raspberry PI and get a cracked version or something.

I apologise to anyone in the know if I am sounding a bit dumb as I don't know the first thing about it, so all help is appreicated and will be forwarded on to people who will know what to do once we can find out hopefully from you guys.

Many thanks in advance. -eLo-

Albert H
proppa neck!
proppa neck!
Posts: 2777
Joined: Tue Apr 05, 2016 1:23 am

Re: Using a Raspberry PI as an STL (stream) receiver

Post by Albert H » Wed Jan 27, 2021 3:42 am

Firstly - you're NOT going to "run" Windoze on a Raspberry Pi. There is an "ARM" version of Windoze, but it's a waste of time, and mostly doesn't woork.

You're going to have to discover the joys of a REAL operating system - Linux!

There are a few solutions around the 'net for what you're trying to achieve. I'll have a browse, and see if I can point you in the right direction. In the meantime, learn how to install the OS (Raspbian is probably a good starting point), and how to configure it. You're also going to need some kind of soundcard for the Pi - the on-board sound isn't great. I've used the cheap I2C DAC cards (about £8 from China) hard-wired to the GPIO pins on the Pi.

Get your kit together......
"Why is my rig humming?"
"Because it doesn't know the words!"
;)

neckertude
who u callin ne guy bruv
who u callin ne guy bruv
Posts: 20
Joined: Mon Aug 12, 2019 4:26 pm

Re: Using a Raspberry PI as an STL (stream) receiver

Post by neckertude » Wed Jan 27, 2021 3:48 pm

If you’ve got a lot of time to learn how to do this it’s definitely possible however if you’re unfamiliar with linux it can be very frustrating. I bought a few small PCs with 192Khz soundcards for around £30 each which will run BBP happily and requires much less tweaking to make all work. That’s just my experience! Good luck

User avatar
mpx
tower block dreamin
tower block dreamin
Posts: 251
Joined: Mon Dec 23, 2019 9:49 am

Re: Using a Raspberry PI as an STL (stream) receiver

Post by mpx » Wed Jan 27, 2021 4:15 pm

I'm interested to hear about this too, initially I was thinking of just a mp3 player but I like the idea of a Pi lightweight STL with processing

XXL
proppa neck!
proppa neck!
Posts: 537
Joined: Mon Sep 02, 2019 11:06 am

Re: Using a Raspberry PI as an STL (stream) receiver

Post by XXL » Wed Jan 27, 2021 6:40 pm

Don't bother, they never work properly near RF. Mine used to go off everyday without fail. Everyday i had to go over and physically reset it. They're not reliable at all.

User avatar
Bton-FM
tower block dreamin
tower block dreamin
Posts: 463
Joined: Sun Jun 16, 2019 2:55 pm
Location: Beside the seaside

Re: Using a Raspberry PI as an STL (stream) receiver

Post by Bton-FM » Wed Jan 27, 2021 6:47 pm

XXL wrote: Wed Jan 27, 2021 6:40 pm Don't bother, they never work properly near RF. Mine used to go off everyday without fail. Everyday i had to go over and physically reset it. They're not reliable at all.
Did you try shielding it?

Albert H
proppa neck!
proppa neck!
Posts: 2777
Joined: Tue Apr 05, 2016 1:23 am

Re: Using a Raspberry PI as an STL (stream) receiver

Post by Albert H » Wed Jan 27, 2021 8:02 pm

I've got Raspberry Pi machines running on sites with several kilowatts of AM (gets into everything). You just need to screen them properly, and make sure that the 5V supply you're using is completely clean. I also add RF filtering to the wires going on to and away from the Pi.

I've used them for switching rigs on and off, as mp3 players for "loss of link" fill-in, and various other housekeeping functions around the site. I've even used them for burglar alarms!

Linux is much easier to learn than Windoze programming. It's based on, and has most of the commands in common with, Unix. It "Just Works"™, and doesn't suffer from the problems that M$ crapware causes. It's worth learning. I have a Windoze 7 & 10 box (has both on board) here, but it's hardly ever used. Linux is available at an unbeatable price, and is running most of the world these days - every web server, router, DNS server, cloud host and everything else runs Linux!
"Why is my rig humming?"
"Because it doesn't know the words!"
;)

User avatar
mpx
tower block dreamin
tower block dreamin
Posts: 251
Joined: Mon Dec 23, 2019 9:49 am

Re: Using a Raspberry PI as an STL (stream) receiver

Post by mpx » Wed Jan 27, 2021 10:26 pm

Screening - does that involve tin foil and grounding it to the negative battery terminal or a ground stake?

Or shall I drag a microwave oven up the site and cut the plug off

Albert H
proppa neck!
proppa neck!
Posts: 2777
Joined: Tue Apr 05, 2016 1:23 am

Re: Using a Raspberry PI as an STL (stream) receiver

Post by Albert H » Thu Jan 28, 2021 3:47 am

mpx wrote: Wed Jan 27, 2021 10:26 pm Screening - does that involve tin foil and grounding it to the negative battery terminal or a ground stake?

Or shall I drag a microwave oven up the site and cut the plug off
Most of my gear is in 19" rack boxes. The Raspberry Pi is mounted on nylon pillars and there is a star point earth (usually near to the mains inlet). The audio card will be mounted directly on to the R Pi's GPIO pins, and the screened audio leads are grounded at only one end, and pass through clip-on ferrite filters. The PSU I chose to use was an "Advance" brand cased SMPSU giving 5 and 12 Volt outputs.

For the "send" end, the Raspberry Pi 3 gets an "Audio Injector" sound card. I've tried all of them over the last few years - even cards that cost >£90 - and the Audio Injector provides really good A to D conversion at just about £20. I use "Darkice" as the streaming software, and have a script that runs at start-up (or reboot) which simply starts Darkice streaming to a pre-configured web address. The box also contains a fairly basic stereo limiter to keep over-enthusiastic DJs' levels in check. If I'm feeling flash, I'll add a stereo bargraph indicator and a limiting indicator, and some status LEDs that are green when all is OK, but change to red if there's a problem.

The cheaper version of the "send" end is built into a diecast box, using the same Raspberry Pi 3 and a basic stereo limiter, but just have a couple of status LEDs - a bicolour job to show "OK" (green) and "limiting" (red), and another two to show power and "software running".

The receive end can be a Pi Zero (or Zero W if you need Wi-Fi) and a "TeraDak" ES9023 D to A board. The Pi Zero (£6.50) gets powered by a Chromecast PSU with Ethernet built in (about £15 from Amazon) or from a cheap 5V SMPSU with an "Ethernet Adapter for Chromecast Ultra/2/1/Audio, Google Home Mini, Micro USB to RJ45 Ethernet Adapter with USB Power Supply Cable" (£10 from Amazon) to provide connectivity. If you go the Wi-Fi route, you need the Pi Zero W (£10).

You can also use the Pi 2 or 3 for your receiver, but they're slightly more expensive, but have Ethernet ports and Wi-Fi built in.

At the receive end, I usually run PupPi (the ARM variant of Puppy Linux) and use MPV as the audio receiving software. I can have a really minimal Linux install - just enough to make it work. The advantage of this approach is that latency is kept to a minimum (though the 'net lag can sometimes be horrible).

We've used this kind of kit for Outside Broadcasts - it works just like the "Marti" equipment, but costs around £50 per end whilst their gear costs >£2500 per end! I think that I win!
Pic1.jpg
Pic2.jpg
Pic3.jpg
The push button on the green box is a "reset / restart" button for flaky OB Links.
You do not have the required permissions to view the files attached to this post.
"Why is my rig humming?"
"Because it doesn't know the words!"
;)

ronald001
big in da game.. trust
big in da game.. trust
Posts: 95
Joined: Sun Jan 17, 2016 1:49 pm
Location: Netherlands

Re: Using a Raspberry PI as an STL (stream) receiver

Post by ronald001 » Thu Jan 28, 2021 9:51 am


User avatar
g33ky
tower block dreamin
tower block dreamin
Posts: 281
Joined: Tue Dec 03, 2019 10:39 am
Location: Wirral

Re: Using a Raspberry PI as an STL (stream) receiver

Post by g33ky » Fri Jan 29, 2021 3:17 pm

I think a Raspberry Pi 4 can run a full 192khz sound signal including RDS and stereo pretty well. If you get it shielded so it doesn't blow near RF I'd install 'mpxgen' on the machine, it's a free command-line stereo+RDS generator. You'll need a 192khz USB soundcard, but these are findable on eBay/Aliexpress.
FM for lyfe!

Albert H
proppa neck!
proppa neck!
Posts: 2777
Joined: Tue Apr 05, 2016 1:23 am

Re: Using a Raspberry PI as an STL (stream) receiver

Post by Albert H » Sun Jan 31, 2021 11:22 pm

Further news on using a Raspberry Pi as a "link receiver":

I've been experimenting with PiCorePlayer. The OS and software clocks in at just over 50Mb, and runs well on the really cheap Pi Zero W.

You can download it from https://docs.picoreplayer.org/downloads/. I'd recommend using one of the versions from 2018 (4.1.0) - the later ones get bigger, don't boot as quickly and don't seem to be as stable. DO NOT make my mistake of trying the "Real Time Kernel" versions - madness will ensue!
"Why is my rig humming?"
"Because it doesn't know the words!"
;)

User avatar
Bton-FM
tower block dreamin
tower block dreamin
Posts: 463
Joined: Sun Jun 16, 2019 2:55 pm
Location: Beside the seaside

Re: Using a Raspberry PI as an STL (stream) receiver

Post by Bton-FM » Mon Feb 01, 2021 12:48 am

Albert H wrote: Sun Jan 31, 2021 11:22 pm Further news on using a Raspberry Pi as a "link receiver":

I've been experimenting with PiCorePlayer. The OS and software clocks in at just over 50Mb, and runs well on the really cheap Pi Zero W.

You can download it from https://docs.picoreplayer.org/downloads/. I'd recommend using one of the versions from 2018 (4.1.0) - the later ones get bigger, don't boot as quickly and don't seem to be as stable. DO NOT make my mistake of trying the "Real Time Kernel" versions - madness will ensue!
Is the Pi zero capable of playing a stream and MPX processing at the same time? Even if it could only play the stream it looks like the cheapest option for linking after a satcan. A stereo encoder and RDS encoder in the rig doesn’t cost that much.

User avatar
g33ky
tower block dreamin
tower block dreamin
Posts: 281
Joined: Tue Dec 03, 2019 10:39 am
Location: Wirral

Re: Using a Raspberry PI as an STL (stream) receiver

Post by g33ky » Mon Feb 01, 2021 5:05 pm

Bton-FM wrote: Mon Feb 01, 2021 12:48 am
Albert H wrote: Sun Jan 31, 2021 11:22 pm Further news on using a Raspberry Pi as a "link receiver":

I've been experimenting with PiCorePlayer. The OS and software clocks in at just over 50Mb, and runs well on the really cheap Pi Zero W.

You can download it from https://docs.picoreplayer.org/downloads/. I'd recommend using one of the versions from 2018 (4.1.0) - the later ones get bigger, don't boot as quickly and don't seem to be as stable. DO NOT make my mistake of trying the "Real Time Kernel" versions - madness will ensue!
Is the Pi zero capable of playing a stream and MPX processing at the same time? Even if it could only play the stream it looks like the cheapest option for linking after a satcan. A stereo encoder and RDS encoder in the rig doesn’t cost that much.
I've tried it on my Pi 0 (the original non-wifi one) and it cant do it very well, audio is choppy and RDS doesn't work because of said choppiness. The Pi 4 has apparently much got much better results, but I haven't tested it myself.
FM for lyfe!

Albert H
proppa neck!
proppa neck!
Posts: 2777
Joined: Tue Apr 05, 2016 1:23 am

Re: Using a Raspberry PI as an STL (stream) receiver

Post by Albert H » Wed Feb 03, 2021 1:42 pm

I've had a lot of success with the Pi 3+. You can run mpxgen on it (if you must) and it'll do stereo coding and RDS without problems - especially if you eschew the desktop, and do everything from the command line.

I'm using a few Pi Zero W jobs with "audio injector" boards as "link receivers". They work well, and sound fine. One minor gripe - I've been using a script that runs mpv at boot-up and works OK. However, I want it to automatically reconnect without intervention if there's a momentary loss. I have a script that mostly works, but if anyone has any better ideas, please let me know.
"Why is my rig humming?"
"Because it doesn't know the words!"
;)

User avatar
g33ky
tower block dreamin
tower block dreamin
Posts: 281
Joined: Tue Dec 03, 2019 10:39 am
Location: Wirral

Re: Using a Raspberry PI as an STL (stream) receiver

Post by g33ky » Wed Feb 03, 2021 2:56 pm

Albert H wrote: Wed Feb 03, 2021 1:42 pm I've had a lot of success with the Pi 3+. You can run mpxgen on it (if you must) and it'll do stereo coding and RDS without problems - especially if you eschew the desktop, and do everything from the command line.

I'm using a few Pi Zero W jobs with "audio injector" boards as "link receivers". They work well, and sound fine. One minor gripe - I've been using a script that runs mpv at boot-up and works OK. However, I want it to automatically reconnect without intervention if there's a momentary loss. I have a script that mostly works, but if anyone has any better ideas, please let me know.
Use a loop in the script? Something like 'while true; do [command here]; done'. Simple but it works. You can also consider ffplay (part of the ffmpeg package) which has some options for reconnecting to a stream if it loses it. 'ffplay -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 2' is the command-line I use.
FM for lyfe!

Albert H
proppa neck!
proppa neck!
Posts: 2777
Joined: Tue Apr 05, 2016 1:23 am

Re: Using a Raspberry PI as an STL (stream) receiver

Post by Albert H » Thu Feb 04, 2021 3:08 am

I use

while true
do mpv --quiet --no-video https://streaming.stream address.m3u -cache 1024
sleep 2
done


Quick and dirty, but it mostly works. I save it as a program called playstream.sh which is called on completion of boot.
"Why is my rig humming?"
"Because it doesn't know the words!"
;)

Albert H
proppa neck!
proppa neck!
Posts: 2777
Joined: Tue Apr 05, 2016 1:23 am

Re: Using a Raspberry PI as an STL (stream) receiver

Post by Albert H » Thu Feb 04, 2021 3:10 am

ffplay -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 2

How do you pass the web address to ffplay? (I'm just being lazy and not looking at the friendly man pages!)
"Why is my rig humming?"
"Because it doesn't know the words!"
;)

User avatar
g33ky
tower block dreamin
tower block dreamin
Posts: 281
Joined: Tue Dec 03, 2019 10:39 am
Location: Wirral

Re: Using a Raspberry PI as an STL (stream) receiver

Post by g33ky » Thu Feb 04, 2021 9:22 am

Albert H wrote: Thu Feb 04, 2021 3:10 am ffplay -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 2

How do you pass the web address to ffplay? (I'm just being lazy and not looking at the friendly man pages!)
With the -i flag: `ffplay -i http://82.94.205.115:8200 -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 2 -nodisp` (-nodisp just disables ffplay trying to open a video window which we don't need since it's just audio). Stick that in a loop like you have and it should have no issues.
Also I noticed you're using the .m3u file for your script, I don't know how well ffplay/ffmpeg handles it I think it just prefers the raw stream URL like the one I gave in this example.
FM for lyfe!

Albert H
proppa neck!
proppa neck!
Posts: 2777
Joined: Tue Apr 05, 2016 1:23 am

Re: Using a Raspberry PI as an STL (stream) receiver

Post by Albert H » Fri Feb 05, 2021 4:23 am

I'll give it a try!
"Why is my rig humming?"
"Because it doesn't know the words!"
;)

Post Reply