PiFmAdv icon indicating copy to clipboard operation
PiFmAdv copied to clipboard

Piping problem with cheap USB Sound card

Open StoneSet opened this issue 6 years ago • 3 comments

Hello, I have some issue using a pipe with PiFmAdv, however I do not find this issue with PiFmRds. When I execute the command: sudo arecord -fS16_LE -r 44100 -Dplughw: 1.0 -c 2 - | sudo / home / pi / PiFmAdv / src / pi_fm_adv --freq 105.10 --audio - no error but the program cuts off just after starting it. image Same without pipe : sudo /home/pi/PiFmAdv/src/pi_fm_adv --freq 105.10 --audio /home/pi/cc.wav --ps ST-PIFM --rt 'St-PIFM RADIO' --mpx 70 --power 7 --gpio 4 --preemph 'eu'

Regards, Thanks

(In pifmrds : sudo arecord -fS16_LE -r 44100 -Dplughw:1,0 -c 2 - | sudo /home/pi/PiFmRds/src/pi_fm_rds -freq 105.10 -audio -)

StoneSet avatar Jan 28 '19 23:01 StoneSet

The way pipes are handled is not good. If there is an under-run the pipe needs to be opened again by pifm, but it can't because the pipe is opened outside of the main loop. I'm currently working on some modifications to improve this, but I haven't got much spare time to do it.

ghost avatar Jan 29 '19 09:01 ghost

I'm also having a similar problem with the latest version. This also seems to be happening using standard wav files, such as: sudo ./pi_fm_adv --audio sound_22050.wav

Niall7459 avatar Feb 12 '19 09:02 Niall7459

It has a random chance of working. 6/10 times it doesn't. For audio streams its more like a 1/10 it will even begin to work. But at some point it get cuts off.

Niall7459 avatar Feb 12 '19 09:02 Niall7459