|
From: isikistanbul <isi...@ho...> - 2015-12-10 15:07:38
|
It is a project for an exhibition with raspberry pi. my main goal is to combine a repeated wav file with the microphone (in this case a samson meteorite). So when someone who visits the exhibition comes near the installation, his/her sound will get mixed with the sound file with a 3 second delay. I tried setting the buffersize and making it -single--threaded after I started getting alsa underruns. I used trim so that the running of the mic and the wav file will stop when the size of the wav file is reached. and repeat it again and again. killall -9 sox was a bad idea, I was trying different settings to see what was going on. " Shell question: did the ^C kill just the running sox process (and so killall has nothing to kill, hence the error message), or did it kill the while loop? " yes, this is right. So, this is the last script I tried and took an output of. #!/bin/bash while test -f /media/NASDRIVE2/bow.wav do sox -m --input-buffer 512 --single-threaded -r 48000 -t alsa hw:1,0 /media/NASDRIVE2/bow.wav -t alsa hw:0,0 trim 0 364 delay 3 0 sleep 4 done and here is output where it started failing. n:92.3% 00:05:36.04 [00:00:27.96] Out:16.1M [ -==|== ] Clip:0 sox WARN alsa: under-run In:93.8% 00:05:41.33 [00:00:22.67] Out:16.4M [ |=- ] Clip:0 sox WARN alsa: under-run In:94.0% 00:05:42.19 [00:00:21.81] Out:16.4M [ -=|=== ] Clip:0 sox WARN alsa: under-run In:97.4% 00:05:54.65 [00:00:09.35] Out:17.0M [ =|=- ] Clip:0 sox WARN alsa: under-run In:97.5% 00:05:54.99 [00:00:09.01] Out:17.0M [ | ] Clip:0 sox WARN alsa: under-run In:97.6% 00:05:55.33 [00:00:08.67] Out:17.1M [ |- ] Clip:0 sox WARN alsa: Input/output error In:97.6% 00:05:55.33 [00:00:08.67] Out:17.1M [ |= ] Clip:0 sox WARN alsa: over-run In:97.7% 00:05:55.58 [00:00:08.42] Out:17.1M [ |- ] Clip:0 sox WARN alsa: Input/output error In:97.7% 00:05:55.67 [00:00:08.33] Out:17.1M [ -|- ] Clip:0 sox WARN alsa: over-run In:97.8% 00:05:55.93 [00:00:08.07] Out:17.1M [ -| ] Clip:0 sox WARN alsa: Input/output error In:97.8% 00:05:56.01 [00:00:07.99] Out:17.1M [ -=|- ] Clip:0 sox WARN alsa: over-run In:97.9% 00:05:56.27 [00:00:07.73] Out:17.1M [ -=|- ] Clip:0 sox WARN alsa: Input/output error In:97.9% 00:05:56.35 [00:00:07.65] Out:17.1M [ -=|- ] Clip:0 sox WARN alsa: over-run In:98.0% 00:05:56.61 [00:00:07.39] Out:17.1M [ -=| ] Clip:0 sox WARN alsa: Input/output error In:98.0% 00:05:56.69 [00:00:07.31] Out:17.1M [ ==| ] Clip:0 sox WARN alsa: over-run In:98.1% 00:05:56.95 [00:00:07.05] Out:17.1M [ ==| ] Clip:0 After 3 hours or so, I start getting over-run and Input/output error and ends abruptly. -- View this message in context: http://sox.10957.n7.nabble.com/infinite-while-loop-with-m-function-tp5590p5595.html Sent from the SoX mailing list archive at Nabble.com. |