Git Product home page Git Product logo

pifmadv's People

Contributors

broken2048 avatar miegl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pifmadv's Issues

Question

IS raspberry pi 3 Radio MORE powerful than pi 2

If so how much do you think, will it be a bigger range?

termination issue with no audio

What I'm doing: sox someinput | pi_fm_adv ... --wait 0
I don't really understand why, but when sox playback finishes, the shell hangs indefinitely, there is no CTRL+C / CTRL+Z response, and killing -9 pi_fm_adv process seem to have no effect! the pid won't die, although the shell is working...

PS: I'm on a Pi3 (the only device I seem to have managed to get working with)

Rebooting pi has no effect when transmission running

When I sudo reboot when the tx is on I get disconnected from ssh as usual but the pi is still on and I can still hear music on the radio.
So then I pull the power source off.
Not a major problem just wanted to let you know.

Fm mpx argument

Ok so what is -mpx I’m guessing it’s used to limit the output power or something or like could
I set -mpx 1000000 and expect it to go to the moon?? His lol
But yeh

Slight Distortion on Speech

Hi,

I've been using this great tool to play with transmitting radio stations from a satellite tuner which carry RDS UECP data within the MP2 audio stream itself (designed usually for cable networks in Germany/Switzerland which use this RDS data to feed into their FM modulators for cable FM signals).

I wrote a small Python script which reads the data from the audio stream and outputs it to stdout in rds_ctl format for PiFmAdv - https://github.com/mrwish7/uecp_tool/blob/master/uecp_tool.py

e.g.

PS set to: " hr4 "
Set TA to OFF
PS set to: " Sie "
PS set to: " sagte "
RT set to: "Sie sagte doch sie liebt mich von Anders, Thomas & Silbereisen, "
PS set to: "doch sie"
PS set to: " liebt "
RT set to: "Santa Claus is comin' to town von Beach Boys "
PS set to: " hr4 "
PS set to: " Santa "
PS set to: "Claus is"
PS set to: " comin' "
PS set to: "to town "
PS set to: " von "
RT set to: "Santa Claus is comin' to town von Beach Boys "
PS set to: " Beach "
PS set to: " Boys "
PS set to: " hr4 "

This all works perfectly, however I'm having problems with optimising the audio of the transmission. I'm using FFMPEG to limit the 48kHz MP2 signal to 30kHz and also convert it to PCM for input to PiFmAdv -

curl -s http://localhost:9981/play/stream/channel/62ac871a6dadea71434d184d15c84cfe?profile=audio | tee >(python3.5 ../../uecp_pifm.py 320 > rds) | ffmpeg -i pipe:0 -acodec pcm_s16le -ar 30000 -f wav pipe:1 | sudo ./pi_fm_adv --audio - --freq 91.0 --preemph eu --cutoff 15000 --pi D364 --ctl rds

The main problem I'm having is that even though the audio is very quiet*, when the radio station is airing speech, the sound sort of "clips" and distorts a bit as they speak. Is there any settings I can add to optimise this? Otherwise the audio sounds very good!

*The audio is really quiet, much quieter than broadcast FM signals, so the volume on the radio has to be turned up a lot. I can fix this by adding something like -af 'volume=8dB' to my FFMPEG command to boost the volume - but this has the issue of making the speech distortion worse the higher you boost the volume!

rds switch parameter problem

Image

[root@alarmpi fm]# ./pi_fm_adv --rds 0
Carrier: 107.90 Mhz, VCO: 971.1 MHz, Multiplier: 50.578125, Divider: 9
Allocating physical memory: size = 4354048, mem_ref = 5, bus_addr = fd6c8000, virt_addr = 0x76771000
Master PLLA Locked
PPM correction is 0.0000, divider is 2129.6052 (2129 + 2479*2^-12).
RDS Options:
RDS: 0
Starting to transmit on 107.9 MHz.

the parameter rds 0 results in irregular signal transmitting.
thanks for your program !

Make the process quit on broken pipe / EOF

When piping musing into pi_fm_adv like this
sox somefile.mp3 -t wav - | pi_fm_adv ...
It would be nice if upon sox termination pi_fm_adv could terminate as well, just like pi_fm_rds did.
Could you please point me out a way to do so or implement it as I really need this behaviour
Thank you for this brilliant implementation, thought

I have question about the "WAVE BAND"

Im bit confused is Medium Wave ONLY AM
or is Medium Wave can be FM AS WELL ????

