Simple recordings using arecord/aplay

 

Simple recordings using arecord/aplay

Recording/playback with the DAC+ ADC boards is handled – as with every HiFiBerry sound card – by the ALSA sound subsystem of Linux. There is one important hardware limitation of the Raspberry Pi: As there is only one sound interface, recording and playback always need to use the same settings. This can be problematic if your have a program running in background that uses the sound card for music playback and you want to record with other settings. Often you might not even know what settings other programs are using.
Therefore, we recommend to stop any process that might be using the sound card before starting with record playback tests.

You need to use one of the S16_LE or S32_LE sample formats.

If you’re testing this with HiFiBerryOS, make sure that “Analogue input” is disabled.

Here are some simple command lines showing how to record and play back a test sample (the file that is stored is called “1”)

Use CD quality (44.1kHz/16bit)

arecord -f cd -d 10 1; sleep 1; aplay 1

96kHz/32bit

arecord -f S32_LE -r 96000 -c 2 -d 10 1; sleep 1; aplay 1

Last updated: April 14, 2020