Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: firewire-motu: fix construction of PCM frame for capture direction

In data blocks of common isochronous packet for MOTU devices, PCM
frames are multiplexed in a shape of '24 bit * 4 Audio Pack', described
in IEC 61883-6. The frames are not aligned to quadlet.

For capture PCM substream, ALSA firewire-motu driver constructs PCM
frames by reading data blocks byte-by-byte. However this operation
includes bug for lower byte of the PCM sample. This brings invalid
content of the PCM samples.

This commit fixes the bug.

Reported-by: Peter Sjöberg <autopeter@gmail.com>
Cc: <stable@vger.kernel.org> # v4.12+
Fixes: 4641c9394010 ("ALSA: firewire-motu: add MOTU specific protocol layer")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Takashi Sakamoto and committed by
Takashi Iwai
f97a0944 7dc661bd

+3 -1
+3 -1
sound/firewire/motu/amdtp-motu.c
··· 136 136 byte = (u8 *)buffer + p->pcm_byte_offset; 137 137 138 138 for (c = 0; c < channels; ++c) { 139 - *dst = (byte[0] << 24) | (byte[1] << 16) | byte[2]; 139 + *dst = (byte[0] << 24) | 140 + (byte[1] << 16) | 141 + (byte[2] << 8); 140 142 byte += 3; 141 143 dst++; 142 144 }