libraw1394 fork
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.
Go to file
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
debian fix make dist without doc 2004-10-31 00:52:28 +00:00
doc doc: let "make clean" remove generated HTML files 2010-02-01 22:10:12 +01:00
src Prevent requests for previously provided iso tx packets 2015-04-28 22:16:16 +02:00
tools tools: Fix startup of dumpiso and sendiso on juju 2013-08-24 11:51:11 +02:00
AUTHORS configure.ac, Changelog, NEWS etc.: update to version 2.0.6 2010-11-01 23:25:36 +01:00
COPYING.LIB Ensure this ends up in distributions. 2000-03-12 04:08:48 +00:00
ChangeLog Changelog, NEWS: update to version 2.1.0 2012-07-29 12:01:44 +02:00
INSTALL Reset the libtool age. 2008-07-18 01:08:30 -07:00
Makefile.am Fix build due to incomplete tarball. 2009-06-30 11:12:55 -07:00
NEWS Changelog, NEWS: update to version 2.1.0 2012-07-29 12:01:44 +02:00
README configure.ac, Changelog, NEWS etc.: update to version 2.0.6 2010-11-01 23:25:36 +01:00
autogen.sh Ooops...libtool works a bit different than I thought, but atleast it works 2003-07-13 01:27:13 +00:00
configure.ac Increase libtool version to 2.1.0 2012-06-18 02:07:31 +02:00
libraw1394.pc.in pkgconfig include path should not contain libraw1394 2004-11-20 04:56:36 +00:00
libraw1394.spec.in bump versions, build fixes, and doc updates 2004-10-30 22:49:27 +00:00

README

				   libraw1394
				   ==========

1. About libraw1394

	libraw1394 is the only supported interface to the kernel side raw1394 of
the Linux IEEE-1394 subsystem, which provides direct access to the connected
1394 buses to user space.  Through libraw1394/raw1394, applications can directly
send to and receive from other nodes without requiring a kernel driver for the
protocol in question.

	The reason for making a library the interface to the kernel is to avoid
a program dependency on the kernel version, which would hinder development and
optimization of raw1394.  If development changed the protocol and made it
incompatible with previous versions only the libraw1394 has to be upgraded to
match the kernel version (instead of all applications).

	Since version 2, libraw1394 also works with the kernel driver
firewire-core.  libraw1394's role has thus become that of a raw1394
compatibility layer for existing applications when running on firewire-core.


2. Copyleft

	libraw1394 itself is licensed under the Lesser General Public License
(short LGPL, see file COPYING.LIB in the source distribution).  Other files in
the source archives not belonging to but being part of the build procedure of
libraw1394 are under their own licenses, as stated at the top of the individual
files.


3. API documentation

	Finally there is something, in the doc subdirectory.  The file is
libraw1394.sgml (it's Docbook format), and there are preformatted PostScript and
HTML available.  This documentation is not complete yet.


4. Multithreading

	This library should be multithreadable with the restriction that one
raw1394handle_t may be used only within a single thread.  Multiple threads
operating on the same handle would royally mess up the kernel-user protocol.
Simply use separate handles for each thread in which you need to use libraw1394.


5. Pkg-config

	The library comes with a pkg-config .pc file, so you can check for
libraw1394 and its version in your configure script.  For example, here is how 
to use the autoconf macro:

PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 1.1.0)

	This macro sets the variables LIBRAW1394_CFLAGS and LIBRAW1394_LIBS.  You 
have to include those into your build variables so that the build process 
correctly links with libraw1394.


6. Contact

	Send questions, suggestions, bug reports and patches to the mailing
list linux1394-devel@lists.sourceforge.net.  This list is open for posting
without prior subscription, and replies will usually be Cc'd to you.  Visit
http://ieee1394.wiki.kernel.org/ for links to list subscription interfaces and
list archives.

	Maintainer of libraw1394 is currently Stefan Richter.  See the file
AUTHORS for a complete list of contributors to libraw1394.

	Source repository:
git://git.kernel.org/pub/scm/libs/ieee1394/libraw1394.git
http://git.kernel.org/pub/scm/libs/ieee1394/libraw1394.git
https://git.kernel.org/pub/scm/libs/ieee1394/libraw1394.git

	Gitweb:
http://git.kernel.org/?p=libs/ieee1394/libraw1394.git

	Release tarballs:
https://www.kernel.org/pub/linux/libs/ieee1394/
ftp://ftp.kernel.org/pub/linux/libs/ieee1394/