The programs aplay and arecord are example programs that use the ALSA API for audio playback and recording. (They are actually the same program that detects which name is used to run it.) The source code can be a good reference when implementing custom ALSA applications. The programs themselves can be useful in testing ALSA drivers during development. For basic tests, each program can be run individually to test either playback or recording. They can also be run simultaneously. For driver testing, debugging tools can be used or prints can be added to the Linux driver that will give detailed information about what is happening in the code. Then aplay and/or arecord can be run in the system and the results logged. If there are bugs, the debugging tools and prints should help find them. Both aplay and arecord have numerous command line options to control which ALSA device is used and how that device is configured. The correct configuration will depend on the application. Both programs can use either stdio or files for audio input and output. Standard file formats such as .wav can be used for audio files. The following example shows playing a .wav file and recoding to a .wav file: aplay <options> audio.wav arecord <options> audio.wav When running both simultaneously, either loopback or two separate files can be used. Loopback can be useful because it gives immediate feedback about if both playback and record are working properly. The following example can be used for loopback: arecord <options> | aplay <options> Using two separate files requires running one or both programs in the background. This can be done with a shell script. The script can start both in the background then run an infinite loop. In this setup, Ctrl-C on the script will end both programs.