Because if so I want to broadcast Medium Wave FM Make more further pleas.

stopping PiFmAdv in Python3

I would like to run PiFmAdv under python3. What I am concerned about is the KeyboardInterrupt may not shut it down.
Is there a python3 "import"?

ps. I do not know how to add help wanted.

Any idea how to fix?

screen shot 2017-12-24 at 08 07 52

I get this after i restart PiFmAdv after it crashes.
High pitched noise, very weak signal as well.
overruns happening every second
Is PiFmAdv not reading the data at correct speed?

3.5mm jack output

Hey there,

I was wondering if it's possible to output the audio to the 3.5mm jack so I can connect it to my own transmitter?

Malfunction after 3-4 hours

The program seems to malfunction after around 3 to 4 hours.

A high pitched constant noise is made after several overruns.

Original PiFmRds did not make this noise and would just exit the program, which was better because I had the program in a loop, so it would just start again.

Please try and get this fixed, it would make the program perfect!
Thanks!

Playing a webstation stops after 3~4 hours (buffer sync problem)

If I route the audio stream of a webstream to the transmitter the audio stops after 3~4 hours.

This is caused by a buffer overflow/underrun because both the input and output streams are not synchronized.

for instance, 44.1kHz input is converted to the internal 228kHz samplerate. So far so good. But in practice 44.1kHz input is not exactly 44.1kHz (it could be 44.050kHz). and the DMA engine which is set to 228kHz is not exactly 228kHz (it could be 227.981kHz). So over time a buffer overflow or under run will occur.

You could fix this by either keep track of the buffer and adjust the 228kHz samplerate of the DMA controller to keep in sync. So if the buffer grows then slightly speed up the 228kHz clock. If the buffer shrinks slow down the 288kHz.

Or,

If the buffer buffer grows, resample the 44.1kHz input data slightly above 228kHz, or if the buffer shrinks, resample slightly below 228kHz.

But both solutions require a major rewrite of the code!

The first solution, slow down or speed up the 228kHz clock will also adjust the 19kHz pilot, 38kHz modulator and 57kHz modulator because the LUT a pre calculated at 228.0kHz.

