* [PATCH 0/3] ALSA: firewire-lib: fixes for processing packets without CIP header
@ 2018-12-15 10:03 Takashi Sakamoto
2018-12-15 10:03 ` [PATCH 1/3] ALSA: firewire-lib: fix wrong handling payload_length as payload_quadlet Takashi Sakamoto
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Takashi Sakamoto @ 2018-12-15 10:03 UTC (permalink / raw)
To: clemens, tiwai; +Cc: alsa-devel
Hi,
In kernel v4.12, a series of patch was applied to IEC 61883-1/6 packet
streaming engine in ALSA firewire stack to process isochronous packet
without CIP header. But this included some bugs. Especially, for capture
PCM substream, the engine handles PCM frames for applications as four
times against real time.
This patchset fixes the bugs.
Takashi Sakamoto (3):
ALSA: firewire-lib: fix wrong handling payload_length as
payload_quadlet
ALSA: firewire-lib: fix wrong assignment for
'out_packet_without_header' tracepoint
ALSA: firewire-lib: use the same print format for 'without_header'
tracepoints
sound/firewire/amdtp-stream-trace.h | 4 ++--
sound/firewire/amdtp-stream.c | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
--
2.19.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] ALSA: firewire-lib: fix wrong handling payload_length as payload_quadlet
2018-12-15 10:03 [PATCH 0/3] ALSA: firewire-lib: fixes for processing packets without CIP header Takashi Sakamoto
@ 2018-12-15 10:03 ` Takashi Sakamoto
2018-12-15 10:03 ` [PATCH 2/3] ALSA: firewire-lib: fix wrong assignment for 'out_packet_without_header' tracepoint Takashi Sakamoto
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Takashi Sakamoto @ 2018-12-15 10:03 UTC (permalink / raw)
To: clemens, tiwai; +Cc: alsa-devel, stable
In IEC 61883-1/6 engine of ALSA firewire stack, a packet handler has a
second argument for 'the number of bytes in payload of isochronous
packet'. However, an incoming packet handler without CIP header uses the
value as 'the number of quadlets in the payload'. This brings userspace
applications to receive the number of PCM frames as four times against
real time.
This commit fixes the bug.
Cc: <stable@vger.kernel.org> # v4.12+
Fixes: 3b196c394dd ('ALSA: firewire-lib: add no-header packet processing')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
sound/firewire/amdtp-stream.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c
index 9be76c808fcc..3ada55ed5381 100644
--- a/sound/firewire/amdtp-stream.c
+++ b/sound/firewire/amdtp-stream.c
@@ -654,15 +654,17 @@ static int handle_in_packet(struct amdtp_stream *s,
}
static int handle_in_packet_without_header(struct amdtp_stream *s,
- unsigned int payload_quadlets, unsigned int cycle,
+ unsigned int payload_length, unsigned int cycle,
unsigned int index)
{
__be32 *buffer;
+ unsigned int payload_quadlets;
unsigned int data_blocks;
struct snd_pcm_substream *pcm;
unsigned int pcm_frames;
buffer = s->buffer.packets[s->packet_index].buffer;
+ payload_quadlets = payload_length / 4;
data_blocks = payload_quadlets / s->data_block_quadlets;
trace_in_packet_without_header(s, cycle, payload_quadlets, data_blocks,
--
2.19.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] ALSA: firewire-lib: fix wrong assignment for 'out_packet_without_header' tracepoint
2018-12-15 10:03 [PATCH 0/3] ALSA: firewire-lib: fixes for processing packets without CIP header Takashi Sakamoto
2018-12-15 10:03 ` [PATCH 1/3] ALSA: firewire-lib: fix wrong handling payload_length as payload_quadlet Takashi Sakamoto
@ 2018-12-15 10:03 ` Takashi Sakamoto
2018-12-15 10:03 ` [PATCH 3/3] ALSA: firewire-lib: use the same print format for 'without_header' tracepoints Takashi Sakamoto
2018-12-16 9:11 ` [PATCH 0/3] ALSA: firewire-lib: fixes for processing packets without CIP header Takashi Iwai
3 siblings, 0 replies; 5+ messages in thread
From: Takashi Sakamoto @ 2018-12-15 10:03 UTC (permalink / raw)
To: clemens, tiwai; +Cc: alsa-devel, stable
An initial commit to add tracepoints for packets without CIP headers
introduces a wrong assignment to 'data_blocks' value of
'out_packet_without_header' tracepoint.
This commit fixes the bug.
Cc: <stable@vger.kernel.org> # v4.12+
Fixes: b164d2fd6e49 ('ALSA: firewire_lib: add tracepoints for packets without CIP headers')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
sound/firewire/amdtp-stream-trace.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/firewire/amdtp-stream-trace.h b/sound/firewire/amdtp-stream-trace.h
index 54cdd4ffa9ce..c05b3da0aa1c 100644
--- a/sound/firewire/amdtp-stream-trace.h
+++ b/sound/firewire/amdtp-stream-trace.h
@@ -169,7 +169,7 @@ TRACE_EVENT(out_packet_without_header,
__entry->dest = fw_parent_device(s->unit)->node_id;
__entry->payload_quadlets = payload_length / 4;
__entry->data_blocks = data_blocks,
- __entry->data_blocks = s->data_block_counter,
+ __entry->data_block_counter = s->data_block_counter,
__entry->packet_index = s->packet_index;
__entry->irq = !!in_interrupt();
__entry->index = index;
--
2.19.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] ALSA: firewire-lib: use the same print format for 'without_header' tracepoints
2018-12-15 10:03 [PATCH 0/3] ALSA: firewire-lib: fixes for processing packets without CIP header Takashi Sakamoto
2018-12-15 10:03 ` [PATCH 1/3] ALSA: firewire-lib: fix wrong handling payload_length as payload_quadlet Takashi Sakamoto
2018-12-15 10:03 ` [PATCH 2/3] ALSA: firewire-lib: fix wrong assignment for 'out_packet_without_header' tracepoint Takashi Sakamoto
@ 2018-12-15 10:03 ` Takashi Sakamoto
2018-12-16 9:11 ` [PATCH 0/3] ALSA: firewire-lib: fixes for processing packets without CIP header Takashi Iwai
3 siblings, 0 replies; 5+ messages in thread
From: Takashi Sakamoto @ 2018-12-15 10:03 UTC (permalink / raw)
To: clemens, tiwai; +Cc: alsa-devel, stable
An initial commit to add tracepoints for packets without CIP headers
uses different print formats for added tracepoints. However this is not
convenient for users/developers to prepare debug tools.
This commit uses the same format for the two tracepoints.
Cc: <stable@vger.kernel.org> # v4.12+
Fixes: b164d2fd6e49 ('ALSA: firewire_lib: add tracepoints for packets without CIP headers')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
sound/firewire/amdtp-stream-trace.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/firewire/amdtp-stream-trace.h b/sound/firewire/amdtp-stream-trace.h
index c05b3da0aa1c..ac20acf48fc6 100644
--- a/sound/firewire/amdtp-stream-trace.h
+++ b/sound/firewire/amdtp-stream-trace.h
@@ -131,7 +131,7 @@ TRACE_EVENT(in_packet_without_header,
__entry->index = index;
),
TP_printk(
- "%02u %04u %04x %04x %02d %03u %3u %3u %02u %01u %02u",
+ "%02u %04u %04x %04x %02d %03u %02u %03u %02u %01u %02u",
__entry->second,
__entry->cycle,
__entry->src,
--
2.19.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] ALSA: firewire-lib: fixes for processing packets without CIP header
2018-12-15 10:03 [PATCH 0/3] ALSA: firewire-lib: fixes for processing packets without CIP header Takashi Sakamoto
` (2 preceding siblings ...)
2018-12-15 10:03 ` [PATCH 3/3] ALSA: firewire-lib: use the same print format for 'without_header' tracepoints Takashi Sakamoto
@ 2018-12-16 9:11 ` Takashi Iwai
3 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2018-12-16 9:11 UTC (permalink / raw)
To: Takashi Sakamoto; +Cc: alsa-devel, clemens
On Sat, 15 Dec 2018 11:03:18 +0100,
Takashi Sakamoto wrote:
>
> Hi,
>
> In kernel v4.12, a series of patch was applied to IEC 61883-1/6 packet
> streaming engine in ALSA firewire stack to process isochronous packet
> without CIP header. But this included some bugs. Especially, for capture
> PCM substream, the engine handles PCM frames for applications as four
> times against real time.
>
> This patchset fixes the bugs.
>
> Takashi Sakamoto (3):
> ALSA: firewire-lib: fix wrong handling payload_length as
> payload_quadlet
> ALSA: firewire-lib: fix wrong assignment for
> 'out_packet_without_header' tracepoint
> ALSA: firewire-lib: use the same print format for 'without_header'
> tracepoints
Applied all three patches now. Thanks.
Takashi
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-12-16 9:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-15 10:03 [PATCH 0/3] ALSA: firewire-lib: fixes for processing packets without CIP header Takashi Sakamoto
2018-12-15 10:03 ` [PATCH 1/3] ALSA: firewire-lib: fix wrong handling payload_length as payload_quadlet Takashi Sakamoto
2018-12-15 10:03 ` [PATCH 2/3] ALSA: firewire-lib: fix wrong assignment for 'out_packet_without_header' tracepoint Takashi Sakamoto
2018-12-15 10:03 ` [PATCH 3/3] ALSA: firewire-lib: use the same print format for 'without_header' tracepoints Takashi Sakamoto
2018-12-16 9:11 ` [PATCH 0/3] ALSA: firewire-lib: fixes for processing packets without CIP header Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox