PiFmRds icon indicating copy to clipboard operation
PiFmRds copied to clipboard

Mpd pipe problem

Open T4d3o opened this issue 10 years ago • 9 comments

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" #command "/root/pifm/pifm - 88.2 44100 2" command "/root/pifm/pi_fm_rds -freq 88.3 -ps PiFM -rt Hola -audio -" format "44100:16:2" }

Using first command works ok, but second command hangs the PI. i dont know if i'm doing something wrong.

Sorry my english

T4d3o avatar Aug 22 '14 18:08 T4d3o

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

SonnyJim avatar Nov 03 '14 18:11 SonnyJim

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.

T4d3o avatar Nov 03 '14 18:11 T4d3o

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 -

SonnyJim avatar Nov 03 '14 18:11 SonnyJim

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));

T4d3o avatar Nov 03 '14 19:11 T4d3o

Ah right you are, I was thinking it was some kind of problem with sf_open_fd() not supporting pipes properly

SonnyJim avatar Nov 03 '14 19:11 SonnyJim

@T4d3o do you still have the patch? Sox doesn't work for me.

ghost avatar Jan 09 '15 09:01 ghost

@CelestialWalrus I made a patch that basically does what @T4d3o 's patch did, but made it an optional argument.

ghost avatar Feb 22 '15 19:02 ghost

@Hatagashira thanks.

ghost avatar Feb 22 '15 19:02 ghost

Solved Without patch : audio_output { type "pipe" name "PiFm" #command "sudo /home/pi/PiFmRds/src/pi_fm_rds -audio -" command "sox -traw -esi -b32 -c2 -r44100 - -t wav - | sudo /home/pi/PiFmRds/src/pi_fm_rds -audio -" format "44100:32:2" }

billporte avatar Jan 09 '16 21:01 billporte