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

Takashi Iwai tiwai at suse.de
Thu Nov 20 10:58:29 CET 2014


At Wed, 19 Nov 2014 21:50:30 +0200,
Jussi Laako wrote:
> 
> Hi,
> 
> Sorry for catching up late on this patch...
> 
> On 10.09.2014 10:00, Jurgen Kramer wrote:
> > +	FORMATD(DSD_U32_LE, "Direct Stream Digital, 4-byte (x32), little endian, oldest bits in MSB"),
> 
> There is bug in this patch. The spec for these formats is, as above says 
> "little endian, oldest bits in MSB", however with the iFi iDSD Nano this 
> doesn't seem to be the case. Oldest bits are in MSB of the byte, but 
> byte order is big endian.

Is it a bug of spec, or a bug of device?
In the latter case, we'd need to introduce DSD_U32_BE format and apply
a quirk, for example.


Takashi

> IOW, following alone will produce incorrect 
> output:
> 
> size_t N = 32;
> uint32_t x = 0;
> while (N--)
> {
> 	x <<= 1;
> 	x |= nextbit;
> }
> 
> But if you add __builtin_byteswap32(x) then the output is correct.
> 
> I guess this has not been caught because of just memcpy()'ing the 
> oldest-bit-in-MSB byte stream to the sample buffer instead of 
> constructing the words...
> 
> 
> Best regards,
> 
> 	- Jussi
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 


More information about the Alsa-devel mailing list