Comments (14)
Same problem here, looking for a solution.. Tried to change
return -1; to // return -1;
// fm_mpx.c
// Line 178
if(audio_len == 0) {
if( sf_seek(inf, 0, SEEK_SET) < 0 ) {
fprintf(stderr, "Could not rewind in audio file, terminating\n");
return -1;
}
But that was not the solution..
from pifmrds.
I found a kindaish solution..
It prebuffers the audio trough mpg123, then sox reads it as raw audio and outputs it as wav to PFR
mpg123 --buffer 2048 --no-icy-meta -q -s http://172.30.0.62:5010/ | sox -t raw -b 16 -e signed -c 2 -r 44100 - -t wav - equalizer 11800 0.7q 20 | sudo ./pi_fm_rds -rt 'Test FM 105.5' -pi 0528 -ps 'TEST FM' -freq '105.5' -ctl '/home/pi/rds_ctl' -audio -
from pifmrds.
i fixed it and made a pull request.
from pifmrds.
@RamonSmit could you please elaborate a little more on your kindaish solution, does this mean a full fix? Kindaish solution, how does it help in comparison to it breaking? and @Hatagashira How did you fix it? Where is your solution? Please share :-)
from pifmrds.
@danielmoore123
This is how i fixed it: https://github.com/ChristopheJacquet/PiFmRds/pull/23/files
You can get it here: https://github.com/Hatagashira/PiFmRds/tree/patch-1
from pifmrds.
My fix is more like a hotfix. It prรฉbuffers the raw audio
I see that @Hatagashira got a better fix, I would stick to that ๐
from pifmrds.
Hmmmm... Sorry guys, neither of those solutions are working.... is there a way to get it to start itself again automatically? If I press Up then enter it works again, I was just wondering if that could be automated or if the program can auto restart itself on failure?
from pifmrds.
@danielmoore123 Since ChristopheJacquet has fixed a few bugs, updated some code and added pi2 support i'll attempt a new fix. Just... don't use an antenna unless you're in the middle of nowhere, the harmonics are dreadful.
from pifmrds.
@danielmoore123 I too experience the dreaded "cannot rewind audio input" issue while streaming from sox.
To work around this I run the pipeline from shell script which just continually loops, e.g. in a file called xmit.sh (for example) put:
#!/bin/sh
FX='equalizer 100 50 -10 equalizer 5k 2k 0.5 compand 0.3,1 6:-70,-60,-20 -5 -65 0.2'
FREQ=107.9
while [ 1 ]
do
sox -V3 -t ogg http://airtime.jda.local:8000/airtime_128 -t wav - $FX | ./pi_fm_rds -freq $FREQ -pi FFFF -ps "HELLO" -rt "TEST" -audio -
done
Then if you chmod +x xmit.sh you can run ./xmit.sh (or sh xmit.sh) and when PiFmRds crashes out it goes back to the beginning of the loop.
It does take a while to come back again, but at least you'll find it still running in the morning :-)
from pifmrds.
@btweb 's solution is the cleanest for now unless you edit the program to add an extra switch that tells it to never stop and just retry opening the file handle when the stream ends, feeding the modulator silence in the meantime so the RDS data continues to be generated.
My old patch is no longer relevant because @ChristopheJacquet fixed the carrier wave problem. I'll make the patch when i have time... and if i don't forget ๐
from pifmrds.
Glad I posted that... I lost my SD card shortly after ;-)
from pifmrds.
@RamonSmit your solution works well , but the code should be like this
mpg123 -y --stereo -r 44100 --buffer 4096 --no-icy-meta -q -s "$filename"| sox -v $vol -t raw -b 16 -e signed -c 2 -r 44100 - -t wav - equalizer 11800 0.7q 20 | sudo ./pi_fm_rds -rt 'Test FM 105.5' -pi 0528 -ps 'TEST FM' -freq '105.5' -ctl '/home/pi/rds_ctl' -audio -
--stereo -r 44100
should be added to play mono music , or it will play at twice speed.
from pifmrds.
@btweb 's solution fixed it. As soon as it dies it comes back! One thing I will say, it failed at first but then I had to wipe my Pi and re-install the program and then this neat little trick worked, it didn't work though on piping from the Aux lead but via URL is fine.
from pifmrds.
To work around this I run the pipeline from shell script which just continually loops
How do you do this? I get everything running awesome for 3 hours running this...
mpg123 -y --stereo -r 44100 -b 16384 -q -s -Z -i /home/pi/Music/* | sox -v 1.5 -t raw -b 16 -e signed -c 2 -r 44100 - -t wav - equalizer 11800 0.7q 20 | sudo /home/pi/PiFmRds/src/pi_fm_rds -rt 'Radio For Your Butthole' -pi 0528 -ps 'WFTW' -freq '107.9' -audio -
I'm a Linux noob, but catching on quickly. I wish we could just run without sox.
from pifmrds.
Related Issues (20)
- What Antenna do i get for a raspberry 3 B+. Please Help HOT 1
- Can I stream RDS to external FM+RDS transmitter? HOT 1
- Make file is making error HOT 1
- just blocking HOT 2
- Make doesn't make a nothing HOT 9
- Doesn't compile! HOT 3
- cant pipe audio on pi4 using pulseaudio HOT 1
- Gives error when i use the make command HOT 4
- While compiling I get this soxr.h missing HOT 1
- Support for non-ASCII characters (RDS codes > 0x80) HOT 3
- Hardware related issue with additional FM transmitter HOT 7
- compile issue HOT 2
- Audio too slow HOT 2
- Instant crash on launch on Pi 4 HOT 5
- Mp3 to Wav converter HOT 1
- lack fpu HOT 4
- hi! Could you also make it pi5 compatible too? HOT 5
- Audio signal loss during mouse inactivity with pifmrds on Raspberry Pi 4 HOT 1
- Make Raspberry Pi 5 (GPIO23) Compatible HOT 2
- 19k Signal and Increasing RDS Power HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pifmrds.