Open T4d3o opened 10 years ago
Yeah I'm trying similar, but using a named pipe and it fails as soon as I start playing something in MPD: sudo ./pi_fm_rds -freq 107.9 -audio /tmp/mpd.fifo Virtual memory mapped at 0xb6854000 ppm corr is 0.0000, divider is 1096.4912 (1096 + 2012*2^-12) [nominal 1096.4912]
As soon as I press play I get this: Error: could not open input file /tmp/mpd.fifo
Hi. The problem is MPD send RAW PCM data... without headers and PiFmRds fails . This path https://github.com/T4d3o/PiFmRds/commit/e814c5004590d99b7dc6a4132c9cdc0b52bf5d02 work for pipe, you can adapt it to fifo.
Also I say fifo option has very low performance, I tried it when I had microcuts in sound.
No, I think there is a different problem here. I've managed to get something working by using SoX:
sox -t raw -b 16 -e unsigned-integer -r48000 /tmp/mpd.fifo -t wav - | sudo ./pi_fm_rds -freq 107.9 -audio -
Sox send headers... Anyway you can find out for sure printing the error puttind this between fprintf and return -1 in line 105 of fm_mpx.c: printf("%s", sf_strerror(inf));
Ah right you are, I was thinking it was some kind of problem with sf_open_fd() not supporting pipes properly
@T4d3o do you still have the patch? Sox doesn't work for me.
@CelestialWalrus I made a patch that basically does what @T4d3o 's patch did, but made it an optional argument.
@Hatagashira thanks.
Solved Without patch : audio_output { type "pipe" name "PiFm"
command "sox -traw -esi -b32 -c2 -r44100 - -t wav - | sudo /home/pi/PiFmRds/src/pi_fm_rds -audio -"
format "44100:32:2"
}
hi, I'm having trouble setting a pipe pifm_rds mpd, this is the configuration I'm using
audio_output { type "pipe" name "FM_fifo"
path "/tmp/mpd.fifo"
}
Using first command works ok, but second command hangs the PI. i dont know if i'm doing something wrong.
Sorry my english