Then the script never runs
For more information, I have reduced the script to something more simple:
Code: Select all
arecord -D "$(audio_src)" -f S32_LE -r 96000 -c 2 --buffer-size 2048 | aplay >> /tmp/arif 2>&1
echo "" >> /tmp/arif
`audio_src` is a function that extracts "hw:2,0" (correctly) from a given name
This is the error that gets logged
Code: Select all
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory
interesting how many times that event is fired, although that is fine, but also curious that the two lines, although being one after the other in the bash script, do not occur in serial in the logs, thus suggesting that the order of operations is non-deterministic. There are race conditions.
Anyway, for this simple case it should not matter