Giter Site home page Giter Site logo

fm_transmitter's People

Contributors

bntk avatar clerie avatar codeskyblue avatar cyberflamego avatar earl0fpudding avatar greatlifehacker avatar ibug avatar magik6k avatar markondej avatar rsaxvc avatar steampunko 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  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

fm_transmitter's Issues

Intallation Instruction?

The installation instructions in the read me are really vague. I've tried everything I can think of but I can't seem to install this :(

I'm on a Pi2+B, how would I install this from the terminal?
anyone able to help?

Changing gpio pin

Can i change gpio pin? What changes i need to make before compiling?

Am I missing something??

Hey all,

heres what happens when i try to use this, it always gives me an error that says that it does not recognize the command "sudo: ./fm_transmitter: command not found" and that would be because there is no file called fm_transmitter to download from this github, so where is it?? or am i missing something??

Can I use this on my own GitHub project?

Hi!

I'm new to GitHub and to the whole licensing process and I was wondering if I could implement your project into mine so users didn't have to download from different repositories. Since you didn't have any license file I got confused and felt like it's better to ask.
I will obviously post a link to this project and say that the core of my project is yours. I just made a sorta graphical interface with some extra tweaks for it... Also, my project will have a standard MIT License.

Thanks in advance!

Can you please put a video tutorial up?

I am extremely new to raspberry pi and got this as a gift. I want to learn how to make this project. The words don't really mean anything to me so thats why I want a video tutorial

Adding an atenna

What is the GPIO user as antenna? I want to add antenna on my raspberry pi 2 board to be able to broadcast on longer distance.

What did you fix to get it to work on the pi 2?

Hello, this is an issue on another script called PiFox (a Narrow band FM transmitter for the 2 meter ham band for transmitter locating) , which is written for the raspberry pi, but does not work on the pi2.

What did you do to get the signal to transmit on the pi 2? I am in high school and new at programming and am wondering if you could lead me in the right direction for getting pifox to work on the 2. The contacts at pifox end are all dead, and I have tried to email several times. I hope to get it working in the next few weeks because I started an amateur radio club at my high school and I want to have a foxhunt.

Thanks,
Skyler

Stop fm_transmitter from looping same song

Hi. Great project. I have had a look through the code but I have to admit to not having a lot of experience. So, I am wondering if there is a simple flag for the command line when using this program to stop it from looping the same song over and over?

Pi 2 Compile Error

pi@raspberry ~/Music/fm_transmitter $ make
gcc -Wall -fexceptions -lpthread -lm -O3 -fpermissive -fno-strict-aliasing -c main.cpp
gcc -Wall -fexceptions -lpthread -lm -O3 -fpermissive -fno-strict-aliasing -c wave_reader.cpp
gcc -Wall -fexceptions -lpthread -lm -O3 -fpermissive -fno-strict-aliasing -c stdin_reader.cpp
stdin_reader.cpp: In constructor ‘StdinReader::StdinReader()’:
stdin_reader.cpp:57:91: warning: invalid conversion from ‘void ()(void)’ to ‘void* ()(void)’ [-fpermissive]
int returnCode = pthread_create(&thread, NULL, &StdinReader::readStdin, (void_)&params);
^
In file included from /usr/include/arm-linux-gnueabihf/c++/4.9/bits/gthr-default.h:35:0,
from /usr/include/arm-linux-gnueabihf/c++/4.9/bits/gthr.h:148,
from /usr/include/c++/4.9/ext/atomicity.h:35,
from /usr/include/c++/4.9/bits/basic_string.h:39,
from /usr/include/c++/4.9/string:52,
from error_reporter.h:37,
from stdin_reader.h:40,
from stdin_reader.cpp:34:
/usr/include/pthread.h:244:12: note: initializing argument 3 of ‘int pthread_create(pthread_t_, const pthread_attr_t_, void_ ()(void), void_)’
extern int pthread_create (pthread_t *__restrict __newthread,
^
gcc -Wall -fexceptions -lpthread -lm -O3 -fpermissive -fno-strict-aliasing -c error_reporter.cpp
gcc -Wall -fexceptions -lpthread -lm -O3 -fpermissive -fno-strict-aliasing -c transmitter.cpp
transmitter.cpp: In member function ‘void Transmitter::play()’:
transmitter.cpp:134:90: warning: invalid conversion from ‘void ()(void)’ to ‘void_ ()(void)’ [-fpermissive]
int returnCode = pthread_create(&thread, NULL, &Transmitter::transmit, (void_)&params);
^
In file included from /usr/include/arm-linux-gnueabihf/c++/4.9/bits/gthr-default.h:35:0,
from /usr/include/arm-linux-gnueabihf/c++/4.9/bits/gthr.h:148,
from /usr/include/c++/4.9/ext/atomicity.h:35,
from /usr/include/c++/4.9/bits/basic_string.h:39,
from /usr/include/c++/4.9/string:52,
from wave_reader.h:37,
from transmitter.h:37,
from transmitter.cpp:34:
/usr/include/pthread.h:244:12: note: initializing argument 3 of ‘int pthread_create(pthread_t_, const pthread_attr_t_, void_ ()(void), void_)’
extern int pthread_create (pthread_t *_restrict newthread,
^
transmitter.cpp: In destructor ‘virtual Transmitter::~Transmitter()’:
transmitter.cpp:222:35: warning: invalid conversion from ‘volatile void
’ to ‘void
’ [-fpermissive]
munmap(peripherals, 0x002FFFFF);
^
In file included from transmitter.cpp:40:0:
/usr/include/arm-linux-gnueabihf/sys/mman.h:76:12: note: initializing argument 1 of ‘int munmap(void
, size_t)’
extern int munmap (void *__addr, size_t __len) __THROW;
^
g++ -Wall -fexceptions -lpthread -lm -O3 -fpermissive -fno-strict-aliasing -o fm_transmitter main.o wave_reader.o stdin_reader.o error_reporter.o transmitter.o

interference and so lower volume

hello,
i connected the antena to the gpio 4 pin and when i'm transmitting i got so much interference and low volume

i tried with lot of frequencies but all what i listen to is statics interference and low volume it's hard to listen the song tat i'm transmitting

i used this command

ffmpeg -i opus.mp3 -f s16le -ar 22.05k -ac 1 - | sudo ./fm_transmitter -f 102.9 -
and tried this one

sox 1.wav -r 22050 -c 1 -b 16 -t wav - | sudo ./fm_transmitter -f 102.9 -

but none works(both works but with the problems that i already told in this topic)

Transmit by stdio stream

How about read from stdio stream instead of file? by do that I can transmit internet radio...

Building a Radio station

Hi Markondej,

As we all know its very hard to get FM or AM frequency and its license in any country. To get my music on air I tried finding out ways and came across Pirate radio station which is illegal. So one of my friend who follows you suggested me to get in touch with you. is there any way where you can transmit/broadcast your music without getting in trouble.

Awaiting to hear from you soon,.

Regards,
Vijay

Stdin not working

Hello, I think the stdin is not working properly.
After connecting my Android phone with the Raspberry pi 3 via bluetooth (audio enabled), I send audio by playing a Spotify song, but I cannot play it through by this command

sudo ./fm_transmitter -f 100.6 -
Playing: stdin, 44100 Hz, 16 bits, mono

Thanks in advance for the help

Sox streaming conversion from mp3 to wav hangs at end of song

Hi. I have been using sox to stream an mp3 to wav to the fm_transmitter program but the process hangs at the end of the song. I cannot figure out how to get it to continue.

I want to eventually build a web interface to play songs on the radio. I can write a shell script to play a series of songs using fm_transmitter directly with wav files. However, wav files are roughy 8x the size of an mp3 and that could eat up space quickly.

wav file shell script example:
sudo ./fm_transmitter -f 92.9 wavFile1.wav
sudo ./fm_transmitter -f 92.9 wavFile2.wav

sox/mp3 shell script:
sox ~/Music/AlbumFolder/mp3File1.mp3 -r 22050 -c 1 -b 16 -t wav - | sudo ./fm_transmitter -f 92.9 -
sox ~/Music/AlbumFolder/mp3File2.mp3 -r 22050 -c 1 -b 16 -t wav - | sudo ./fm_transmitter -f 92.9 -

These are essentially the examples you provided with your program in the README.md file. I have looked online to see if I can find an example that uses the format you have provided but have not been able to find anything yet.

high cpu usage

I'm using fm_transmitter with RPi3, its works fine! thx!

I tried to use with sox, ffmpeg, mp123 and vlc, and always fm_transmitter use ~115% of CPU, something like 100% of one core full time.

this behavior is normal?

PI crashes when I start transmission

When I start to transmit, the song plays well and entirely, but the GUI goes really weird looking, all USB powered devices are shutted off (including mouse an kboard) and if there is SSH connection, it fails immediately. I have changed the transmitting gpio to pin 40 following your instructions because the default pin is dead.

Makefile issue

In my g++ 4.8.4, the make command fails.

After studying, I changed the makefile as below -

CFLAGS = -Wall -fexceptions -O3 -fpermissive -fno-strict-aliasing
TARGET = fm_transmitter
FACEPALM = -lpthread -lm

all: main.o error_reporter.o wave_reader.o stdin_reader.o transmitter.o
        g++ $(CFLAGS) -o $(TARGET) main.o error_reporter.o wave_reader.o stdin_reader.o transmitter.o $(FACEPALM)

wave_reader.o: wave_reader.cpp wave_reader.h
        g++ $(CFLAGS) -c wave_reader.cpp $(FACEPALM)

stdin_reader.o: stdin_reader.cpp stdin_reader.h
        g++ $(CFLAGS) -c stdin_reader.cpp $(FACEPALM)

error_reporter.o: error_reporter.cpp error_reporter.h
        g++ $(CFLAGS) -c error_reporter.cpp $(FACEPALM)

transmitter.o: transmitter.cpp transmitter.h
        g++ $(CFLAGS) -c transmitter.cpp $(FACEPALM)

main.o: main.cpp
        g++ $(CFLAGS) -c main.cpp $(FACEPALM)

clean:
        rm *.o

And the make runs fine, as well as the compiled binary.

Error while opening file, data corrupted

Hey,

I noticed that whenever I tried to play a wave file, it returned the error "Error: Error while opening FV.wav, data corrupted". At first, I figured it might be an actual issue with the file and tried different ones, but every single one has returned either "unsupported WAVE format" or the data corrupted error. I check out the files myself and they do appear to be in working order. I also looked into the format and encoding.

First I did a "avconv -i" on the included sample file to find out what format was necessary. It returned:
" Stream #0.0: Audio: pcm_s16le, 22050 Hz, 1 channels, s16, 352 kb/s"
Then I converted multiple files to those exact specifications. I ran the same check on them and it returned the very same values.
"Duration: 00:04:05.52, bitrate: 352 kb/s
Stream #0.0: Audio: pcm_s16le, 22050 Hz, 1 channels, s16, 352 kb/s"

I even tried separate converters, in case this one was not up to snuff, but I got the same error every time.

Now, I would just use stdin, but the audio quality on that is way lower than when playing the sample audio directly from the file.

Improve the sound?

I think this project really great, but there is a possibility to improve the sound?
Especially on high notes, there is a very strong beep. That you can not listen ...

How to compile?

Hi,

I'm a complete Noob! However, I'm really interested in the fm_transmitter as I just got a raspberry pie 2 and would love to try a radio with my pupils. You wrote that to compile this project I can use Code::Blocks IDE (http://codeblocks.org/)... But I don't know how to do so... I downloaded Code Block... And then? What do I need to do?

Thanks a lot.

Slow motion audio!!!

Hey there! I signed up to this site just to figure out what is going on with an issue I have with your project.

When I want to transmit audio from the sound card's LINE IN, using the: (arecord -D hw:1,0 -c1 -d 0 -r 22050 -f S16_LE | sudo ./fm_transmitter -f 106.3 -) the audio being broadcasted is very slow motion audio.

I get a message when I hit that command: Warning: rate is not accurate (requested = 22050Hz, got = 44100Hz)
please, try the plug plugin
Playing: stdin, 22050 Hz, 16 bits, mono

If I keep the broadcast going, I eventually get repetitive error messages....

overrun!!! (at least 3.014 ms long)
overrun!!! (at least 3.519 ms long)
overrun!!! (at least 2.239 ms long)
overrun!!! (at least 2.768 ms long)
overrun!!! (at least 2.742 ms long)
overrun!!! (at least 3.364 ms long)
overrun!!! (at least 3.000 ms long)
overrun!!! (at least 2.617 ms long)

I am currently using the C-Media Electronics, Inc. Audio Adapter for the sound device. The OS is Raspbian Jessie (February 2016)

FC in stdin mode

When I use stdin to read audio data, program carsh frequently.
If memory fulled by cache, it crash more often.
Like this:
sox -t mp3 aaa.mp3 -r 44100 -c 1 -b 16 -t wav - | sudo ./fm_transmitter - 77.0
mpg123 -m -C -q -s aaa.mp3 | sudo ./fm_transmitter - 77.0

Could you please fix this problem?
Thanks.

very weak signal.

My signal is very week and full of static. I have a 30-40 cm antenna plugged into GPIO4. I noticed on this guys video of this project (https://www.youtube.com/watch?v=h2Z0s7_z6IM) at 0:19, I see he has stdin_reader.h and transmitter.cpp and readme.md as green (Executable or recognized data file) but when i use the command ls, my files are not green like his, only my transmitter_fm is green. Does this have something to do with the poor quality of the signal?

Just play 5 seconds or less.

hey guys, anyone having this same issue?
i send the command sudo ./fm_transmitter -f 107 -r star_wars.wav and only play for 4 or 5 seconds and goes off. what is happening?

Why playback cuts after few seconds [EXPLAINED]

When you convert anything with media.io WINDOWS APP, it doesn't fully convert - that is why it does not play it all.
However, it works when you convert it with media.io web converter. Also, you can convert it with Audacity - it works too.

How to setup fm_transmitter

I can not figure out how to setup the files and compile it! Could anyone help me out? Because the help in the README.md file does not help me at all. help!

how to read "fifo" file?

with shairport I am piping airplay out put to fifo file named "airpipe"
sudo shairport-sync -v -a testp -o pipe -- ~/airpipe
than I am starting fm_transmitter with
sudo ~/fm_transmitter_original/fm_transmitter ~/airpipe 103
and I am getting this error
Error: Error while opening /home/pi/airpipe, WAVE file expected

audio quality bad, although example-wav good

Hi! I'm trying to send my .wav-file* (which plays clearly on the jack-output) to the radio-signal, which works (the example star_wars.wav-file plays good), but I get disturbed sound on the radio: sounds distorted with noise.
sudo /home/pi/radio/fm_transmitter -f 94.0 -r /home/pi/sounds/sound.wav
I allready tried to pipe it with:
sox /home/pi/sounds/sound.wav -r 22050 -c 1 -b 16 -t wav - | sudo /home/pi/radio/fm_transmitter -f 94.0 -
But this doesn't improve it. I also tried it with omxplayer and aplay, both on RPi2 and RPi3. I also tried to convert the file with media.io as KDragonM mentioned.

  • Info of my .wav-file:
> soxi /home/pi/sounds/sound.wav 
Input File     : '/home/pi/sounds/sound.wav'
Channels       : 1
Sample Rate    : 22050
Precision      : 16-bit
Duration       : 00:09:19.72 = 12341904 samples ~ 41979.3 CDDA sectors
File Size      : 24.7M
Bit Rate       : 353k
Sample Encoding: 16-bit Signed Integer PCM

Please help me, get -more or less- clean radio-signal of my .wav-file! (Like I said, star_wars.wav plays good.)

  • Info of the star_wars.wav:
> soxi /home/pi/radio/star_wars.wav 
Input File     : '/home/pi/radio/star_wars.wav'
Channels       : 1
Sample Rate    : 22050
Precision      : 16-bit
Duration       : 00:02:20.00 = 3087000 samples ~ 10500 CDDA sectors
File Size      : 6.17M
Bit Rate       : 353k
Sample Encoding: 16-bit Signed Integer PCM

mmap error

Cannot obtain access to peripherals (mmap error)
I am using an Asus Tinkerboard, (Asus Pi)
even under sudo I get this. The command I give is:
sudo ./fm_transmitter -f 100.0 -r Aglass.mp3

in source: this traces back to:
peripherals = mmap(NULL, 0x002FFFFF, PROT_READ | PROT_WRITE, MAP_SHARED, memFd, isBcm2835 ? 0x20000000 : 0x3F000000);
close(memFd);
if (peripherals == MAP_FAILED) {
throw ErrorReporter("Cannot obtain access to peripherals (mmap error)");
}

I will look into the source...

Does USB sound card Line Out work for transmitting

The readme wasnt entirely clear on USB sound card. Can you use the line out of a USB sound card to transmit instead of a gpio? I do not want to record from a microphone, rather i want to play a sound file. Is this possible?? Thanks.

Loop and playing playlists

Hello,I'm very new to this so idk how to put this in words properly but is there a way to tell the program to play 2-3 songs on loop without any additional code?

Can not change the frequency

Hi guys!
Currently, I can not change the broadcast frequency.
First, I used command sudo ./fm_transmitter [-f 100] [-r] filename to play a song in 100Mhz then I ctrl+C to stop it.
I used another command sudo ./fm_transmitter [-f 85.5] [-r] filename to play the song in different frequency but it did not change. The song still stayed in old frequency 100Mhz.

What I am supposed to do guys? I'm just a newbie in Linux as well as Raspberry. Any suggestion would be appriciated.

does not transmit for duration of file

On my Pi 2 ,it seem to work for a few (no set number) seconds then the broadcast stops, even though the file is still being read/processed (and obviously much longer than a few seconds)

Adding an atenna

What is the GPIO used as antenna? I want to add antenna on my raspberry pi 2 board to be able to broadcast on longer distance.

Does not stop transmitting after shutting down

I've seen this reported in other RPI FM transmitter variants also, where after shutting down the process using Ctrl+C, the process shuts down but the (blank/silent) transmissions continue until you either reboot the RPI, or run the following python script:

import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
GPIO.setup(7, 0)
GPIO.cleanup()

Thankfully (in some sort of weird way) the spurious harmonics produced by not having a LPF alerted me when they started keying up my cross-band repeater. Otherwise these transmissions would have continued on. I also verified this behavior while watching the spectrum on the RTLSDR.

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.