QuickPrototype
QuickPrototype

Reputation: 883

Keeping Named Pipes Running

I am running a Raspberry Pi with Jessi Lite. I have created a named pipe

mkfifo soundpipe 

and I send my audio capture to the pipe:

arecord -f S16_LE -c1 -r48000 -t wav -D hw:1,0 > soundpipe

In a new terminal I then consume sound from this pipe

cat soundpipe | lame -m m -f -b 32 - "/home/pi/arecordings/test.mp3"

When I press ctrl+c in the terminal running the "cat" command then the arecord process (thats writting the pipe) stops. Why is this process stopping and how do I keep it always running?

Thanks.

Upvotes: 0

Views: 153

Answers (1)

dan4thewin
dan4thewin

Reputation: 1184

The writer is blocking because there is no reader for the named pipe.

If you need it to run continuously, you'll have to have a program continuously read the pipe, or use something other than a named pipe.

Upvotes: 1

Related Questions