On Thu, 09 Jun 2016 13:38:19 +0200, Ihar Filipau wrote:
Hi All!
When using the dmix on ARM, the sound comes out garbled, with as if overlapping, increasing-in-number echoes. That happens even with a single aplay instance.
In a forum discussion, it was suggested that ARM lacks optimized dmix implementation. But that implies that the generic dmix code is broken, since it is what is used on ARM/etc, but not on i386/amd64. (The forum discussion about my particular issue: http://unix.stackexchange.com/questions/288451/sound-corruption-echo-when-tr... )
Does anybody has any suggestions how to fix/avoid the dmix issue on ARM?
Thanks.
P.S. Versions: Linux v3.18.24, alsa-lib/-utils v1.0.29. The hardware: FreeScale i.MX35 (ARM1136) with SGTL5000 sound chip (used in 48KHz mode).
P.P.S. The generic code has outdated functions for the "concurrent" implementation with cmpxchg. The code probably could be updated, and revised to use the C11's stdatomic.h when available.
This is likely the cache coherency issue. For example, the generic dmix code works fine on x86-64 if I modify the ifdef condition (I tested now).
I suppose the mmap support is broken with your device / driver. Does "aplay -Dhw -M --period-size=1024 somefile.wav" work? This should show a similar problem.
Takashi