From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14837C43381 for ; Mon, 18 Mar 2019 09:30:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA47A21734 for ; Mon, 18 Mar 2019 09:30:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552901436; bh=7XTt04tmsP0vFbPT95TicczkYdAsqfE41fpwG7v+2TA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=y0Qpi+uU0wUAETROM11b1d0Vj5HRjbt6NpgEJBsTcBahjzvyWgJHhCdUI4sV5DEWY eUdKHSFa64F8Lu21tOPcPuSuD2RxKeqv51C7cyftlltPLTPrTOUP2J+5lu0k08gMFo U4m5uFWkcWlFN/a+8azaBQvzerH/3PRoStTok1Cw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728426AbfCRJaf (ORCPT ); Mon, 18 Mar 2019 05:30:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:37670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728093AbfCRJab (ORCPT ); Mon, 18 Mar 2019 05:30:31 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 275F1214D8; Mon, 18 Mar 2019 09:30:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552901430; bh=7XTt04tmsP0vFbPT95TicczkYdAsqfE41fpwG7v+2TA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ABa8tQ/mE1KrpKOm8irmVYjz6JDcDbhj97U/yVz46zeRvxdfNmItxdXVAXEzVOa7C h+GN3d4Hhd0PksrxyBYBpfAe7+h8fRBUTn2EC7RmpqzdWb2CbG1ysWWYvZY8cYut2n j7fYdY389sU29qKtA4LAcL0OANSJCZu30znYSVHI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Peter=20Sj=C3=B6berg?= , Takashi Sakamoto , Takashi Iwai Subject: [PATCH 4.20 42/52] ALSA: firewire-motu: fix construction of PCM frame for capture direction Date: Mon, 18 Mar 2019 10:25:29 +0100 Message-Id: <20190318083848.712198097@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190318083843.398913295@linuxfoundation.org> References: <20190318083843.398913295@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Sakamoto commit f97a0944a72b26a2bece72516294e112a890f98a upstream. 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 Cc: # v4.12+ Fixes: 4641c9394010 ("ALSA: firewire-motu: add MOTU specific protocol layer") Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/firewire/motu/amdtp-motu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/sound/firewire/motu/amdtp-motu.c +++ b/sound/firewire/motu/amdtp-motu.c @@ -136,7 +136,9 @@ static void read_pcm_s32(struct amdtp_st byte = (u8 *)buffer + p->pcm_byte_offset; for (c = 0; c < channels; ++c) { - *dst = (byte[0] << 24) | (byte[1] << 16) | byte[2]; + *dst = (byte[0] << 24) | + (byte[1] << 16) | + (byte[2] << 8); byte += 3; dst++; }