This repository has been archived on 2022-09-20. You can view files and clone it, but cannot push or open issues or pull requests.
libraw1394/src
Jonathan Woithe c756fb8321 Prevent requests for previously provided iso tx packets
This bugfix grew out of an extended investigation into a problem encountered
by a small number of people running FFADO.  FFADO would report that the tx
iso cycle number supplied to the iso tx callback seemingly went backwards -
something which should not ordinarily occur.  The bug seemed to be sensitive
to timing and in some cases would disappear when debug traces were inserted
into either FFADO or libraw1394.  In essence, libraw1394 was requesting tx
data for cycles which had already been requested.

Initial discussions can be found in the thread "Problem with RME FF800. Can
not start jackd" on the ffado-user mailing list.  A followup investigation
is tracked in FFADO ticket number 379
(http://subversion.ffado.org/ticket/379) and referenced in the thread
"Revisiting backward cycle number sequence (ticket 379)" on ffado-devel.
The latter mailing list thread includes a lengthy explanation of what I
think is happening.

To summarise, the root of the problem seems to be that on certain machines
under certain conditions, something causes the kernel to post an iso tx
event at a time when fewer than irq_interval packets have been transmitted.
Unfortunately it has not been possible to determine the underlying cause of
this.  Whatever the cause, tests carried out with the reporter of ticket 379
have shown that it is occurring.  As a result, the adjustment to
libraw1394's packet_count must be done with reference to the number of
packets reported as transmitted by the kernel instead of simply assuming
that irq_interval packets have been sent.

A patch implementing this fix is at the end of this post.  This fixes the
problem when the newer ABI is in use, which provides tx packet timestamps
(and thus an indication of the number of packets actually transmitted) to
userspace.  It does not address the problem when the older ABI is used, but
given the nature of the problem I don't think it's possible to fix it
without access to the timestamps (or at least without some way to determine
the number of packets really transmitted).

Testing by "juanramon" (see ticket 379) has demonstrated that it fixes the
"backward cycle number" problem on his machine.

Thanks to Andreas Hehn and "juanramon" for their invaluable help in tracking
this down.

Signed-off-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2015-04-28 22:16:16 +02:00
..
Makefile.am Include local firewire-*.h instead of system-wide <linux/firewire-*.h> 2012-05-25 22:19:43 +02:00
arm.c Address some compiler warnings 2008-10-28 22:56:09 -07:00
csr.h - Added FCP register addresses 1999-12-18 16:02:15 +00:00
dispatch.c Save and restore errno in raw1394_new_handle{,_on_port} for legacy applications 2013-08-24 13:07:37 +02:00
errors.c Change handle validation to prevent segfault and be more informative. 2008-07-06 12:06:40 -07:00
eventloop.c Address some compiler warnings 2008-10-28 22:56:09 -07:00
fcp.c First cut at integrating juju 2008-04-23 17:44:36 -07:00
firewire-cdev.h Include local firewire-*.h instead of system-wide <linux/firewire-*.h> 2012-05-25 22:19:43 +02:00
firewire-constants.h Add firewire-{cdev,constants}.h from Linux v3.4 2012-05-25 21:27:40 +02:00
fw-iso.c Prevent requests for previously provided iso tx packets 2015-04-28 22:16:16 +02:00
fw.c Fix memory leak in response handler 2015-04-28 22:09:12 +02:00
fw.h Add raw1394_get_speed() API 2012-06-30 19:02:20 +02:00
ieee1394-ioctl.h added raw1394_read_cycle_timer, contributed by Pieter Palmers 2007-02-14 05:29:18 +00:00
ieee1394.h Trivial whitespace normalization in ieee1394.h and raw1394.h 2012-06-30 17:38:45 +02:00
iso.c First cut at integrating juju 2008-04-23 17:44:36 -07:00
kernel-raw1394.h added raw1394_read_cycle_timer, contributed by Pieter Palmers 2007-02-14 05:29:18 +00:00
main.c Address some compiler warnings 2008-10-28 22:56:09 -07:00
raw1394.h Documentation improvement: return code of raw1394_read_cycle_timer{,_and_clock} 2012-07-31 20:31:35 +02:00
raw1394_private.h Move the source code files in the juju directory into the src directory and 2008-04-30 14:37:28 -07:00
readwrite.c Remove UTF-8 whitespace. 2012-02-19 19:53:14 +01:00
version.c reorganize and update documentation; fix compiler warning 2004-11-11 03:19:09 +00:00