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=unavailable 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 CA2E6C43381 for ; Mon, 18 Mar 2019 09:41:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9A8BD2083D for ; Mon, 18 Mar 2019 09:41:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552902093; bh=gl+7B0CYp/efPD69FQ6AZLrcbBbhaZ4pZjya/agZwX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0F+TNz6tZDRXTaJPz3PQs0QPrRBRgFMMNEByP84hl4jKtb+c7qAzmHSrpyZGnZzgr pbxFRRurr061vsfLyEbjy5iNwulInhJMgUfYEjPt8OGQUGivabp6AddFfWudHs3v11 Cc9gro43TOZZvbtW8M//YvxpO2gG1TT+/NNr6b0k= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728924AbfCRJdy (ORCPT ); Mon, 18 Mar 2019 05:33:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:42236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728921AbfCRJdx (ORCPT ); Mon, 18 Mar 2019 05:33:53 -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 A8446214D8; Mon, 18 Mar 2019 09:33:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552901633; bh=gl+7B0CYp/efPD69FQ6AZLrcbBbhaZ4pZjya/agZwX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zX3y/+xz6yfvHEOsViHFtifl4JJlJ8m8R8qOgfCx45hof/h596ZIs9fXqg9CtioEP 74jgTdERM71HmtT1wHqx0VrBdaJuh54oOATvBCw3+Dfjs94YDfFZbQcs3yE2PxakqL 0m/cicZaf1NaiMDkDaJH9kQrJx5FkXIYGffRZVXY= 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.19 40/52] ALSA: firewire-motu: fix construction of PCM frame for capture direction Date: Mon, 18 Mar 2019 10:25:37 +0100 Message-Id: <20190318084018.228063303@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190318084013.532280682@linuxfoundation.org> References: <20190318084013.532280682@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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.19-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++; }