audio redirection into fifo
by kzo81 from LinuxQuestions.org on (#4S5F8)
Hi,
I'd like to stream and record at the same time on my laptop, first I'd devide the audio to 2 fifos:
Code:#!/bin/bash
rm -rf /tmp/streaming 2 >/dev/null && mkfifo /tmp/recording 2 >/dev/null
rm -rf /tmp/recording 2 >/dev/null &&mkfifo /tmp/recording 2 >/dev/null
arecord -c 2 -f S16_LE -r 48000 | ffmpeg -i - -f wav pipe:3 -f wav pipe:4 3> /tmp/recording 4> /tmp/streaming &Here is my only working solution, but it has way to much overhead, it consumes the CPU cores:
https://pastebin.com/mub4HCjM
and than I would test the fifos one-by-one:
Code:cat /tmp/recording_fifo > arecord -c 2 -f S16_LE -r 48000 -d 10 /mnt/data/recordings/2019-10-09/recording_fifo_test.wavI got this error: -sh: arecord: Text file busy
Could you please help me a bit?


I'd like to stream and record at the same time on my laptop, first I'd devide the audio to 2 fifos:
Code:#!/bin/bash
rm -rf /tmp/streaming 2 >/dev/null && mkfifo /tmp/recording 2 >/dev/null
rm -rf /tmp/recording 2 >/dev/null &&mkfifo /tmp/recording 2 >/dev/null
arecord -c 2 -f S16_LE -r 48000 | ffmpeg -i - -f wav pipe:3 -f wav pipe:4 3> /tmp/recording 4> /tmp/streaming &Here is my only working solution, but it has way to much overhead, it consumes the CPU cores:
https://pastebin.com/mub4HCjM
and than I would test the fifos one-by-one:
Code:cat /tmp/recording_fifo > arecord -c 2 -f S16_LE -r 48000 -d 10 /mnt/data/recordings/2019-10-09/recording_fifo_test.wavI got this error: -sh: arecord: Text file busy
Could you please help me a bit?