]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.20.17/alsa-firewire-motu-fix-construction-of-pcm-frame-for-capture-direction.patch
Linux 4.20.17
[thirdparty/kernel/stable-queue.git] / releases / 4.20.17 / alsa-firewire-motu-fix-construction-of-pcm-frame-for-capture-direction.patch
CommitLineData
95777e06
GKH
1From f97a0944a72b26a2bece72516294e112a890f98a Mon Sep 17 00:00:00 2001
2From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
3Date: Tue, 26 Feb 2019 13:38:37 +0900
4Subject: ALSA: firewire-motu: fix construction of PCM frame for capture direction
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
10
11commit f97a0944a72b26a2bece72516294e112a890f98a upstream.
12
13In data blocks of common isochronous packet for MOTU devices, PCM
14frames are multiplexed in a shape of '24 bit * 4 Audio Pack', described
15in IEC 61883-6. The frames are not aligned to quadlet.
16
17For capture PCM substream, ALSA firewire-motu driver constructs PCM
18frames by reading data blocks byte-by-byte. However this operation
19includes bug for lower byte of the PCM sample. This brings invalid
20content of the PCM samples.
21
22This commit fixes the bug.
23
24Reported-by: Peter Sjöberg <autopeter@gmail.com>
25Cc: <stable@vger.kernel.org> # v4.12+
26Fixes: 4641c9394010 ("ALSA: firewire-motu: add MOTU specific protocol layer")
27Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
28Signed-off-by: Takashi Iwai <tiwai@suse.de>
29Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
30
31---
32 sound/firewire/motu/amdtp-motu.c | 4 +++-
33 1 file changed, 3 insertions(+), 1 deletion(-)
34
35--- a/sound/firewire/motu/amdtp-motu.c
36+++ b/sound/firewire/motu/amdtp-motu.c
37@@ -136,7 +136,9 @@ static void read_pcm_s32(struct amdtp_st
38 byte = (u8 *)buffer + p->pcm_byte_offset;
39
40 for (c = 0; c < channels; ++c) {
41- *dst = (byte[0] << 24) | (byte[1] << 16) | byte[2];
42+ *dst = (byte[0] << 24) |
43+ (byte[1] << 16) |
44+ (byte[2] << 8);
45 byte += 3;
46 dst++;
47 }