]> Git Repo - linux.git/commitdiff
ALSA: firewire-motu: fix construction of PCM frame for capture direction
authorTakashi Sakamoto <[email protected]>
Tue, 26 Feb 2019 04:38:37 +0000 (13:38 +0900)
committerTakashi Iwai <[email protected]>
Tue, 26 Feb 2019 06:11:40 +0000 (07:11 +0100)
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 <[email protected]>
Cc: <[email protected]> # v4.12+
Fixes: 4641c9394010 ("ALSA: firewire-motu: add MOTU specific protocol layer")
Signed-off-by: Takashi Sakamoto <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
sound/firewire/motu/amdtp-motu.c

index f0555a24d90ed1e6df27ea65b7eec57721c4751a..6c9b743ea74bb7d00683abbfdafd31a8498933eb 100644 (file)
@@ -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++;
                }
This page took 0.056162 seconds and 4 git commands to generate.