On an embedded system, I have discovered that only one application can use the sound card simultaneously. To my limited knowledge, to solve the issue, the ALSA provides the
dmix plug-in to perform the mixing in the user-space, and thus to allow multiple applications to share the sound card.
While trying to figure out how to use the
dmix, I have stumbled on an issue. When playing an audio file (stereo, 16-bit, 44.1KHz), the audio as if overlapping with itself, in a weird echo effect, with the number of echos growing as a snowball further down the playback time. (Already 10 seconds into playback, the sound "intensifies" to the point where I have to stop it for fear of permanent damage to the speaker.)
From my perception, only the first second of audio is played back normally, and the weirdness starts around the second second. I have tried to tune the buffering settings of
aplay to no avail: the effect is not related to the buffering.
But this displays the weird echo effect:
aplay -Dplug:dmix /mnt/annie-honestly.wav
I have tried to google the issue up, but I'm not even sure how to call the effect/problem, and I found nothing in the flood of the other ALSA problems.
P.S. Linux v3.18.24, ALSA-lib/-utils v1.0.29. The hardware: FreeScale i.MX35 with the SGTL5000 sound chip (used in 48KHz mode).