motu: for the original 828, the bit 0x40 in the configuration register at 0x0b00 has been confirmed as a monitor mute bit.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2368 2be59082-3212-0410-8809-b0798e1608f0
motu: fine-tune and optimise the register values used when configuring the optical port modes on an 828mk1.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2369 2be59082-3212-0410-8809-b0798e1608f0
motu: when 1 or 2 pad bytes are required to satisfy the data alignment requirements of the interface, ensure they are zeroed before transmission (consistent with the behaviour of MOTU drivers under other systems).  Being less than the sample size (3 bytes), these bytes cannot be associated with any ports and therefore can take on non-zero values under certain conditions.  By explicitly zeroing them it is ensured that only pad bytes of zero are ever sent to the interface.  This issue was discovered while investigating the on-going failure to get playback working on the 828mk1.  Unfortunately this patch has had no effect 828mk1 playback.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2370 2be59082-3212-0410-8809-b0798e1608f0
motu: 828mk1: fine-tune the ordering of register writes when setting optical port modes.  If the device appears uninitialised at startup, assume a default optical mode (off) rather than relying on the device registers for this information - the fields involved in the optical port mode setting do not appear to retain their setting over a power cycle.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2371 2be59082-3212-0410-8809-b0798e1608f0
motu: 828mk1: order register writes for streaming startup to match that observed under other systems.  Still no playback audio.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2372 2be59082-3212-0410-8809-b0798e1608f0
rme: add some debug output to get_hardware_state()\n

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2373 2be59082-3212-0410-8809-b0798e1608f0
rme: fix a typo in an error condition return value in setSamplingFrequency()

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2374 2be59082-3212-0410-8809-b0798e1608f0
rme: minor bugfixes: return a useful value from destroyMixer() and fix a signed/unsigned warning in setSamplingFrequency().

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2375 2be59082-3212-0410-8809-b0798e1608f0
rme: revise clock rate selection logic to hopefully provide a saner outcome when the device is in slave mode and when jumping to a sample rate whose multiplier differs from that which is stored in flash.  Add comments explaining that explicit DDS control is not currently offered via FFADO.  Add error and warning messages in places which might be helpful.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2376 2be59082-3212-0410-8809-b0798e1608f0
rme: another clock mode adjustment.  For now, list all sample rates regardless of clock mode.  This makes ffado-mixer seem more logical.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2377 2be59082-3212-0410-8809-b0798e1608f0
ffado-mixer: allow the sample rate control to adjust the frequencies on offer if these are changed dynamically by the interface (as can happen if an external clock changes on certain devices).  If 0 is returned by a device as an available sample rate, consider this to indicate a 'no clock' situation which can arise if an external clock is selected but no clock is present.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2378 2be59082-3212-0410-8809-b0798e1608f0
rme: another attempt to provide a sensible sample rate interface for the case where the fireface is externally clocked.  In conjunction with the changes in r2378, ffado-mixer now behaves in a consistent manner with regard to the frequency reported in the global sampling rate widget when the device is in slave mode: the rate displayed is that of the external clock, and only this rate can be selected.  This also ensures that if jackd is started its rate must exactly match the external rate.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2379 2be59082-3212-0410-8809-b0798e1608f0
rme: copy current software sampling rate to the settings structure so it can be correctly referenced by write_device_flash_settings() when writing settings to flash.  Without this, the rate written to flash would always be the initial rate used on ffado startup.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2380 2be59082-3212-0410-8809-b0798e1608f0
rme: improve error logging when difficulties are encountered when reading or writing to device registers.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2381 2be59082-3212-0410-8809-b0798e1608f0
rme: only print the debug output from get_hardware_state() for the first few calls in a given session since these are the most important ones from the debugging point of view.  Currently the status after the first two calls are shown but this can be adjusted if necessary.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2382 2be59082-3212-0410-8809-b0798e1608f0
when checking the version of jackd, concern ourselves only with the last line of output.  Jackd2 produces multiple lines of output when '--version' is given; the version information we are after is in the last line.  This change will not affect jack1, which returns only a single line.  Patch from noiseload in ticket #371 - thanks!

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2383 2be59082-3212-0410-8809-b0798e1608f0
rme: temporarily work around an issue introduced in r2379 whereby the kernel will freeze after a short period of time due to a high rate of async transactions being initiated in get_hardware_state().  This is called in getSamplingFrequency() which itself gets called from the transmit stream processor via getNominalFramesPerPacket() and getFramesPerPacket().  A proper fix will follow in due course.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2384 2be59082-3212-0410-8809-b0798e1608f0
rme: add temporary debug output to try to track down the cause of the apparent backwards-moving cycle timer which seen on some systems.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2385 2be59082-3212-0410-8809-b0798e1608f0
fix a logic error in the IsoHandler destructor regarding the use of the disable lock and behaviour of pthread_mutex_trylock() when the lock is not held by something else.  Normally pthread_mutex_trylock() will return EBUSY when called from the destructor for reasons noted in r1985.  However, this isn't necessarily the cause in the face of startup errors, and if the lock is free it will be acquired by pthread_mutex_trylock().  Therefore to prevent a deadlock there is a need to ensure the lock is always released before calling disable().

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2386 2be59082-3212-0410-8809-b0798e1608f0
StreamProcessorManager: if start() detects a problem, call stop() before returning so all stream processors are in the stopped state on return.  This is what the caller would reasonably expect is start() fails.  In the case where syncStartAll fails, this may make the resulting shutdown more reliable because the IsoHandlers for each stream will have been stopped before their destructor is called.  Disabling the IsoHandlers from the destructor seems to cause races under some circumstances, and judging from the BUG error message from ~IsoHandlers() it isn't really the intended approach.

git-svn-id: svn+ssh://ffado.org/ffado/trunk@2387 2be59082-3212-0410-8809-b0798e1608f0