In the case of the sum buffer being uninitialized, the source sample
must be negated not only when writing to the sum but also when writing
to the destination.
i386/x86_64 alsa-lib may need to handle big-endian formats, e.g.
when running via qemu on PPC. The generic dmix code already has
both endian support, so let's use it as fallback.
Here's a patch for generic dmix which fixes S16 byte swapping.
Tested on powerpc with snd-usb-audio. (Without the patch I get crackling.)
Signed-off-by: Juergen Kreileder <jk@blackdown.de>
Add to the dmix plugin support for the S24_3LE sample format which is
used by 24-bit USB devices.
The optimized assembler version uses only 23 bits for sample data so
that the lowest bit can be used for synchronization because there is no
24-bit cmpxchg instruction.
Support dmix on generic architectures without atomic operations but
using a semaphore to avoid concurrent accesses. This is less effective
than atomic operations but should work on every system.