[alsa-devel] [PATCH] pcm: add new 32-bit DSD sample format

Jussi Laako jussi at sonarnerd.net
Thu Nov 20 20:07:06 CET 2014


On 20.11.2014 18:34, Jurgen Kramer wrote:
> DSD is a bit odd wrt LE/BE. Both formats are allowed and used.
> The device (XMOS based/Marantz+Denon) want the following order of
> samples:
> L1 L2 L3 L4 R1 R2 R3 R4. Where Lx/Rx are 8-bit DSD samples, L1-L4 are
> packed to 1 32-bit sample.

What you described is precisely interleaved big endian U32 sample 
format. L1 is the MSB byte and L4 is the LSB byte of big-endian U32.

So "L1 L2 L3 L4" is equal to DSD_U32_BE. The currently advertised 
DSD_U32_LE would be "L4 L3 L2 L1".

> I do think real BE will not work.

Why? Your description precisely matches U32_BE. And seems to work 
correctly for me...

Constructing the U32 by having oldest bit in MSB and newest bit in LSB 
and sending it out as little-endian results in incorrect output. Adding 
byteswap to big-endian format results in correct output (either using 
__builtin_byteswap32() or htonl()).


	- Jussi


More information about the Alsa-devel mailing list