News for hackers. Stuff that matters.
Re:Pipes and Filters by jstsch on Tuesday September 16, 2014 @07:56PM (#8327758)
Another fun trick, by piping through dd you can add a buffer between processes.

Example: the raspberry pi has pretty slow SD performance and the USB bus can get hogged. If you record audio and want to encode + write it to SD you can easily get buffer overruns. Easily solved by a 10sec buffer between arecord and flac in my case.

Re:Pipes and Filters by icebraining on Wednesday September 17, 2014 @05:44AM (#8329267)
There's also buffer(1). I found it because it never occurred to me to use dd for that! Nice tip.

http://linux.die.net/man/1/buffer

Re:Pipes and Filters by netghost on Tuesday September 16, 2014 @11:38PM (#8328445)
So what would that look like? Makes sense, but dd has a lot of options, and I haven't fiddled with it much.
Re:Pipes and Filters by jstsch on Wednesday September 17, 2014 @03:51AM (#8328971)
Recording 48Khz, raw, piping through a five second buffer, encode to flac and dump on a USB stick:

  arecord -D hw:1,0 -v --fatal-errors --buffer-size=192000 -f dat -t raw | dd bs=480000 | flac --endian=little --channels=2 --bps=16 --sample-rate=48000 --sign=signed -o /mnt/usbstick/`date '+%s'`.flac -
Gotta love Linux :)
Re:Pipes and Filters by morenoh149 on Tuesday September 16, 2014 @07:58PM (#8327765)
that's insanely cool. I would have probably spent a lot of time implementing the buffer in software.