The second solution, resample the audio slightly below or above 228kHz looks like the best solution because there is no need to resample the 19kHz, 38kHz, 57kHz LUT`s.

Br,
Vincent Bruinink.

Overrun issue

When i run the command to pipe audio from usb soundcard it is giving me the overrun!!! (at least ... ms long)

Real Time transmission

Hi, thank you for the software!
I'm trying to broadcast audio without latency. I was thinking about JACK to do that, but I can't pipe jack-stdout with pi_fm_adv because "Error: could not open stdin for audio input."
Raspbian Stretch
Any ideas ?

FIFO pipe doesn't work

PiFmAdv stops listening for commands after a while.
Not really sure what is the cause of this. Worked before but doesn't work now.
Tested on two rolling release distributions (Arch and Void).

Can you run two station

run two instance of PiFmAdv.
Will it work??
Will it halve the uotput power for each signal?

I have a small question about altitude of transmitter.

have a question but had to make issue , sorry.

lets say my house.
.====.
| |
||
| | <------ Transmitter downstairs (Worse reception)
But then...
.====.
| | <------ Transmitter Upstairs (I get much better reception)
|
|
| |

But this is slightly inconvenient and I would like to possibly have the Raspberry Pi Downstairs.
Can i have a wire traveling up the side of my house. and expect the range to be the same as if the Pi were upstairs.

.====.
| ( ( |(+ ) ) ) ) <--- End of wire and then radio waves.
|________| |<---- Wire from RPI
| Pi |-| <-----Raspberry pi downstairs

Because surely there would be waves generated throughout the height of the wire. up the house.
So intern there would be less waves generated at the top..

.====.
| | + ) ) ) ) ) ) ) ) ) ) ) <-- radio waves generated at end of wire.
|________| |<--- wire
| |-|<--- Rpi

Thats what i want cos more radio waves generated at higher altitude.

.====.
| | + )}}} less waves at top
|________| | }}}}
| |-| }}}} - Waves generated from all parts of wire!

If you know anything about this that would be great.

How can I make cars switch to my station

I want cars to be able to switch to my station maybe using some combination of RDS TA and EON on other stations....
Or maybe rds EAS pty 31 the Emergency Alert System but I think it only works in America.

So basically I want the cars to switch to my station as soon as there in range.
Just for testing thanks

Change Broadcast GPIO?

Hey there!

Is it possible to change what GPIO the program broadcasts on? A project I'm working on has a HAT that goes on top of GPIO 4 (Pin 7) but leaves the others untouched. Is there a way to have the program broadcast on another GPIO pin, one that isn't in use?

dynamic Radio data system RT causes messages to get merged

My radio station changes RT every 10 seconds, with two messages one saying "Welcome to Niall FM" and the other is "Now Playing: " with the song title...

Problem is that its very likely (e.g 80%) of the time to get the messages mixed up...

"Welcome to NiaNow Playing:"
or "Now Playing: Dr Dre feat SnooFM."

screen shot 2018-04-24 at 10 18 41

(The radio scrolls the text)

So of course in this picture it has cut in with the second rt has been cut off and then the now playing Rt has been inserted.

As if the RT is being transmitted then changed it continues at the same character position but with a different text.

It would be nice if this could be fixed. Im sure it wasnt in PiFMRds in 2016 not sure tho.

The script fetches the now playing from a server

Piping problem with cheap USB Sound card

Hello,
I have some issue using a pipe with PiFmAdv, however I do not find this issue with PiFmRds.
When I execute the command: sudo arecord -fS16_LE -r 44100 -Dplughw: 1.0 -c 2 - | sudo / home / pi / PiFmAdv / src / pi_fm_adv --freq 105.10 --audio - no error but the program cuts off just after starting it.
image
Same without pipe : sudo /home/pi/PiFmAdv/src/pi_fm_adv --freq 105.10 --audio /home/pi/cc.wav --ps ST-PIFM --rt 'St-PIFM RADIO' --mpx 70 --power 7 --gpio 4 --preemph 'eu'

Regards,
Thanks

(In pifmrds : sudo arecord -fS16_LE -r 44100 -Dplughw:1,0 -c 2 - | sudo /home/pi/PiFmRds/src/pi_fm_rds -freq 105.10 -audio -)

Less signal strength?

It appears that the signal strength lower than PiFmRds
I used to be able to hear a few hundread meters away but now only like 50 meter with PiFmAdv

Make the CLI parameters PiFmRds compliant

Not really an issue, but it would would be really useful to have the same syntax on both this and the "classic" version, as I could implement both versions in mpradio just by letting the user change the executable path

Crashes on pi3

When I start the program it crashes my pi..

I cannot VNC or anything but it doesnt shutdown it just freezes.

Add TP (Traffic Programme) FLAG

Hi.

Please add the TP flag so I can use it with TA.

Mwahaha, THEY WILL BE FORCED TO LISTEN TO MY RADIO.

... If they have TP enabled in the car of course.

rds 2.0

Hello,
when comes rds 2.0 ?
These are the features:

Seamless support for frequencies from 64 MHz to 108 MHz (AF, EON)
New character coding: UTF-8 (old EBU Charset remains for compatibility mode for the old 0A/2A Groups).
New ODA handling, "B" groups are assigned as signalling group to the “A” groups.
Long PS-Name, up to 32 byte with UTF-8 character set. (Indian, Chinese, Arabic, and more)
RadioText (eRT) 128 byte long with UTF-8
Increased capacity from 11.4 up to 57 "A"-groups per second. (2,109 bit/s. net capacity with the single modulation-type multiple subcarriers (SMMS) technology)
Graphical RadioText – supports HTML/CSS templates (for smartphones, car radios, computers/tablets)
Supports return channel over gRT if the receiver has IP or SMS capability.
Broadcaster's graphical logo – a maximum 4 kilobyte picture (JPEG, PNG, or GIF)
Hybrid Radio feature (partly based on Radio France development)

I really like this.

New GPIO function crashes Pi

Hey there, the new feature that you just added, adding a flag to change what GPIO pin it is broadcasted on, when I run the program without the flag, it works like normal, but when I use

--gpio 20

It freezes the entire SSH session and after I force close it, it will not let me reconnect until I unplug the pi and plug it back in.

Any ideas?

Console have no responce after running it

Model: Pi 2b
System: Rasbian stretch and the newest version in November 2017
have already edited config.txt
stuck and cannot exit after running

root@raspberrypi:~/PiFmAdv/src# ./pi_fm_adv -audio sound.wav
Carrier: 107.90 Mhz, VCO: 971.1 MHz, Multiplier: 50.578125, Divider: 9
Using mbox device /dev/vcio.
Allocating physical memory: size = 4354048, mem_ref = 5, bus_addr = fe6c8000, virt_addr = 0x767d3000
PPM correction is 0.0000, divider is 2129.6052 (2129 + 2479*2^-12).
RDS Options:
RDS: 1, PI: 1234, PS: , PTY: 15
RT: "PiFmAdv: Advanced FM transmitter for the Raspberry Pi"
Starting to transmit on 107.9 MHz.

And no audio output hearing in the radio.Then I used my rtlsdr to check the spectrum ,there is no siganal . But when i use the old version of rds.c committed on13 Nov. And after compiling ,it can output audio but stuck again .I dont know what happened .
Thank for your such intersting software.

RT A/B flag does not work

The RT A/B flag does not seem to work no matter how many times I try. I tried the following command and nothing seems to happen on the RT display in SDRsharp.

echo -e "AB ON\nRT some text"

Doing the commands one at a time makes no difference and RDS Spy does not show the bit changing.

AMAZING

EXTRA RDS
BETTER QUALITY

AMAZING THX FOR MAKING!!!!

TMC commands?

First of all: great work and thanks for making the raspi-fm-tool even better!

for testing purposes i would like to know if you plan to implement a RDS-TMC command for sending traffic related stuff via location and event codes.. as listed here for example:
https://wiki.openstreetmap.org/wiki/TMC/Event_Code_List

//EDIT: after some research i guess it needs to sit somewhere in get_rds_group(); .. and it looks like TMC is a 8A package and found something useful.. but dont know if i get it to work alone
https://www.defcon.org/images/defcon-15/dc15-presentations/dc-15-barisani_and_bianco.pdf

greetings

  • sgtigram

Insert artist and song name in --rt RDS radiotex [HOW-TO]

Rebroadcast internet or local streaming radio to FM with updated Artist and Song name in RDS text

The scope of this How-To is to be able to extract song info and put it into the RT field of RDS in pseudo real time (10 seconds delay)


This is not an issue but a 'How-To', sorry but I didn't find anywhere to put this.

  1. prerequisites

install PiFmAdv as user "root" in /root directory, do not install the program as "Pi" user.

sudo apt-get install sox
sudo apt-get install lame
sudo apt-get install libsox-fmt-mp3
sudo  apt-get install perl
  1. install ffmpeg (because we need the ffprobe command to do the job):

download and compile ffmpeg from the source.
https://www.ffmpeg.org/download.html
the current version is ffmpeg-4.0.2.tar.bz2

cd /root
wget https://ffmpeg.org/releases/ffmpeg-4.0.2.tar.bz2
tar xvjf ffmpeg-4.0.2.tar.bz2
cd ffmpeg-4.0.2
./configure
make
sudo make install

IMPORTANT NOTE: on Pi2 the above FFMPEG compile process takes several hours to be completed!! Be extremely patient.

  1. this is my script to do the dirty job:

sudo nano /root/inject-title.sh

#!/bin/bash
# by pilovis - Italy - parknat12 at yahoo.com
cd /root
/bin/sleep 1
rm /tmp/rds_ctl
/bin/sleep 1
mkfifo /tmp/rds_ctl &
/bin/sleep 1
# start FM transmitter
/usr/bin/sox --buffer 65536 --input-buffer 65536 -t mp3 http://stream.srg-ssr.ch/m/rsp/mp3_128 -t wav -c 2 - | sudo ./PiFmAdv/src/pi_fm_adv --preemph eu --ctl /tmp/rds_ctl --freq 88.0 --audio - &
# RDS text injection section below - 10 seconds loop
while :
do
/usr/local/bin/ffprobe 2> /dev/null -show_format http://stream.srg-ssr.ch/m/rsp/mp3_128 | grep TAG:StreamTitle= | cut -d '=' -f 2 | /usr/bin/perl -ne 'print "PS 'RADIO-88'\nRT $_"' > /tmp/rds_ctl
/bin/sleep 10
done

note: I put rds_ctl file in /tmp (RAM tmpfs) to avoid wearing out the SD card.

  1. give the right permissions to the above script:

sudo chmod 755 /root/inject-title.sh

  1. launch the script and it's done:

sudo /bin/sh /root/inject-title.sh &

note: after a few seconds delay the FM radio should start transmitting on 88.0 Mhz with "RADIO-88" station name.

  1. to stop the FM transmitter and all related processes, use the following command:

sudo killall pi_fm_adv

Enjoy
Maurizio

not running anymore und pi 1b

Hello,
i get "WARNING: Frequency should be in megahertz between 76.0 and 108.0, but is 0.000000 MHz
".
i have set all parameters. in an older versions it runs

Audio frezzes after a few seconds

Hi, when I start the Audio, it just works fine. Unless I exit the Terminal Window or after a few seconds. Then it happens, that the Audio just freezes, and the whole System just seems to collide...

Audio playing slowy and overrun.

I cna hear the audio playing slowly and I get overruns about 10 secs after starting PiFmAdv.

Starting to transmit on 107.9 MHz.
overrun!!! (at least 54.438 ms long)
overrun!!! (at least 29.159 ms long)

My command:

#!/bin/bash
cd /home/pi/PiFmAdv/src

while :; do
        sudo arecord -fS16_LE -r 44100 -D hw:Loopback,1,0 -c 2 - | sudo ./pi_fm_adv -ps "Niall FM" -ctl rds_ctl -audio -
	sleep 2s
	echo "restart"	
done

Error: could not open input file udio

Hello! I've used this program for quite a while, however it was a few months ago that I stopped using it. I'm reinstalling it now and plan on using it!

I've got it installed, and I can start it and it says it's running (playing nothing), but once I try to use an audio file, or pipe audio to it, it errors and says the following:

Error: could not open input file udio

I've searched online but can't figure out what this means or how to fix it.

Any help would be appreciated!
Thank you!

Piping audio from USB microphone input has ticking sound in background

I just bought a USB microphone adapter, so I can use my phone to pipe audio directly into PiFmAdv. However, when piping audio, there is a ticking noise that can be heard around every second. I recorded a few seconds of this, can be heard here. This ticking sound can be heard whether my phone is actually playing audio or not, and even pressing the "mute microphone" button on my USB adapter doesn't stop the sound. I recorded audio with the adapter on my PC, and there isn't any ticking there, and it doesn't happen when transmitting a .wav file directly. I'm not sure what is causing this, but it's very audible even when playing music, so it's rather annoying.

Using GPIO 34 on Pi 3, 3B+ and Zero W interferences with wifi

Hi,

im testing it with a Raspberry Pi 3 and 3B+, the radio works but when the program exits it brokes the network connections.
The wifi is still connected, but ping, ssh,... do not work anymore.

I have debugging a bit and it hangs at terminate function "Set GPIOs to be an output (instead of ALT FUNC 0, which is the clock)."

Trying with an older version, works fine at Pi 3, but at Pi3B+ occurs the same at code "Switch EMMC over to PLLD"

Thanks.

Recent PiFmAdv changes

Hello,
I just pushed a pretty big change to this project.

PiFmAdv is now modulating the PLLC instead of clock divider. This has a big impact on quality. The stereo reception is now much better. Also stations on close frequencies to PiFmAdv aren't jammed and can be listened to even in close range to PiFmAdv antenna.

This is all great but this change has also some negative impact.

Firstly you need to add gpu_freq=250 to /boot/config.txt to prevent frequency stability issues.

It would be much appreciated if you guys would test it out and post feedback on this issue!

The program hangs Raspberry Pi 3

Before changing the GPU frequency to 250, the program would play 15 seconds of music and then stop.
After changing the gpu frequency to 250, the program does not play music anymore, and instead hangs the raspberry pi. The raspberry pi however broadcasts white noise while doing this.

I updated my raspberry pi 3 to the most recent version

Monitor had an issue and then the Pi just hung.

Upon starting this program, the monitor i was using started showing white and black dots all over the place, then my Raspberry Pi 3 stopped responding and i had to reboot. tried again and had the same effect.

Program malfunctioning on most recent version of Raspbian GNU/Linux 9

cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)" NAME="Raspbian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
uname -a
Linux streampi 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux

When I try to run the program, it first crashes. Then running it again causes it to work for 15 seconds, then stop working.

When the GPU frequency is changed to 250 (or any number) it broadcasts nothing indefinitely and hangs the pi. I can not control-c the program.

Here is the weird thing.

I installed ubuntu server onto my raspberry pi's SD card, and it seems to have fixed all of the issues i was having, and allowed me to broadcast audio perfectly. However, the range was severely limited to a couple feet with and without an antenna. Before I was getting ~100 feet with a jumper wire attached, and now I only get 3 feet (even with -w set to 7!)

What OS can I install to make this work with a long range and allow me to broadcast for more than 15 seconds?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.