BUG: aplay (arecord) vu-meter overwrites /dev/null
Clemens Koller
clemens.ml at gmx.net
Mon May 25 16:53:19 CEST 2020
Hello!
I am using the vu-meter of arecord v1.2.2 for monitoring remote computers audio input, which is usually (according to web search) done as:
$ arecord -f S16_LE -r 44100 -c 2 --vumeter=stereo /dev/null
This command was run as root, which is obviously not good, but still... every once in a while, I ran into some state, where /dev/null gets overwritten with (corrupted) audio data immediately upon start or after a long time (i.e. when max_filesize is reached).
I would expect that this is not the desired behaviour.
I was reading some code at: https://github.com/alsa-project/alsa-utils/blob/master/aplay/aplay.c#L3152
So I guess I could use:
$ arecord -f S16_LE -r 44100 -c 2 --vumeter=stereo - /dev/null
instead. But I am still not sure not to corrupt /dev/null when
* max_filesize is reached or
* we get a SIGUSR1 which will trigger recycle_capture_file
Can somebody shed some light on how this is supposed to work? This code is very old and the documentation is still missing some bits and pieces there.
There are also some commits trying to fix this behaviour - i.e.
https://github.com/alsa-project/alsa-utils/commit/85827fbb642463ab724a9471a7a88f93fa2a217d
I am able to assist with further debugging if necessary or dig deeper into the code. But I am not too familiar with this grown piece.
Thank you very much!
Clemens Koller
More information about the Alsa-devel
mailing list