GithubHelp home page GithubHelp logo

Comments (14)

RamonSmit avatar RamonSmit commented on May 9, 2024

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.

RamonSmit avatar RamonSmit commented on May 9, 2024

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.

 avatar commented on May 9, 2024

i fixed it and made a pull request.

from pifmrds.

danielmoore123 avatar danielmoore123 commented on May 9, 2024

@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.

 avatar commented on May 9, 2024

@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.

RamonSmit avatar RamonSmit commented on May 9, 2024

@danielmoore123

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.

danielmoore123 avatar danielmoore123 commented on May 9, 2024

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.

 avatar commented on May 9, 2024

@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.

btweb avatar btweb commented on May 9, 2024

@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.

 avatar commented on May 9, 2024

@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.

btweb avatar btweb commented on May 9, 2024

Glad I posted that... I lost my SD card shortly after ;-)

from pifmrds.

WangZhengmao avatar WangZhengmao commented on May 9, 2024

@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.

danielmoore123 avatar danielmoore123 commented on May 9, 2024

@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.

cusomancuso avatar cusomancuso commented on May 9, 2024

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)

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.