* [PATCH] ALSA: firewire-motu: fix construction of PCM frame for capture direction
@ 2019-02-26 4:38 Takashi Sakamoto
2019-02-26 6:12 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Takashi Sakamoto @ 2019-02-26 4:38 UTC (permalink / raw)
To: clemens, tiwai; +Cc: alsa-devel, ffado-devel, stable
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>
---
sound/firewire/motu/amdtp-motu.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/firewire/motu/amdtp-motu.c b/sound/firewire/motu/amdtp-motu.c
index f0555a24d90e..6c9b743ea74b 100644
--- 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_stream *s,
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++;
}
--
2.19.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: firewire-motu: fix construction of PCM frame for capture direction
2019-02-26 4:38 [PATCH] ALSA: firewire-motu: fix construction of PCM frame for capture direction Takashi Sakamoto
@ 2019-02-26 6:12 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2019-02-26 6:12 UTC (permalink / raw)
To: Takashi Sakamoto; +Cc: clemens, alsa-devel, ffado-devel, stable
On Tue, 26 Feb 2019 05:38:37 +0100,
Takashi Sakamoto wrote:
>
> 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>
Applied, thanks.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-02-26 6:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-26 4:38 [PATCH] ALSA: firewire-motu: fix construction of PCM frame for capture direction Takashi Sakamoto
2019-02-26 6:12 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.