ChristopheJacquet / PiFmRds

FM-RDS transmitter using the Raspberry Pi's PWM
GNU General Public License v3.0
1.44k stars 331 forks source link

Mpd pipe problem #11

Open T4d3o opened 10 years ago

T4d3o commented 10 years ago

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

SonnyJim commented 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

T4d3o commented 10 years ago

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.

SonnyJim commented 10 years ago

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 -

T4d3o commented 10 years ago

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

SonnyJim commented 10 years ago

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

ghost commented 9 years ago

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

ghost commented 9 years ago

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

ghost commented 9 years ago

@Hatagashira thanks.

billporte commented 8 years ago

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"

}