2

I am looping the "PCM audio in" to the "PCM audio out" on a Sound Blaster USB card using the following command:

arecord -q -f S16_LE -r 48000 -c 2 -D dsnoop:HD | aplay -q -D plughw:HD

It works fine, but only for about three hours. The command is in a while loop which restarts it when it stops and also records the time at which the command is restarted. It has run for the following lengths of time:

h m s

03:06:48

03:06:27

03:06:27

03:06:26

About 11,187 seconds, give or take. These seem too similar to be the result of a random fault. The man pages for aplay and a record say that a duration of 0 means infinity.

Any suggestions as to why it stops reliably after 3hr 6min and 27seconds?

0

.wav files have a 2 GB size limit.

Use -t raw instead:

arecord -q -f dat -t raw -D dsnoop:HD | aplay -q -f dat -t raw -D plughw:HD
  • That fixed it. Its been going for over 5 hours now. Although 11187 sec * 48000 s/sec * 2 channels * 2 bytes/sample = 2.147 MB so out by 2 somewhere. On re-reading the man page perhaps --max-file-time may also have worked. Well spotted, many thanks. – Ian Davidson Aug 23 '18 at 1:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.